From 42590c9f8ef528e91f3843e93b9d8a50834db6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Tue, 1 May 2018 12:42:22 +0200 Subject: [PATCH 01/13] Generated swagger API with simple SuplaApi auth --- README.md | 201 +++ composer.json | 17 +- composer.lock | 253 ++- docs/Api/AccessIDsApi.md | 299 ++++ docs/Api/ChannelGroupsApi.md | 360 ++++ docs/Api/ChannelsApi.md | 435 +++++ docs/Api/ClientAppsApi.md | 183 ++ docs/Api/IODevicesApi.md | 303 ++++ docs/Api/LocationsApi.md | 303 ++++ docs/Api/SchedulesApi.md | 360 ++++ docs/Api/ServerApi.md | 104 ++ docs/Api/UsersApi.md | 122 ++ docs/Model/AccessID.md | 16 + docs/Model/Body.md | 10 + docs/Model/Body1.md | 13 + docs/Model/Body10.md | 14 + docs/Model/Body2.md | 18 + docs/Model/Body3.md | 11 + docs/Model/Body4.md | 14 + docs/Model/Body5.md | 14 + docs/Model/Body6.md | 11 + docs/Model/Body7.md | 12 + docs/Model/Body8.md | 12 + docs/Model/Body9.md | 10 + docs/Model/Channel.md | 28 + docs/Model/ChannelFunction.md | 14 + docs/Model/ChannelFunctionAction.md | 12 + docs/Model/ChannelFunctionActionEnum.md | 9 + docs/Model/ChannelFunctionEnumNames.md | 9 + docs/Model/ChannelGroup.md | 19 + docs/Model/ChannelParam.md | 9 + docs/Model/ChannelType.md | 13 + docs/Model/ClientApp.md | 22 + docs/Model/Device.md | 27 + docs/Model/InlineResponse200.md | 17 + docs/Model/InlineResponse2001.md | 10 + docs/Model/InlineResponse2002.md | 14 + docs/Model/InlineResponse2003.md | 10 + docs/Model/InlineResponse2004.md | 12 + docs/Model/InlineResponse200Timezone.md | 11 + docs/Model/InlineResponse400.md | 11 + docs/Model/InlineResponse4001.md | 11 + docs/Model/InlineResponse409.md | 11 + docs/Model/InlineResponse503.md | 10 + docs/Model/Location.md | 21 + docs/Model/Schedule.md | 22 + docs/Model/ScheduleClosestExecutions.md | 11 + docs/Model/ScheduleFuture.md | 10 + docs/Model/SchedulePast.md | 13 + docs/Model/ScheduleRequest.md | 17 + docs/Model/ScheduleResult.md | 10 + lib/Api/AccessIDsApi.php | 1467 +++++++++++++++ lib/Api/ChannelGroupsApi.php | 1746 ++++++++++++++++++ lib/Api/ChannelsApi.php | 2152 +++++++++++++++++++++++ lib/Api/ClientAppsApi.php | 914 ++++++++++ lib/Api/IODevicesApi.php | 1498 ++++++++++++++++ lib/Api/LocationsApi.php | 1491 ++++++++++++++++ lib/Api/SchedulesApi.php | 1728 ++++++++++++++++++ lib/Api/ServerApi.php | 616 +++++++ lib/Api/UsersApi.php | 640 +++++++ lib/ApiException.php | 122 ++ lib/Configuration.php | 430 +++++ lib/HeaderSelector.php | 109 ++ lib/Model/AccessID.php | 480 +++++ lib/Model/Body.php | 344 ++++ lib/Model/Body1.php | 390 ++++ lib/Model/Body10.php | 420 +++++ lib/Model/Body2.php | 540 ++++++ lib/Model/Body3.php | 330 ++++ lib/Model/Body4.php | 420 +++++ lib/Model/Body5.php | 420 +++++ lib/Model/Body6.php | 330 ++++ lib/Model/Body7.php | 360 ++++ lib/Model/Body8.php | 360 ++++ lib/Model/Body9.php | 300 ++++ lib/Model/Channel.php | 840 +++++++++ lib/Model/ChannelFunction.php | 420 +++++ lib/Model/ChannelFunctionAction.php | 360 ++++ lib/Model/ChannelFunctionActionEnum.php | 77 + lib/Model/ChannelFunctionEnumNames.php | 117 ++ lib/Model/ChannelGroup.php | 570 ++++++ lib/Model/ChannelParam.php | 276 +++ lib/Model/ChannelType.php | 472 +++++ lib/Model/ClientApp.php | 660 +++++++ lib/Model/Device.php | 810 +++++++++ lib/Model/InlineResponse200.php | 510 ++++++ lib/Model/InlineResponse2001.php | 300 ++++ lib/Model/InlineResponse2002.php | 420 +++++ lib/Model/InlineResponse2003.php | 300 ++++ lib/Model/InlineResponse2004.php | 360 ++++ lib/Model/InlineResponse200Timezone.php | 330 ++++ lib/Model/InlineResponse400.php | 330 ++++ lib/Model/InlineResponse4001.php | 330 ++++ lib/Model/InlineResponse409.php | 330 ++++ lib/Model/InlineResponse503.php | 300 ++++ lib/Model/Location.php | 630 +++++++ lib/Model/ModelInterface.php | 95 + lib/Model/Schedule.php | 700 ++++++++ lib/Model/ScheduleClosestExecutions.php | 330 ++++ lib/Model/ScheduleFuture.php | 300 ++++ lib/Model/SchedulePast.php | 390 ++++ lib/Model/ScheduleRequest.php | 550 ++++++ lib/Model/ScheduleResult.php | 300 ++++ lib/ObjectSerializer.php | 318 ++++ src/SuplaApi.php | 43 + src/SuplaApiConfiguration.php | 29 + src/demo.php | 45 + 107 files changed, 32913 insertions(+), 14 deletions(-) create mode 100644 docs/Api/AccessIDsApi.md create mode 100644 docs/Api/ChannelGroupsApi.md create mode 100644 docs/Api/ChannelsApi.md create mode 100644 docs/Api/ClientAppsApi.md create mode 100644 docs/Api/IODevicesApi.md create mode 100644 docs/Api/LocationsApi.md create mode 100644 docs/Api/SchedulesApi.md create mode 100644 docs/Api/ServerApi.md create mode 100644 docs/Api/UsersApi.md create mode 100644 docs/Model/AccessID.md create mode 100644 docs/Model/Body.md create mode 100644 docs/Model/Body1.md create mode 100644 docs/Model/Body10.md create mode 100644 docs/Model/Body2.md create mode 100644 docs/Model/Body3.md create mode 100644 docs/Model/Body4.md create mode 100644 docs/Model/Body5.md create mode 100644 docs/Model/Body6.md create mode 100644 docs/Model/Body7.md create mode 100644 docs/Model/Body8.md create mode 100644 docs/Model/Body9.md create mode 100644 docs/Model/Channel.md create mode 100644 docs/Model/ChannelFunction.md create mode 100644 docs/Model/ChannelFunctionAction.md create mode 100644 docs/Model/ChannelFunctionActionEnum.md create mode 100644 docs/Model/ChannelFunctionEnumNames.md create mode 100644 docs/Model/ChannelGroup.md create mode 100644 docs/Model/ChannelParam.md create mode 100644 docs/Model/ChannelType.md create mode 100644 docs/Model/ClientApp.md create mode 100644 docs/Model/Device.md create mode 100644 docs/Model/InlineResponse200.md create mode 100644 docs/Model/InlineResponse2001.md create mode 100644 docs/Model/InlineResponse2002.md create mode 100644 docs/Model/InlineResponse2003.md create mode 100644 docs/Model/InlineResponse2004.md create mode 100644 docs/Model/InlineResponse200Timezone.md create mode 100644 docs/Model/InlineResponse400.md create mode 100644 docs/Model/InlineResponse4001.md create mode 100644 docs/Model/InlineResponse409.md create mode 100644 docs/Model/InlineResponse503.md create mode 100644 docs/Model/Location.md create mode 100644 docs/Model/Schedule.md create mode 100644 docs/Model/ScheduleClosestExecutions.md create mode 100644 docs/Model/ScheduleFuture.md create mode 100644 docs/Model/SchedulePast.md create mode 100644 docs/Model/ScheduleRequest.md create mode 100644 docs/Model/ScheduleResult.md create mode 100644 lib/Api/AccessIDsApi.php create mode 100644 lib/Api/ChannelGroupsApi.php create mode 100644 lib/Api/ChannelsApi.php create mode 100644 lib/Api/ClientAppsApi.php create mode 100644 lib/Api/IODevicesApi.php create mode 100644 lib/Api/LocationsApi.php create mode 100644 lib/Api/SchedulesApi.php create mode 100644 lib/Api/ServerApi.php create mode 100644 lib/Api/UsersApi.php create mode 100644 lib/ApiException.php create mode 100644 lib/Configuration.php create mode 100644 lib/HeaderSelector.php create mode 100644 lib/Model/AccessID.php create mode 100644 lib/Model/Body.php create mode 100644 lib/Model/Body1.php create mode 100644 lib/Model/Body10.php create mode 100644 lib/Model/Body2.php create mode 100644 lib/Model/Body3.php create mode 100644 lib/Model/Body4.php create mode 100644 lib/Model/Body5.php create mode 100644 lib/Model/Body6.php create mode 100644 lib/Model/Body7.php create mode 100644 lib/Model/Body8.php create mode 100644 lib/Model/Body9.php create mode 100644 lib/Model/Channel.php create mode 100644 lib/Model/ChannelFunction.php create mode 100644 lib/Model/ChannelFunctionAction.php create mode 100644 lib/Model/ChannelFunctionActionEnum.php create mode 100644 lib/Model/ChannelFunctionEnumNames.php create mode 100644 lib/Model/ChannelGroup.php create mode 100644 lib/Model/ChannelParam.php create mode 100644 lib/Model/ChannelType.php create mode 100644 lib/Model/ClientApp.php create mode 100644 lib/Model/Device.php create mode 100644 lib/Model/InlineResponse200.php create mode 100644 lib/Model/InlineResponse2001.php create mode 100644 lib/Model/InlineResponse2002.php create mode 100644 lib/Model/InlineResponse2003.php create mode 100644 lib/Model/InlineResponse2004.php create mode 100644 lib/Model/InlineResponse200Timezone.php create mode 100644 lib/Model/InlineResponse400.php create mode 100644 lib/Model/InlineResponse4001.php create mode 100644 lib/Model/InlineResponse409.php create mode 100644 lib/Model/InlineResponse503.php create mode 100644 lib/Model/Location.php create mode 100644 lib/Model/ModelInterface.php create mode 100644 lib/Model/Schedule.php create mode 100644 lib/Model/ScheduleClosestExecutions.php create mode 100644 lib/Model/ScheduleFuture.php create mode 100644 lib/Model/SchedulePast.php create mode 100644 lib/Model/ScheduleRequest.php create mode 100644 lib/Model/ScheduleResult.php create mode 100644 lib/ObjectSerializer.php create mode 100644 src/SuplaApi.php create mode 100644 src/SuplaApiConfiguration.php create mode 100644 src/demo.php diff --git a/README.md b/README.md index 5987529..9173a8d 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,204 @@ $client->getServerInfo(); TODO + + +# SwaggerClient-php +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 2.2.0 +- Build package: io.swagger.codegen.languages.PhpClientCodegen + +## Requirements + +PHP 5.5 and later + +## Installation & Usage +### Composer + +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: + +``` +{ + "repositories": [ + { + "type": "git", + "url": "https://github.com//.git" + } + ], + "require": { + "/": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + require_once('/path/to/SwaggerClient-php/vendor/autoload.php'); +``` + +## Tests + +To run the unit tests: + +``` +composer install +./vendor/bin/phpunit +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\AccessIDsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->accessidsGet($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccessIDsApi->accessidsGet: ', $e->getMessage(), PHP_EOL; +} + +?> +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://cloud.supla.org/api* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccessIDsApi* | [**accessidsGet**](docs/Api/AccessIDsApi.md#accessidsget) | **GET** /accessids | Get Access IDs list +*AccessIDsApi* | [**accessidsPost**](docs/Api/AccessIDsApi.md#accessidspost) | **POST** /accessids | Create a new Access ID +*AccessIDsApi* | [**deleteAccessID**](docs/Api/AccessIDsApi.md#deleteaccessid) | **DELETE** /accessids/{id} | Delete Access Identifier +*AccessIDsApi* | [**getAccessID**](docs/Api/AccessIDsApi.md#getaccessid) | **GET** /accessids/{id} | Get Access ID +*AccessIDsApi* | [**updateAccessID**](docs/Api/AccessIDsApi.md#updateaccessid) | **PUT** /accessids/{id} | Edit Access ID +*ChannelGroupsApi* | [**createChannelGroup**](docs/Api/ChannelGroupsApi.md#createchannelgroup) | **POST** /channel-groups | Create a new channel group +*ChannelGroupsApi* | [**deleteChannelGroup**](docs/Api/ChannelGroupsApi.md#deletechannelgroup) | **DELETE** /channel-groups/{id} | Delete Channel Group +*ChannelGroupsApi* | [**executeChannelGroupAction**](docs/Api/ChannelGroupsApi.md#executechannelgroupaction) | **PATCH** /channel-groups/{id} | Execute action on the channel group +*ChannelGroupsApi* | [**getChannelGroup**](docs/Api/ChannelGroupsApi.md#getchannelgroup) | **GET** /channel-groups/{id} | Get channel group by ID +*ChannelGroupsApi* | [**getChannelGroups**](docs/Api/ChannelGroupsApi.md#getchannelgroups) | **GET** /channel-groups | Get channels list +*ChannelGroupsApi* | [**updateChannelGroup**](docs/Api/ChannelGroupsApi.md#updatechannelgroup) | **PUT** /channel-groups/{id} | Update channel group +*ChannelsApi* | [**executeAction**](docs/Api/ChannelsApi.md#executeaction) | **PATCH** /channels/{id} | Execute action on the channel +*ChannelsApi* | [**getChannel**](docs/Api/ChannelsApi.md#getchannel) | **GET** /channels/{id} | Get channel by ID +*ChannelsApi* | [**getChannelMeasurementLogs**](docs/Api/ChannelsApi.md#getchannelmeasurementlogs) | **GET** /channels/{id}/measurement-logs | Get measurement logs. +*ChannelsApi* | [**getChannelMeasurementLogsCsvFile**](docs/Api/ChannelsApi.md#getchannelmeasurementlogscsvfile) | **GET** /channels/{id}/measurement-logs-csv | Get measurement logs as zipped CSV file. +*ChannelsApi* | [**getChannelSchedules**](docs/Api/ChannelsApi.md#getchannelschedules) | **GET** /channels/{id}/schedules | Get schedules list of the channel +*ChannelsApi* | [**getChannels**](docs/Api/ChannelsApi.md#getchannels) | **GET** /channels | Get channels list +*ChannelsApi* | [**updateChannel**](docs/Api/ChannelsApi.md#updatechannel) | **PUT** /channels/{id} | Update channel +*ClientAppsApi* | [**deleteClientApp**](docs/Api/ClientAppsApi.md#deleteclientapp) | **DELETE** /client-apps/{id} | Delete Client App +*ClientAppsApi* | [**getClientApps**](docs/Api/ClientAppsApi.md#getclientapps) | **GET** /client-apps | Get client apps +*ClientAppsApi* | [**updateClientApp**](docs/Api/ClientAppsApi.md#updateclientapp) | **PUT** /client-apps/{id} | Update client app +*IODevicesApi* | [**deleteIoDevice**](docs/Api/IODevicesApi.md#deleteiodevice) | **DELETE** /iodevices/{id} | Delete IO Device +*IODevicesApi* | [**getIoDevice**](docs/Api/IODevicesApi.md#getiodevice) | **GET** /iodevices/{id} | Get IO Device +*IODevicesApi* | [**getIoDeviceChannels**](docs/Api/IODevicesApi.md#getiodevicechannels) | **GET** /iodevices/{id}/channels | Get Channels that belong to IO Deice +*IODevicesApi* | [**getIoDevices**](docs/Api/IODevicesApi.md#getiodevices) | **GET** /iodevices | Get IO Devices +*IODevicesApi* | [**updateIoDevice**](docs/Api/IODevicesApi.md#updateiodevice) | **PUT** /iodevices/{id} | Update IO Device +*LocationsApi* | [**createLocation**](docs/Api/LocationsApi.md#createlocation) | **POST** /locations | Create a new location +*LocationsApi* | [**deleteLocation**](docs/Api/LocationsApi.md#deletelocation) | **DELETE** /locations/{id} | Delete location +*LocationsApi* | [**getLocation**](docs/Api/LocationsApi.md#getlocation) | **GET** /locations/{id} | Get location by ID +*LocationsApi* | [**getLocations**](docs/Api/LocationsApi.md#getlocations) | **GET** /locations | Get locations list +*LocationsApi* | [**updateLocation**](docs/Api/LocationsApi.md#updatelocation) | **PUT** /locations/{id} | Edit location +*SchedulesApi* | [**createSchedule**](docs/Api/SchedulesApi.md#createschedule) | **POST** /schedules | Create a new schedule +*SchedulesApi* | [**deleteSchedule**](docs/Api/SchedulesApi.md#deleteschedule) | **DELETE** /schedules/{id} | Delete Schedule +*SchedulesApi* | [**enableSchedules**](docs/Api/SchedulesApi.md#enableschedules) | **PATCH** /schedules | Enable schedules +*SchedulesApi* | [**getSchedule**](docs/Api/SchedulesApi.md#getschedule) | **GET** /schedules/{id} | Get Schedule +*SchedulesApi* | [**getSchedules**](docs/Api/SchedulesApi.md#getschedules) | **GET** /schedules | Get schedules list +*SchedulesApi* | [**updateSchedule**](docs/Api/SchedulesApi.md#updateschedule) | **PUT** /schedules/{id} | Update schedule +*ServerApi* | [**serverInfoGet**](docs/Api/ServerApi.md#serverinfoget) | **GET** /server-info | Get server status +*ServerApi* | [**serverStatusGet**](docs/Api/ServerApi.md#serverstatusget) | **GET** /server-status | Get the SUPLA Server status +*UsersApi* | [**editCurrentUser**](docs/Api/UsersApi.md#editcurrentuser) | **PATCH** /users/current | Edit current user +*UsersApi* | [**getCurrentUser**](docs/Api/UsersApi.md#getcurrentuser) | **GET** /users/current | Get current user + + +## Documentation For Models + + - [AccessID](docs/Model/AccessID.md) + - [Body](docs/Model/Body.md) + - [Body1](docs/Model/Body1.md) + - [Body10](docs/Model/Body10.md) + - [Body2](docs/Model/Body2.md) + - [Body3](docs/Model/Body3.md) + - [Body4](docs/Model/Body4.md) + - [Body5](docs/Model/Body5.md) + - [Body6](docs/Model/Body6.md) + - [Body7](docs/Model/Body7.md) + - [Body8](docs/Model/Body8.md) + - [Body9](docs/Model/Body9.md) + - [Channel](docs/Model/Channel.md) + - [ChannelFunction](docs/Model/ChannelFunction.md) + - [ChannelFunctionAction](docs/Model/ChannelFunctionAction.md) + - [ChannelFunctionActionEnum](docs/Model/ChannelFunctionActionEnum.md) + - [ChannelFunctionEnumNames](docs/Model/ChannelFunctionEnumNames.md) + - [ChannelGroup](docs/Model/ChannelGroup.md) + - [ChannelParam](docs/Model/ChannelParam.md) + - [ChannelType](docs/Model/ChannelType.md) + - [ClientApp](docs/Model/ClientApp.md) + - [Device](docs/Model/Device.md) + - [InlineResponse200](docs/Model/InlineResponse200.md) + - [InlineResponse2001](docs/Model/InlineResponse2001.md) + - [InlineResponse2002](docs/Model/InlineResponse2002.md) + - [InlineResponse2003](docs/Model/InlineResponse2003.md) + - [InlineResponse2004](docs/Model/InlineResponse2004.md) + - [InlineResponse200Timezone](docs/Model/InlineResponse200Timezone.md) + - [InlineResponse400](docs/Model/InlineResponse400.md) + - [InlineResponse4001](docs/Model/InlineResponse4001.md) + - [InlineResponse409](docs/Model/InlineResponse409.md) + - [InlineResponse503](docs/Model/InlineResponse503.md) + - [Location](docs/Model/Location.md) + - [Schedule](docs/Model/Schedule.md) + - [ScheduleClosestExecutions](docs/Model/ScheduleClosestExecutions.md) + - [ScheduleFuture](docs/Model/ScheduleFuture.md) + - [SchedulePast](docs/Model/SchedulePast.md) + - [ScheduleRequest](docs/Model/ScheduleRequest.md) + - [ScheduleResult](docs/Model/ScheduleResult.md) + + +## Documentation For Authorization + + +## bearer + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + +## password + +- **Type**: OAuth +- **Flow**: password +- **Authorization URL**: +- **Scopes**: + - **restapi**: full API access + + +## Author + + + + diff --git a/composer.json b/composer.json index d9c708d..9c17239 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,21 @@ { "name": "supla/api-client", - "autoload": { - "psr-4": { - "Supla\\ApiClient\\": "src" - } - }, "require": { - "ext-curl": "*" + "php": ">=5.5", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^6.2" }, "require-dev": { "squizlabs/php_codesniffer": "^2.8" }, + "autoload": { + "psr-4": { + "Swagger\\Client\\": "lib/", + "Supla\\ApiClient\\": "src/" + } + }, "scripts": { "phpcs": "phpcs src --standard=phpcs-rules.xml", "phpcbf": "phpcbf src --standard=phpcs-rules.xml" diff --git a/composer.lock b/composer.lock index 48a7ab1..835c7ab 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,253 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "b9d5a909289fe563931dea8f193c9c54", - "packages": [], + "content-hash": "50d1ecda7b600133f5d97de70da2fd2e", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + } + ], "packages-dev": [ { "name": "squizlabs/php_codesniffer", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -83,7 +315,7 @@ "phpcs", "standards" ], - "time": "2017-03-01T22:17:45+00:00" + "time": "2017-05-22T02:43:20+00:00" } ], "aliases": [], @@ -91,6 +323,11 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": ">=5.5", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, "platform-dev": [] } diff --git a/docs/Api/AccessIDsApi.md b/docs/Api/AccessIDsApi.md new file mode 100644 index 0000000..9c340de --- /dev/null +++ b/docs/Api/AccessIDsApi.md @@ -0,0 +1,299 @@ +# Swagger\Client\AccessIDsApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**accessidsGet**](AccessIDsApi.md#accessidsGet) | **GET** /accessids | Get Access IDs list +[**accessidsPost**](AccessIDsApi.md#accessidsPost) | **POST** /accessids | Create a new Access ID +[**deleteAccessID**](AccessIDsApi.md#deleteAccessID) | **DELETE** /accessids/{id} | Delete Access Identifier +[**getAccessID**](AccessIDsApi.md#getAccessID) | **GET** /accessids/{id} | Get Access ID +[**updateAccessID**](AccessIDsApi.md#updateAccessID) | **PUT** /accessids/{id} | Edit Access ID + + +# **accessidsGet** +> \Swagger\Client\Model\AccessID[] accessidsGet($x_accept_version, $include) + +Get Access IDs list + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\AccessIDsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->accessidsGet($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccessIDsApi->accessidsGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\AccessID[]**](../Model/AccessID.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **accessidsPost** +> \Swagger\Client\Model\AccessID accessidsPost($x_accept_version) + +Create a new Access ID + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\AccessIDsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->accessidsPost($x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccessIDsApi->accessidsPost: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteAccessID** +> deleteAccessID($id, $x_accept_version) + +Delete Access Identifier + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\AccessIDsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->deleteAccessID($id, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling AccessIDsApi->deleteAccessID: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getAccessID** +> \Swagger\Client\Model\AccessID getAccessID($id, $x_accept_version, $include) + +Get Access ID + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\AccessIDsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getAccessID($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccessIDsApi->getAccessID: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateAccessID** +> \Swagger\Client\Model\AccessID updateAccessID($id, $body, $x_accept_version) + +Edit Access ID + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\AccessIDsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body10(); // \Swagger\Client\Model\Body10 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->updateAccessID($id, $body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccessIDsApi->updateAccessID: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body10**](../Model/Body10.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ChannelGroupsApi.md b/docs/Api/ChannelGroupsApi.md new file mode 100644 index 0000000..a86029f --- /dev/null +++ b/docs/Api/ChannelGroupsApi.md @@ -0,0 +1,360 @@ +# Swagger\Client\ChannelGroupsApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createChannelGroup**](ChannelGroupsApi.md#createChannelGroup) | **POST** /channel-groups | Create a new channel group +[**deleteChannelGroup**](ChannelGroupsApi.md#deleteChannelGroup) | **DELETE** /channel-groups/{id} | Delete Channel Group +[**executeChannelGroupAction**](ChannelGroupsApi.md#executeChannelGroupAction) | **PATCH** /channel-groups/{id} | Execute action on the channel group +[**getChannelGroup**](ChannelGroupsApi.md#getChannelGroup) | **GET** /channel-groups/{id} | Get channel group by ID +[**getChannelGroups**](ChannelGroupsApi.md#getChannelGroups) | **GET** /channel-groups | Get channels list +[**updateChannelGroup**](ChannelGroupsApi.md#updateChannelGroup) | **PUT** /channel-groups/{id} | Update channel group + + +# **createChannelGroup** +> \Swagger\Client\Model\ChannelGroup createChannelGroup($body, $x_accept_version) + +Create a new channel group + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Swagger\Client\Model\Body4(); // \Swagger\Client\Model\Body4 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->createChannelGroup($body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelGroupsApi->createChannelGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\Body4**](../Model/Body4.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\ChannelGroup**](../Model/ChannelGroup.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteChannelGroup** +> deleteChannelGroup($id, $x_accept_version) + +Delete Channel Group + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->deleteChannelGroup($id, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling ChannelGroupsApi->deleteChannelGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **executeChannelGroupAction** +> executeChannelGroupAction($id, $body, $x_accept_version) + +Execute action on the channel group + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body6(); // \Swagger\Client\Model\Body6 | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->executeChannelGroupAction($id, $body, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling ChannelGroupsApi->executeChannelGroupAction: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body6**](../Model/Body6.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getChannelGroup** +> \Swagger\Client\Model\ChannelGroup getChannelGroup($id, $x_accept_version, $include) + +Get channel group by ID + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getChannelGroup($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelGroupsApi->getChannelGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\ChannelGroup**](../Model/ChannelGroup.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getChannelGroups** +> \Swagger\Client\Model\ChannelGroup[] getChannelGroups($x_accept_version, $include) + +Get channels list + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getChannelGroups($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelGroupsApi->getChannelGroups: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\ChannelGroup[]**](../Model/ChannelGroup.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateChannelGroup** +> \Swagger\Client\Model\ChannelGroup updateChannelGroup($id, $body, $x_accept_version) + +Update channel group + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body5(); // \Swagger\Client\Model\Body5 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->updateChannelGroup($id, $body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelGroupsApi->updateChannelGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body5**](../Model/Body5.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\ChannelGroup**](../Model/ChannelGroup.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ChannelsApi.md b/docs/Api/ChannelsApi.md new file mode 100644 index 0000000..5ad7283 --- /dev/null +++ b/docs/Api/ChannelsApi.md @@ -0,0 +1,435 @@ +# Swagger\Client\ChannelsApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**executeAction**](ChannelsApi.md#executeAction) | **PATCH** /channels/{id} | Execute action on the channel +[**getChannel**](ChannelsApi.md#getChannel) | **GET** /channels/{id} | Get channel by ID +[**getChannelMeasurementLogs**](ChannelsApi.md#getChannelMeasurementLogs) | **GET** /channels/{id}/measurement-logs | Get measurement logs. +[**getChannelMeasurementLogsCsvFile**](ChannelsApi.md#getChannelMeasurementLogsCsvFile) | **GET** /channels/{id}/measurement-logs-csv | Get measurement logs as zipped CSV file. +[**getChannelSchedules**](ChannelsApi.md#getChannelSchedules) | **GET** /channels/{id}/schedules | Get schedules list of the channel +[**getChannels**](ChannelsApi.md#getChannels) | **GET** /channels | Get channels list +[**updateChannel**](ChannelsApi.md#updateChannel) | **PUT** /channels/{id} | Update channel + + +# **executeAction** +> executeAction($id, $body, $x_accept_version) + +Execute action on the channel + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body3(); // \Swagger\Client\Model\Body3 | Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->executeAction($id, $body, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->executeAction: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body3**](../Model/Body3.md)| Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getChannel** +> \Swagger\Client\Model\Channel getChannel($id, $x_accept_version, $include) + +Get channel by ID + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getChannel($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->getChannel: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Channel**](../Model/Channel.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getChannelMeasurementLogs** +> \Swagger\Client\Model\InlineResponse2004[] getChannelMeasurementLogs($id, $x_accept_version, $limit, $offset) + +Get measurement logs. + +Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs ordered by date, descending. + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$limit = 5000; // int | Maximum items count in response, from 1 to 5000 +$offset = 56; // int | Pagination offset + +try { + $result = $apiInstance->getChannelMeasurementLogs($id, $x_accept_version, $limit, $offset); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->getChannelMeasurementLogs: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **limit** | **int**| Maximum items count in response, from 1 to 5000 | [optional] [default to 5000] + **offset** | **int**| Pagination offset | [optional] + +### Return type + +[**\Swagger\Client\Model\InlineResponse2004[]**](../Model/InlineResponse2004.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getChannelMeasurementLogsCsvFile** +> \SplFileObject getChannelMeasurementLogsCsvFile($id, $x_accept_version) + +Get measurement logs as zipped CSV file. + +Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs ordered by date, descending. + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->getChannelMeasurementLogsCsvFile($id, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->getChannelMeasurementLogsCsvFile: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\SplFileObject**](../Model/\SplFileObject.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/zip + +[[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) + +# **getChannelSchedules** +> \Swagger\Client\Model\Schedule[] getChannelSchedules($id, $x_accept_version, $include) + +Get schedules list of the channel + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getChannelSchedules($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->getChannelSchedules: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Schedule[]**](../Model/Schedule.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getChannels** +> \Swagger\Client\Model\Channel[] getChannels($x_accept_version, $include, $function, $io, $has_function) + +Get channels list + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$function = array("function_example"); // string[] | +$io = "io_example"; // string | Return only `input` or `output` channels. +$has_function = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. + +try { + $result = $apiInstance->getChannels($x_accept_version, $include, $function, $io, $has_function); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->getChannels: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + **function** | [**string[]**](../Model/string.md)| | [optional] + **io** | **string**| Return only `input` or `output` channels. | [optional] + **has_function** | **bool**| Return only channels with (`true`) or without (`false`) chosen functions. | [optional] + +### Return type + +[**\Swagger\Client\Model\Channel[]**](../Model/Channel.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateChannel** +> \Swagger\Client\Model\Channel updateChannel($id, $body, $x_accept_version) + +Update channel + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body2(); // \Swagger\Client\Model\Body2 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->updateChannel($id, $body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->updateChannel: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body2**](../Model/Body2.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\Channel**](../Model/Channel.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ClientAppsApi.md b/docs/Api/ClientAppsApi.md new file mode 100644 index 0000000..1f26353 --- /dev/null +++ b/docs/Api/ClientAppsApi.md @@ -0,0 +1,183 @@ +# Swagger\Client\ClientAppsApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteClientApp**](ClientAppsApi.md#deleteClientApp) | **DELETE** /client-apps/{id} | Delete Client App +[**getClientApps**](ClientAppsApi.md#getClientApps) | **GET** /client-apps | Get client apps +[**updateClientApp**](ClientAppsApi.md#updateClientApp) | **PUT** /client-apps/{id} | Update client app + + +# **deleteClientApp** +> deleteClientApp($id, $x_accept_version) + +Delete Client App + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ClientAppsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->deleteClientApp($id, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling ClientAppsApi->deleteClientApp: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getClientApps** +> \Swagger\Client\Model\ClientApp[] getClientApps($x_accept_version, $include) + +Get client apps + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ClientAppsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getClientApps($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ClientAppsApi->getClientApps: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\ClientApp[]**](../Model/ClientApp.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateClientApp** +> \Swagger\Client\Model\ClientApp updateClientApp($id, $body, $x_accept_version) + +Update client app + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\ClientAppsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body7(); // \Swagger\Client\Model\Body7 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->updateClientApp($id, $body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ClientAppsApi->updateClientApp: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body7**](../Model/Body7.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\ClientApp**](../Model/ClientApp.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/IODevicesApi.md b/docs/Api/IODevicesApi.md new file mode 100644 index 0000000..7be845b --- /dev/null +++ b/docs/Api/IODevicesApi.md @@ -0,0 +1,303 @@ +# Swagger\Client\IODevicesApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteIoDevice**](IODevicesApi.md#deleteIoDevice) | **DELETE** /iodevices/{id} | Delete IO Device +[**getIoDevice**](IODevicesApi.md#getIoDevice) | **GET** /iodevices/{id} | Get IO Device +[**getIoDeviceChannels**](IODevicesApi.md#getIoDeviceChannels) | **GET** /iodevices/{id}/channels | Get Channels that belong to IO Deice +[**getIoDevices**](IODevicesApi.md#getIoDevices) | **GET** /iodevices | Get IO Devices +[**updateIoDevice**](IODevicesApi.md#updateIoDevice) | **PUT** /iodevices/{id} | Update IO Device + + +# **deleteIoDevice** +> deleteIoDevice($id, $x_accept_version) + +Delete IO Device + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\IODevicesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->deleteIoDevice($id, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling IODevicesApi->deleteIoDevice: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getIoDevice** +> \Swagger\Client\Model\Device getIoDevice($id, $x_accept_version, $include) + +Get IO Device + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\IODevicesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getIoDevice($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IODevicesApi->getIoDevice: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Device**](../Model/Device.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getIoDeviceChannels** +> \Swagger\Client\Model\Channel getIoDeviceChannels($id, $x_accept_version, $include) + +Get Channels that belong to IO Deice + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\IODevicesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getIoDeviceChannels($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IODevicesApi->getIoDeviceChannels: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Channel**](../Model/Channel.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getIoDevices** +> \Swagger\Client\Model\Device[] getIoDevices($x_accept_version, $include) + +Get IO Devices + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\IODevicesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getIoDevices($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IODevicesApi->getIoDevices: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Device[]**](../Model/Device.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateIoDevice** +> \Swagger\Client\Model\Device updateIoDevice($id, $body, $x_accept_version) + +Update IO Device + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\IODevicesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body8(); // \Swagger\Client\Model\Body8 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->updateIoDevice($id, $body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IODevicesApi->updateIoDevice: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body8**](../Model/Body8.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\Device**](../Model/Device.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/LocationsApi.md b/docs/Api/LocationsApi.md new file mode 100644 index 0000000..8ec7d5a --- /dev/null +++ b/docs/Api/LocationsApi.md @@ -0,0 +1,303 @@ +# Swagger\Client\LocationsApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createLocation**](LocationsApi.md#createLocation) | **POST** /locations | Create a new location +[**deleteLocation**](LocationsApi.md#deleteLocation) | **DELETE** /locations/{id} | Delete location +[**getLocation**](LocationsApi.md#getLocation) | **GET** /locations/{id} | Get location by ID +[**getLocations**](LocationsApi.md#getLocations) | **GET** /locations | Get locations list +[**updateLocation**](LocationsApi.md#updateLocation) | **PUT** /locations/{id} | Edit location + + +# **createLocation** +> \Swagger\Client\Model\Location createLocation($x_accept_version) + +Create a new location + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\LocationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->createLocation($x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LocationsApi->createLocation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\Location**](../Model/Location.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteLocation** +> deleteLocation($id, $x_accept_version, $include) + +Delete location + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\LocationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $apiInstance->deleteLocation($id, $x_accept_version, $include); +} catch (Exception $e) { + echo 'Exception when calling LocationsApi->deleteLocation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getLocation** +> \Swagger\Client\Model\Location getLocation($id, $x_accept_version, $include) + +Get location by ID + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\LocationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getLocation($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LocationsApi->getLocation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Location**](../Model/Location.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getLocations** +> \Swagger\Client\Model\Location[] getLocations($x_accept_version, $include) + +Get locations list + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\LocationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getLocations($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LocationsApi->getLocations: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Location[]**](../Model/Location.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateLocation** +> \Swagger\Client\Model\Location updateLocation($id, $body, $x_accept_version, $include) + +Edit location + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\LocationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body1(); // \Swagger\Client\Model\Body1 | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->updateLocation($id, $body, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LocationsApi->updateLocation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\Body1**](../Model/Body1.md)| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Location**](../Model/Location.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/SchedulesApi.md b/docs/Api/SchedulesApi.md new file mode 100644 index 0000000..373fba9 --- /dev/null +++ b/docs/Api/SchedulesApi.md @@ -0,0 +1,360 @@ +# Swagger\Client\SchedulesApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createSchedule**](SchedulesApi.md#createSchedule) | **POST** /schedules | Create a new schedule +[**deleteSchedule**](SchedulesApi.md#deleteSchedule) | **DELETE** /schedules/{id} | Delete Schedule +[**enableSchedules**](SchedulesApi.md#enableSchedules) | **PATCH** /schedules | Enable schedules +[**getSchedule**](SchedulesApi.md#getSchedule) | **GET** /schedules/{id} | Get Schedule +[**getSchedules**](SchedulesApi.md#getSchedules) | **GET** /schedules | Get schedules list +[**updateSchedule**](SchedulesApi.md#updateSchedule) | **PUT** /schedules/{id} | Update schedule + + +# **createSchedule** +> \Swagger\Client\Model\Schedule createSchedule($body, $x_accept_version) + +Create a new schedule + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\SchedulesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->createSchedule($body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SchedulesApi->createSchedule: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\ScheduleRequest**](../Model/ScheduleRequest.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\Schedule**](../Model/Schedule.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteSchedule** +> deleteSchedule($id, $x_accept_version) + +Delete Schedule + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\SchedulesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->deleteSchedule($id, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling SchedulesApi->deleteSchedule: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **enableSchedules** +> enableSchedules($body, $x_accept_version) + +Enable schedules + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\SchedulesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Swagger\Client\Model\Body9(); // \Swagger\Client\Model\Body9 | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $apiInstance->enableSchedules($body, $x_accept_version); +} catch (Exception $e) { + echo 'Exception when calling SchedulesApi->enableSchedules: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\Body9**](../Model/Body9.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getSchedule** +> \Swagger\Client\Model\Schedule getSchedule($id, $x_accept_version, $include) + +Get Schedule + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\SchedulesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getSchedule($id, $x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SchedulesApi->getSchedule: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Schedule**](../Model/Schedule.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getSchedules** +> \Swagger\Client\Model\Schedule[] getSchedules($x_accept_version, $include) + +Get schedules list + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\SchedulesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. + +try { + $result = $apiInstance->getSchedules($x_accept_version, $include); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SchedulesApi->getSchedules: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] + +### Return type + +[**\Swagger\Client\Model\Schedule[]**](../Model/Schedule.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateSchedule** +> \Swagger\Client\Model\Schedule updateSchedule($id, $body, $x_accept_version, $enable) + +Update schedule + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\SchedulesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | +$body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | +$x_accept_version = "x_accept_version_example"; // string | API Version +$enable = true; // bool | Set to `true` to enable the schedule after saving. + +try { + $result = $apiInstance->updateSchedule($id, $body, $x_accept_version, $enable); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SchedulesApi->updateSchedule: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | [**\Swagger\Client\Model\ScheduleRequest**](../Model/ScheduleRequest.md)| | + **x_accept_version** | **string**| API Version | [optional] + **enable** | **bool**| Set to `true` to enable the schedule after saving. | [optional] + +### Return type + +[**\Swagger\Client\Model\Schedule**](../Model/Schedule.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ServerApi.md b/docs/Api/ServerApi.md new file mode 100644 index 0000000..36621b0 --- /dev/null +++ b/docs/Api/ServerApi.md @@ -0,0 +1,104 @@ +# Swagger\Client\ServerApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**serverInfoGet**](ServerApi.md#serverInfoGet) | **GET** /server-info | Get server status +[**serverStatusGet**](ServerApi.md#serverStatusGet) | **GET** /server-status | Get the SUPLA Server status + + +# **serverInfoGet** +> \Swagger\Client\Model\InlineResponse200 serverInfoGet($x_accept_version) + +Get server status + +### Example +```php +serverInfoGet($x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ServerApi->serverInfoGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\InlineResponse200**](../Model/InlineResponse200.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **serverStatusGet** +> \Swagger\Client\Model\InlineResponse2001 serverStatusGet($x_accept_version) + +Get the SUPLA Server status + +### Example +```php +serverStatusGet($x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ServerApi->serverStatusGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\InlineResponse2001**](../Model/InlineResponse2001.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md new file mode 100644 index 0000000..86e246c --- /dev/null +++ b/docs/Api/UsersApi.md @@ -0,0 +1,122 @@ +# Swagger\Client\UsersApi + +All URIs are relative to *https://cloud.supla.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**editCurrentUser**](UsersApi.md#editCurrentUser) | **PATCH** /users/current | Edit current user +[**getCurrentUser**](UsersApi.md#getCurrentUser) | **GET** /users/current | Get current user + + +# **editCurrentUser** +> \Swagger\Client\Model\InlineResponse2003 editCurrentUser($body, $x_accept_version) + +Edit current user + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Swagger\Client\Model\Body(); // \Swagger\Client\Model\Body | +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->editCurrentUser($body, $x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->editCurrentUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\Body**](../Model/Body.md)| | + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getCurrentUser** +> \Swagger\Client\Model\InlineResponse2002 getCurrentUser($x_accept_version) + +Get current user + +### Example +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +// Configure OAuth2 access token for authorization: password +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$x_accept_version = "x_accept_version_example"; // string | API Version + +try { + $result = $apiInstance->getCurrentUser($x_accept_version); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getCurrentUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_accept_version** | **string**| API Version | [optional] + +### Return type + +[**\Swagger\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md) + +### Authorization + +[bearer](../../README.md#bearer), [password](../../README.md#password) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Model/AccessID.md b/docs/Model/AccessID.md new file mode 100644 index 0000000..58bb8da --- /dev/null +++ b/docs/Model/AccessID.md @@ -0,0 +1,16 @@ +# AccessID + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Access ID identifier | [optional] +**caption** | **string** | Location caption | [optional] +**enabled** | **bool** | `true` if the location is enabled, `false` otherwise | [optional] +**locations_ids** | **int[]** | array containing the location idenfifiers assigned to this access ID | [optional] +**client_apps_ids** | **int[]** | array containing the client apps idenfifiers assigned to this access ID | [optional] +**locations** | [**\Swagger\Client\Model\Location[]**](Location.md) | Returned only if requested by the `include` parameter. | [optional] +**client_apps** | [**\Swagger\Client\Model\ClientApp[]**](ClientApp.md) | Returned only if requested by the `include` parameter. | [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/Body.md b/docs/Model/Body.md new file mode 100644 index 0000000..1a3a8d0 --- /dev/null +++ b/docs/Model/Body.md @@ -0,0 +1,10 @@ +# Body + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | The `change:userTimezone` requires to provide also a `timezone` value in the request. The `change:password` requires to provide also a `newPassword` and `oldPassword` in the request. | [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/Body1.md b/docs/Model/Body1.md new file mode 100644 index 0000000..38570a8 --- /dev/null +++ b/docs/Model/Body1.md @@ -0,0 +1,13 @@ +# Body1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | [optional] +**caption** | **string** | | [optional] +**password** | **string** | Provide new password if you want to change it. | [optional] +**access_ids_ids** | **int[]** | Access Identifiers identifiers to assign to this location. | [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/Body10.md b/docs/Model/Body10.md new file mode 100644 index 0000000..2c6c27f --- /dev/null +++ b/docs/Model/Body10.md @@ -0,0 +1,14 @@ +# Body10 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | [optional] +**caption** | **string** | | [optional] +**password** | **string** | Provide new password if you want to change it. | [optional] +**locations_ids** | **int[]** | Locations identifiers to assign to this Access ID. | [optional] +**client_apps_ids** | **int[]** | Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. | [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/Body2.md b/docs/Model/Body2.md new file mode 100644 index 0000000..21d2239 --- /dev/null +++ b/docs/Model/Body2.md @@ -0,0 +1,18 @@ +# Body2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_id** | **int** | | [optional] +**param1** | **int** | | [optional] +**param2** | **int** | | [optional] +**param3** | **int** | | [optional] +**caption** | **string** | | [optional] +**alt_icon** | **int** | | [optional] +**hidden** | **bool** | | [optional] +**location_id** | **int** | | [optional] +**inherited_location** | **bool** | | [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/Body3.md b/docs/Model/Body3.md new file mode 100644 index 0000000..67f9d83 --- /dev/null +++ b/docs/Model/Body3.md @@ -0,0 +1,11 @@ +# Body3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | [**\Swagger\Client\Model\ChannelFunctionActionEnum**](ChannelFunctionActionEnum.md) | | [optional] +**percentage** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Body4.md b/docs/Model/Body4.md new file mode 100644 index 0000000..a104d34 --- /dev/null +++ b/docs/Model/Body4.md @@ -0,0 +1,14 @@ +# Body4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**caption** | **string** | | [optional] +**alt_icon** | **int** | | [optional] +**hidden** | **bool** | | [optional] +**location_id** | **int** | | [optional] +**channel_ids** | **int[]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Body5.md b/docs/Model/Body5.md new file mode 100644 index 0000000..742038c --- /dev/null +++ b/docs/Model/Body5.md @@ -0,0 +1,14 @@ +# Body5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**caption** | **string** | | [optional] +**alt_icon** | **int** | | [optional] +**hidden** | **bool** | | [optional] +**location_id** | **int** | | [optional] +**channel_ids** | **int[]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Body6.md b/docs/Model/Body6.md new file mode 100644 index 0000000..f8298d7 --- /dev/null +++ b/docs/Model/Body6.md @@ -0,0 +1,11 @@ +# Body6 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | [**\Swagger\Client\Model\ChannelFunctionActionEnum**](ChannelFunctionActionEnum.md) | | [optional] +**percentage** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Body7.md b/docs/Model/Body7.md new file mode 100644 index 0000000..eb8a8bf --- /dev/null +++ b/docs/Model/Body7.md @@ -0,0 +1,12 @@ +# Body7 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**caption** | **string** | | [optional] +**enabled** | **bool** | | [optional] +**access_id_id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Body8.md b/docs/Model/Body8.md new file mode 100644 index 0000000..2791648 --- /dev/null +++ b/docs/Model/Body8.md @@ -0,0 +1,12 @@ +# Body8 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **string** | | [optional] +**enabled** | **bool** | | [optional] +**location_id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Body9.md b/docs/Model/Body9.md new file mode 100644 index 0000000..357a0ed --- /dev/null +++ b/docs/Model/Body9.md @@ -0,0 +1,10 @@ +# Body9 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enable** | **int[]** | Array of schedule identifiers to enable | [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/Channel.md b/docs/Model/Channel.md new file mode 100644 index 0000000..fbb1896 --- /dev/null +++ b/docs/Model/Channel.md @@ -0,0 +1,28 @@ +# Channel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Channel identifier | [optional] +**channel_number** | **int** | Channel ordinal number in its IO Device | [optional] +**caption** | **string** | Channel caption | [optional] +**type** | [**\Swagger\Client\Model\ChannelType**](ChannelType.md) | | [optional] +**function** | [**\Swagger\Client\Model\ChannelFunction**](ChannelFunction.md) | | [optional] +**param1** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] +**param2** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] +**param3** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] +**alt_icon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [optional] +**hidden** | **bool** | Whether this channel is shown on client apps or not | [optional] +**inherited_location** | **bool** | Whether this channel inherits its IODevice's location (`true`) or not (`false`) | [optional] +**iodevice_id** | **int** | | [optional] +**location_id** | **int** | | [optional] +**function_id** | **int** | | [optional] +**type_id** | **int** | | [optional] +**iodevice** | [**\Swagger\Client\Model\Device**](Device.md) | | [optional] +**location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] +**connected** | **bool** | | [optional] +**supported_functions** | [**\Swagger\Client\Model\ChannelFunction[]**](ChannelFunction.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/ChannelFunction.md b/docs/Model/ChannelFunction.md new file mode 100644 index 0000000..af34d93 --- /dev/null +++ b/docs/Model/ChannelFunction.md @@ -0,0 +1,14 @@ +# ChannelFunction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | [**\Swagger\Client\Model\ChannelFunctionEnumNames**](ChannelFunctionEnumNames.md) | | [optional] +**caption** | **string** | | [optional] +**max_alternative_icon_index** | **int** | | [optional] +**possible_actions** | [**\Swagger\Client\Model\ChannelFunctionAction[]**](ChannelFunctionAction.md) | What can you with with this channel? | [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/ChannelFunctionAction.md b/docs/Model/ChannelFunctionAction.md new file mode 100644 index 0000000..42e2195 --- /dev/null +++ b/docs/Model/ChannelFunctionAction.md @@ -0,0 +1,12 @@ +# ChannelFunctionAction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | [**\Swagger\Client\Model\ChannelFunctionActionEnum**](ChannelFunctionActionEnum.md) | | [optional] +**caption** | **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) + + diff --git a/docs/Model/ChannelFunctionActionEnum.md b/docs/Model/ChannelFunctionActionEnum.md new file mode 100644 index 0000000..48bdfde --- /dev/null +++ b/docs/Model/ChannelFunctionActionEnum.md @@ -0,0 +1,9 @@ +# ChannelFunctionActionEnum + +## 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) + + diff --git a/docs/Model/ChannelFunctionEnumNames.md b/docs/Model/ChannelFunctionEnumNames.md new file mode 100644 index 0000000..e76d13a --- /dev/null +++ b/docs/Model/ChannelFunctionEnumNames.md @@ -0,0 +1,9 @@ +# ChannelFunctionEnumNames + +## 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) + + diff --git a/docs/Model/ChannelGroup.md b/docs/Model/ChannelGroup.md new file mode 100644 index 0000000..008fb84 --- /dev/null +++ b/docs/Model/ChannelGroup.md @@ -0,0 +1,19 @@ +# ChannelGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Channel group identifier | [optional] +**hidden** | **bool** | Whether this channel group is shown on client apps or not | [optional] +**caption** | **string** | Channel caption | [optional] +**function** | [**\Swagger\Client\Model\ChannelFunction**](ChannelFunction.md) | | [optional] +**function_id** | **int** | | [optional] +**location_id** | **int** | | [optional] +**location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] +**channel_ids** | **int[]** | | [optional] +**channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [optional] +**alt_icon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [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/ChannelParam.md b/docs/Model/ChannelParam.md new file mode 100644 index 0000000..db70bce --- /dev/null +++ b/docs/Model/ChannelParam.md @@ -0,0 +1,9 @@ +# ChannelParam + +## 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) + + diff --git a/docs/Model/ChannelType.md b/docs/Model/ChannelType.md new file mode 100644 index 0000000..73fee38 --- /dev/null +++ b/docs/Model/ChannelType.md @@ -0,0 +1,13 @@ +# ChannelType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Channel type identifier | [optional] +**name** | **string** | | [optional] +**caption** | **string** | | [optional] +**output** | **bool** | Whether the channel is output type (i.e. can take action) or input (i.e. provide data) | [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/ClientApp.md b/docs/Model/ClientApp.md new file mode 100644 index 0000000..d959fa3 --- /dev/null +++ b/docs/Model/ClientApp.md @@ -0,0 +1,22 @@ +# ClientApp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Client application identifier | [optional] +**name** | **string** | | [optional] +**caption** | **string** | | [optional] +**enabled** | **bool** | | [optional] +**reg_ipv4** | **int** | | [optional] +**reg_date** | [**\DateTime**](\DateTime.md) | | [optional] +**last_access_ipv4** | **int** | | [optional] +**last_access_date** | [**\DateTime**](\DateTime.md) | | [optional] +**software_version** | **string** | | [optional] +**protocol_version** | **int** | | [optional] +**access_id_id** | **int** | | [optional] +**connected** | **bool** | | [optional] +**access_id** | [**\Swagger\Client\Model\AccessID**](AccessID.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/Device.md b/docs/Model/Device.md new file mode 100644 index 0000000..12be201 --- /dev/null +++ b/docs/Model/Device.md @@ -0,0 +1,27 @@ +# Device + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Device identifier | [optional] +**name** | **string** | | [optional] +**enabled** | **bool** | | [optional] +**comment** | **string** | | [optional] +**reg_date** | [**\DateTime**](\DateTime.md) | | [optional] +**reg_ipv4** | **int** | | [optional] +**last_connected** | [**\DateTime**](\DateTime.md) | | [optional] +**last_ipv4** | **int** | | [optional] +**software_version** | **string** | | [optional] +**g_uid_string** | **string** | | [optional] +**location_id** | **int** | | [optional] +**original_location_id** | **int** | | [optional] +**channels_ids** | **int[]** | | [optional] +**connected** | **bool** | | [optional] +**location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] +**original_location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] +**channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [optional] +**schedules** | [**\Swagger\Client\Model\Schedule[]**](Schedule.md) | Returned only if requested by the `include` parameter. | [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/InlineResponse200.md b/docs/Model/InlineResponse200.md new file mode 100644 index 0000000..bfaa48e --- /dev/null +++ b/docs/Model/InlineResponse200.md @@ -0,0 +1,17 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **string** | SUPLA Server address (to be used in smartphones) | [optional] +**time** | [**\DateTime**](\DateTime.md) | Current server time | [optional] +**timezone** | [**\Swagger\Client\Model\InlineResponse200Timezone**](InlineResponse200Timezone.md) | | [optional] +**authenticated** | **bool** | | [optional] +**username** | **string** | Present only if `authenticated=true` | [optional] +**cloud_version** | **string** | | [optional] +**api_version** | **string** | | [optional] +**supported_api_versions** | **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) + + diff --git a/docs/Model/InlineResponse2001.md b/docs/Model/InlineResponse2001.md new file mode 100644 index 0000000..6f4a96e --- /dev/null +++ b/docs/Model/InlineResponse2001.md @@ -0,0 +1,10 @@ +# InlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **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) + + diff --git a/docs/Model/InlineResponse2002.md b/docs/Model/InlineResponse2002.md new file mode 100644 index 0000000..8a0f9fb --- /dev/null +++ b/docs/Model/InlineResponse2002.md @@ -0,0 +1,14 @@ +# InlineResponse2002 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**email** | **string** | | [optional] +**timezone** | **string** | | [optional] +**clients_registration_enabled** | [**\DateTime**](\DateTime.md) | | [optional] +**io_devices_registration_enabled** | [**\DateTime**](\DateTime.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/InlineResponse2003.md b/docs/Model/InlineResponse2003.md new file mode 100644 index 0000000..b8acc5e --- /dev/null +++ b/docs/Model/InlineResponse2003.md @@ -0,0 +1,10 @@ +# InlineResponse2003 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/InlineResponse2004.md b/docs/Model/InlineResponse2004.md new file mode 100644 index 0000000..aa4bc8b --- /dev/null +++ b/docs/Model/InlineResponse2004.md @@ -0,0 +1,12 @@ +# InlineResponse2004 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date_timestamp** | **int** | | [optional] +**temperature** | **float** | Temperature in Celsius | [optional] +**humidity** | **float** | Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`. | [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/InlineResponse200Timezone.md b/docs/Model/InlineResponse200Timezone.md new file mode 100644 index 0000000..1415fe6 --- /dev/null +++ b/docs/Model/InlineResponse200Timezone.md @@ -0,0 +1,11 @@ +# InlineResponse200Timezone + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**offset** | **int** | Timezone offset in minutes | [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/InlineResponse400.md b/docs/Model/InlineResponse400.md new file mode 100644 index 0000000..5cd2c6c --- /dev/null +++ b/docs/Model/InlineResponse400.md @@ -0,0 +1,11 @@ +# InlineResponse400 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **int** | | [optional] +**message** | **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) + + diff --git a/docs/Model/InlineResponse4001.md b/docs/Model/InlineResponse4001.md new file mode 100644 index 0000000..40c42b7 --- /dev/null +++ b/docs/Model/InlineResponse4001.md @@ -0,0 +1,11 @@ +# InlineResponse4001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **int** | | [optional] +**message** | **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) + + diff --git a/docs/Model/InlineResponse409.md b/docs/Model/InlineResponse409.md new file mode 100644 index 0000000..cd90fd6 --- /dev/null +++ b/docs/Model/InlineResponse409.md @@ -0,0 +1,11 @@ +# InlineResponse409 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**schedules** | [**\Swagger\Client\Model\Schedule[]**](Schedule.md) | Schedules that will be deleted after this request. | [optional] +**groups** | [**\Swagger\Client\Model\ChannelGroup[]**](ChannelGroup.md) | Channel groups that this channel will be removed from after this request. | [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/InlineResponse503.md b/docs/Model/InlineResponse503.md new file mode 100644 index 0000000..581ffcf --- /dev/null +++ b/docs/Model/InlineResponse503.md @@ -0,0 +1,10 @@ +# InlineResponse503 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **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) + + diff --git a/docs/Model/Location.md b/docs/Model/Location.md new file mode 100644 index 0000000..a47a84b --- /dev/null +++ b/docs/Model/Location.md @@ -0,0 +1,21 @@ +# Location + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Location identifier | [optional] +**caption** | **string** | Location caption | [optional] +**enabled** | **bool** | `true` if the location is enabled, `false` otherwise | [optional] +**iodevices_ids** | **int[]** | array containing the IO Devices identifiers assigned to this location | [optional] +**channel_groups_ids** | **int[]** | array containing the Channel groups identifiers assigned to this location | [optional] +**channels_ids** | **int[]** | array containing the Channels identifiers expicitely assigned to this location | [optional] +**access_ids_ids** | **int[]** | array containing the Access Identifiers identifiers assigned to this location | [optional] +**password** | **string** | Location password (plain text). Returned only if requested by the `include` parameter. | [optional] +**iodevices** | [**\Swagger\Client\Model\Device[]**](Device.md) | Returned only if requested by the `include` parameter. | [optional] +**channel_groups** | [**\Swagger\Client\Model\ChannelGroup[]**](ChannelGroup.md) | Returned only if requested by the `include` parameter. | [optional] +**access_ids** | [**\Swagger\Client\Model\AccessID[]**](AccessID.md) | Returned only if requested by the `include` parameter. | [optional] +**channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [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/Schedule.md b/docs/Model/Schedule.md new file mode 100644 index 0000000..7373de3 --- /dev/null +++ b/docs/Model/Schedule.md @@ -0,0 +1,22 @@ +# Schedule + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Schedule identifier | [optional] +**time_expression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] +**action** | [**\Swagger\Client\Model\ChannelFunctionAction**](ChannelFunctionAction.md) | | [optional] +**mode** | **string** | | [optional] +**date_start** | [**\DateTime**](\DateTime.md) | | [optional] +**date_end** | [**\DateTime**](\DateTime.md) | | [optional] +**enabled** | **bool** | | [optional] +**caption** | **string** | | [optional] +**retry** | **bool** | | [optional] +**channel_id** | **int** | | [optional] +**action_id** | **int** | | [optional] +**channel** | [**\Swagger\Client\Model\Channel**](Channel.md) | | [optional] +**closest_executions** | [**\Swagger\Client\Model\ScheduleClosestExecutions[]**](ScheduleClosestExecutions.md) | Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions. | [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/ScheduleClosestExecutions.md b/docs/Model/ScheduleClosestExecutions.md new file mode 100644 index 0000000..5b28a31 --- /dev/null +++ b/docs/Model/ScheduleClosestExecutions.md @@ -0,0 +1,11 @@ +# ScheduleClosestExecutions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**past** | [**\Swagger\Client\Model\SchedulePast[]**](SchedulePast.md) | | [optional] +**future** | [**\Swagger\Client\Model\ScheduleFuture[]**](ScheduleFuture.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/ScheduleFuture.md b/docs/Model/ScheduleFuture.md new file mode 100644 index 0000000..beecf1e --- /dev/null +++ b/docs/Model/ScheduleFuture.md @@ -0,0 +1,10 @@ +# ScheduleFuture + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**planned_timestamp** | [**\DateTime**](\DateTime.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/SchedulePast.md b/docs/Model/SchedulePast.md new file mode 100644 index 0000000..475d482 --- /dev/null +++ b/docs/Model/SchedulePast.md @@ -0,0 +1,13 @@ +# SchedulePast + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**planned_timestamp** | [**\DateTime**](\DateTime.md) | | [optional] +**result_timestamp** | [**\DateTime**](\DateTime.md) | | [optional] +**failed** | **bool** | | [optional] +**result** | [**\Swagger\Client\Model\ScheduleResult**](ScheduleResult.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/ScheduleRequest.md b/docs/Model/ScheduleRequest.md new file mode 100644 index 0000000..bdfd51c --- /dev/null +++ b/docs/Model/ScheduleRequest.md @@ -0,0 +1,17 @@ +# ScheduleRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_id** | **int** | | [optional] +**action_id** | **int** | | [optional] +**mode** | **string** | | [optional] +**time_expression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] +**date_start** | [**\DateTime**](\DateTime.md) | | [optional] +**date_end** | [**\DateTime**](\DateTime.md) | | [optional] +**caption** | **string** | | [optional] +**retry** | **bool** | | [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/ScheduleResult.md b/docs/Model/ScheduleResult.md new file mode 100644 index 0000000..6330dac --- /dev/null +++ b/docs/Model/ScheduleResult.md @@ -0,0 +1,10 @@ +# ScheduleResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**caption** | **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) + + diff --git a/lib/Api/AccessIDsApi.php b/lib/Api/AccessIDsApi.php new file mode 100644 index 0000000..c89230c --- /dev/null +++ b/lib/Api/AccessIDsApi.php @@ -0,0 +1,1467 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation accessidsGet + * + * Get Access IDs list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\AccessID[] + */ + public function accessidsGet($x_accept_version = null, $include = null) + { + list($response) = $this->accessidsGetWithHttpInfo($x_accept_version, $include); + return $response; + } + + /** + * Operation accessidsGetWithHttpInfo + * + * Get Access IDs list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\AccessID[], HTTP status code, HTTP response headers (array of strings) + */ + public function accessidsGetWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\AccessID[]'; + $request = $this->accessidsGetRequest($x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\AccessID[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation accessidsGetAsync + * + * Get Access IDs list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function accessidsGetAsync($x_accept_version = null, $include = null) + { + return $this->accessidsGetAsyncWithHttpInfo($x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation accessidsGetAsyncWithHttpInfo + * + * Get Access IDs list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function accessidsGetAsyncWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\AccessID[]'; + $request = $this->accessidsGetRequest($x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'accessidsGet' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function accessidsGetRequest($x_accept_version = null, $include = null) + { + + $resourcePath = '/accessids'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation accessidsPost + * + * Create a new Access ID + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\AccessID + */ + public function accessidsPost($x_accept_version = null) + { + list($response) = $this->accessidsPostWithHttpInfo($x_accept_version); + return $response; + } + + /** + * Operation accessidsPostWithHttpInfo + * + * Create a new Access ID + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + */ + public function accessidsPostWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->accessidsPostRequest($x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\AccessID', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation accessidsPostAsync + * + * Create a new Access ID + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function accessidsPostAsync($x_accept_version = null) + { + return $this->accessidsPostAsyncWithHttpInfo($x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation accessidsPostAsyncWithHttpInfo + * + * Create a new Access ID + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function accessidsPostAsyncWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->accessidsPostRequest($x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'accessidsPost' + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function accessidsPostRequest($x_accept_version = null) + { + + $resourcePath = '/accessids'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAccessID + * + * Delete Access Identifier + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteAccessID($id, $x_accept_version = null) + { + $this->deleteAccessIDWithHttpInfo($id, $x_accept_version); + } + + /** + * Operation deleteAccessIDWithHttpInfo + * + * Delete Access Identifier + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAccessIDWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteAccessIDRequest($id, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAccessIDAsync + * + * Delete Access Identifier + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAccessIDAsync($id, $x_accept_version = null) + { + return $this->deleteAccessIDAsyncWithHttpInfo($id, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAccessIDAsyncWithHttpInfo + * + * Delete Access Identifier + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAccessIDAsyncWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteAccessIDRequest($id, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAccessID' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteAccessIDRequest($id, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteAccessID' + ); + } + + $resourcePath = '/accessids/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAccessID + * + * Get Access ID + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\AccessID + */ + public function getAccessID($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getAccessIDWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getAccessIDWithHttpInfo + * + * Get Access ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + */ + public function getAccessIDWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->getAccessIDRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\AccessID', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAccessIDAsync + * + * Get Access ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAccessIDAsync($id, $x_accept_version = null, $include = null) + { + return $this->getAccessIDAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAccessIDAsyncWithHttpInfo + * + * Get Access ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAccessIDAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->getAccessIDRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAccessID' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getAccessIDRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getAccessID' + ); + } + + $resourcePath = '/accessids/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAccessID + * + * Edit Access ID + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body10 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\AccessID + */ + public function updateAccessID($id, $body, $x_accept_version = null) + { + list($response) = $this->updateAccessIDWithHttpInfo($id, $body, $x_accept_version); + return $response; + } + + /** + * Operation updateAccessIDWithHttpInfo + * + * Edit Access ID + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body10 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAccessIDWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->updateAccessIDRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\AccessID', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAccessIDAsync + * + * Edit Access ID + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body10 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAccessIDAsync($id, $body, $x_accept_version = null) + { + return $this->updateAccessIDAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAccessIDAsyncWithHttpInfo + * + * Edit Access ID + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body10 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAccessIDAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->updateAccessIDRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAccessID' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body10 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateAccessIDRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateAccessID' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateAccessID' + ); + } + + $resourcePath = '/accessids/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ChannelGroupsApi.php b/lib/Api/ChannelGroupsApi.php new file mode 100644 index 0000000..c82f9ef --- /dev/null +++ b/lib/Api/ChannelGroupsApi.php @@ -0,0 +1,1746 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createChannelGroup + * + * Create a new channel group + * + * @param \Swagger\Client\Model\Body4 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ChannelGroup + */ + public function createChannelGroup($body, $x_accept_version = null) + { + list($response) = $this->createChannelGroupWithHttpInfo($body, $x_accept_version); + return $response; + } + + /** + * Operation createChannelGroupWithHttpInfo + * + * Create a new channel group + * + * @param \Swagger\Client\Model\Body4 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) + */ + public function createChannelGroupWithHttpInfo($body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup'; + $request = $this->createChannelGroupRequest($body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ChannelGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createChannelGroupAsync + * + * Create a new channel group + * + * @param \Swagger\Client\Model\Body4 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createChannelGroupAsync($body, $x_accept_version = null) + { + return $this->createChannelGroupAsyncWithHttpInfo($body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createChannelGroupAsyncWithHttpInfo + * + * Create a new channel group + * + * @param \Swagger\Client\Model\Body4 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createChannelGroupAsyncWithHttpInfo($body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup'; + $request = $this->createChannelGroupRequest($body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createChannelGroup' + * + * @param \Swagger\Client\Model\Body4 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createChannelGroupRequest($body, $x_accept_version = null) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling createChannelGroup' + ); + } + + $resourcePath = '/channel-groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteChannelGroup + * + * Delete Channel Group + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteChannelGroup($id, $x_accept_version = null) + { + $this->deleteChannelGroupWithHttpInfo($id, $x_accept_version); + } + + /** + * Operation deleteChannelGroupWithHttpInfo + * + * Delete Channel Group + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteChannelGroupWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteChannelGroupRequest($id, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteChannelGroupAsync + * + * Delete Channel Group + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteChannelGroupAsync($id, $x_accept_version = null) + { + return $this->deleteChannelGroupAsyncWithHttpInfo($id, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteChannelGroupAsyncWithHttpInfo + * + * Delete Channel Group + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteChannelGroupAsyncWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteChannelGroupRequest($id, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteChannelGroup' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteChannelGroupRequest($id, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteChannelGroup' + ); + } + + $resourcePath = '/channel-groups/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation executeChannelGroupAction + * + * Execute action on the channel group + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function executeChannelGroupAction($id, $body, $x_accept_version = null) + { + $this->executeChannelGroupActionWithHttpInfo($id, $body, $x_accept_version); + } + + /** + * Operation executeChannelGroupActionWithHttpInfo + * + * Execute action on the channel group + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function executeChannelGroupActionWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = ''; + $request = $this->executeChannelGroupActionRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation executeChannelGroupActionAsync + * + * Execute action on the channel group + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function executeChannelGroupActionAsync($id, $body, $x_accept_version = null) + { + return $this->executeChannelGroupActionAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation executeChannelGroupActionAsyncWithHttpInfo + * + * Execute action on the channel group + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function executeChannelGroupActionAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = ''; + $request = $this->executeChannelGroupActionRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'executeChannelGroupAction' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function executeChannelGroupActionRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling executeChannelGroupAction' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling executeChannelGroupAction' + ); + } + + $resourcePath = '/channel-groups/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannelGroup + * + * Get channel group by ID + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ChannelGroup + */ + public function getChannelGroup($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getChannelGroupWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getChannelGroupWithHttpInfo + * + * Get channel group by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelGroupWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup'; + $request = $this->getChannelGroupRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ChannelGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelGroupAsync + * + * Get channel group by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelGroupAsync($id, $x_accept_version = null, $include = null) + { + return $this->getChannelGroupAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelGroupAsyncWithHttpInfo + * + * Get channel group by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelGroupAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup'; + $request = $this->getChannelGroupRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannelGroup' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelGroupRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getChannelGroup' + ); + } + + $resourcePath = '/channel-groups/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannelGroups + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ChannelGroup[] + */ + public function getChannelGroups($x_accept_version = null, $include = null) + { + list($response) = $this->getChannelGroupsWithHttpInfo($x_accept_version, $include); + return $response; + } + + /** + * Operation getChannelGroupsWithHttpInfo + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ChannelGroup[], HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelGroupsWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup[]'; + $request = $this->getChannelGroupsRequest($x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ChannelGroup[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelGroupsAsync + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelGroupsAsync($x_accept_version = null, $include = null) + { + return $this->getChannelGroupsAsyncWithHttpInfo($x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelGroupsAsyncWithHttpInfo + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelGroupsAsyncWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup[]'; + $request = $this->getChannelGroupsRequest($x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannelGroups' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelGroupsRequest($x_accept_version = null, $include = null) + { + + $resourcePath = '/channel-groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateChannelGroup + * + * Update channel group + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body5 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ChannelGroup + */ + public function updateChannelGroup($id, $body, $x_accept_version = null) + { + list($response) = $this->updateChannelGroupWithHttpInfo($id, $body, $x_accept_version); + return $response; + } + + /** + * Operation updateChannelGroupWithHttpInfo + * + * Update channel group + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body5 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) + */ + public function updateChannelGroupWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup'; + $request = $this->updateChannelGroupRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ChannelGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateChannelGroupAsync + * + * Update channel group + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body5 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChannelGroupAsync($id, $body, $x_accept_version = null) + { + return $this->updateChannelGroupAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateChannelGroupAsyncWithHttpInfo + * + * Update channel group + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body5 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChannelGroupAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\ChannelGroup'; + $request = $this->updateChannelGroupRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateChannelGroup' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body5 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateChannelGroupRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateChannelGroup' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateChannelGroup' + ); + } + + $resourcePath = '/channel-groups/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ChannelsApi.php b/lib/Api/ChannelsApi.php new file mode 100644 index 0000000..76305c6 --- /dev/null +++ b/lib/Api/ChannelsApi.php @@ -0,0 +1,2152 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation executeAction + * + * Execute action on the channel + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function executeAction($id, $body, $x_accept_version = null) + { + $this->executeActionWithHttpInfo($id, $body, $x_accept_version); + } + + /** + * Operation executeActionWithHttpInfo + * + * Execute action on the channel + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function executeActionWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = ''; + $request = $this->executeActionRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation executeActionAsync + * + * Execute action on the channel + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function executeActionAsync($id, $body, $x_accept_version = null) + { + return $this->executeActionAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation executeActionAsyncWithHttpInfo + * + * Execute action on the channel + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function executeActionAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = ''; + $request = $this->executeActionRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'executeAction' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function executeActionRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling executeAction' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling executeAction' + ); + } + + $resourcePath = '/channels/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannel + * + * Get channel by ID + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Channel + */ + public function getChannel($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getChannelWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getChannelWithHttpInfo + * + * Get channel by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Channel'; + $request = $this->getChannelRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Channel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelAsync + * + * Get channel by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelAsync($id, $x_accept_version = null, $include = null) + { + return $this->getChannelAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelAsyncWithHttpInfo + * + * Get channel by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Channel'; + $request = $this->getChannelRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannel' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getChannel' + ); + } + + $resourcePath = '/channels/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannelMeasurementLogs + * + * Get measurement logs. + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) + * @param int $offset Pagination offset (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\InlineResponse2004[] + */ + public function getChannelMeasurementLogs($id, $x_accept_version = null, $limit = '5000', $offset = null) + { + list($response) = $this->getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version, $limit, $offset); + return $response; + } + + /** + * Operation getChannelMeasurementLogsWithHttpInfo + * + * Get measurement logs. + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) + * @param int $offset Pagination offset (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\InlineResponse2004[], HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version = null, $limit = '5000', $offset = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2004[]'; + $request = $this->getChannelMeasurementLogsRequest($id, $x_accept_version, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse2004[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse4001', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelMeasurementLogsAsync + * + * Get measurement logs. + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) + * @param int $offset Pagination offset (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelMeasurementLogsAsync($id, $x_accept_version = null, $limit = '5000', $offset = null) + { + return $this->getChannelMeasurementLogsAsyncWithHttpInfo($id, $x_accept_version, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelMeasurementLogsAsyncWithHttpInfo + * + * Get measurement logs. + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) + * @param int $offset Pagination offset (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelMeasurementLogsAsyncWithHttpInfo($id, $x_accept_version = null, $limit = '5000', $offset = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2004[]'; + $request = $this->getChannelMeasurementLogsRequest($id, $x_accept_version, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannelMeasurementLogs' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) + * @param int $offset Pagination offset (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelMeasurementLogsRequest($id, $x_accept_version = null, $limit = '5000', $offset = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getChannelMeasurementLogs' + ); + } + + $resourcePath = '/channels/{id}/measurement-logs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannelMeasurementLogsCsvFile + * + * Get measurement logs as zipped CSV file. + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject + */ + public function getChannelMeasurementLogsCsvFile($id, $x_accept_version = null) + { + list($response) = $this->getChannelMeasurementLogsCsvFileWithHttpInfo($id, $x_accept_version); + return $response; + } + + /** + * Operation getChannelMeasurementLogsCsvFileWithHttpInfo + * + * Get measurement logs as zipped CSV file. + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $x_accept_version = null) + { + $returnType = '\SplFileObject'; + $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse4001', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelMeasurementLogsCsvFileAsync + * + * Get measurement logs as zipped CSV file. + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelMeasurementLogsCsvFileAsync($id, $x_accept_version = null) + { + return $this->getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelMeasurementLogsCsvFileAsyncWithHttpInfo + * + * Get measurement logs as zipped CSV file. + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $x_accept_version = null) + { + $returnType = '\SplFileObject'; + $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannelMeasurementLogsCsvFile' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelMeasurementLogsCsvFileRequest($id, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getChannelMeasurementLogsCsvFile' + ); + } + + $resourcePath = '/channels/{id}/measurement-logs-csv'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/zip'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/zip'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannelSchedules + * + * Get schedules list of the channel + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Schedule[] + */ + public function getChannelSchedules($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getChannelSchedulesWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getChannelSchedulesWithHttpInfo + * + * Get schedules list of the channel + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelSchedulesWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Schedule[]'; + $request = $this->getChannelSchedulesRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Schedule[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelSchedulesAsync + * + * Get schedules list of the channel + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelSchedulesAsync($id, $x_accept_version = null, $include = null) + { + return $this->getChannelSchedulesAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelSchedulesAsyncWithHttpInfo + * + * Get schedules list of the channel + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelSchedulesAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Schedule[]'; + $request = $this->getChannelSchedulesRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannelSchedules' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelSchedulesRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getChannelSchedules' + ); + } + + $resourcePath = '/channels/{id}/schedules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChannels + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * @param string[] $function function (optional) + * @param string $io Return only `input` or `output` channels. (optional) + * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Channel[] + */ + public function getChannels($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + { + list($response) = $this->getChannelsWithHttpInfo($x_accept_version, $include, $function, $io, $has_function); + return $response; + } + + /** + * Operation getChannelsWithHttpInfo + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * @param string[] $function (optional) + * @param string $io Return only `input` or `output` channels. (optional) + * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Channel[], HTTP status code, HTTP response headers (array of strings) + */ + public function getChannelsWithHttpInfo($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + { + $returnType = '\Swagger\Client\Model\Channel[]'; + $request = $this->getChannelsRequest($x_accept_version, $include, $function, $io, $has_function); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Channel[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChannelsAsync + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * @param string[] $function (optional) + * @param string $io Return only `input` or `output` channels. (optional) + * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelsAsync($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + { + return $this->getChannelsAsyncWithHttpInfo($x_accept_version, $include, $function, $io, $has_function) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChannelsAsyncWithHttpInfo + * + * Get channels list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * @param string[] $function (optional) + * @param string $io Return only `input` or `output` channels. (optional) + * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChannelsAsyncWithHttpInfo($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + { + $returnType = '\Swagger\Client\Model\Channel[]'; + $request = $this->getChannelsRequest($x_accept_version, $include, $function, $io, $has_function); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChannels' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * @param string[] $function (optional) + * @param string $io Return only `input` or `output` channels. (optional) + * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChannelsRequest($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + { + + $resourcePath = '/channels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // query params + if (is_array($function)) { + $function = ObjectSerializer::serializeCollection($function, 'csv', true); + } + if ($function !== null) { + $queryParams['function'] = ObjectSerializer::toQueryValue($function); + } + // query params + if ($io !== null) { + $queryParams['io'] = ObjectSerializer::toQueryValue($io); + } + // query params + if ($has_function !== null) { + $queryParams['hasFunction'] = ObjectSerializer::toQueryValue($has_function); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateChannel + * + * Update channel + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body2 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Channel + */ + public function updateChannel($id, $body, $x_accept_version = null) + { + list($response) = $this->updateChannelWithHttpInfo($id, $body, $x_accept_version); + return $response; + } + + /** + * Operation updateChannelWithHttpInfo + * + * Update channel + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body2 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) + */ + public function updateChannelWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Channel'; + $request = $this->updateChannelRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Channel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateChannelAsync + * + * Update channel + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body2 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChannelAsync($id, $body, $x_accept_version = null) + { + return $this->updateChannelAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateChannelAsyncWithHttpInfo + * + * Update channel + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body2 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChannelAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Channel'; + $request = $this->updateChannelRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateChannel' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body2 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateChannelRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateChannel' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateChannel' + ); + } + + $resourcePath = '/channels/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ClientAppsApi.php b/lib/Api/ClientAppsApi.php new file mode 100644 index 0000000..a712e62 --- /dev/null +++ b/lib/Api/ClientAppsApi.php @@ -0,0 +1,914 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation deleteClientApp + * + * Delete Client App + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteClientApp($id, $x_accept_version = null) + { + $this->deleteClientAppWithHttpInfo($id, $x_accept_version); + } + + /** + * Operation deleteClientAppWithHttpInfo + * + * Delete Client App + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteClientAppWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteClientAppRequest($id, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteClientAppAsync + * + * Delete Client App + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteClientAppAsync($id, $x_accept_version = null) + { + return $this->deleteClientAppAsyncWithHttpInfo($id, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteClientAppAsyncWithHttpInfo + * + * Delete Client App + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteClientAppAsyncWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteClientAppRequest($id, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteClientApp' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteClientAppRequest($id, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteClientApp' + ); + } + + $resourcePath = '/client-apps/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getClientApps + * + * Get client apps + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ClientApp[] + */ + public function getClientApps($x_accept_version = null, $include = null) + { + list($response) = $this->getClientAppsWithHttpInfo($x_accept_version, $include); + return $response; + } + + /** + * Operation getClientAppsWithHttpInfo + * + * Get client apps + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ClientApp[], HTTP status code, HTTP response headers (array of strings) + */ + public function getClientAppsWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\ClientApp[]'; + $request = $this->getClientAppsRequest($x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ClientApp[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getClientAppsAsync + * + * Get client apps + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getClientAppsAsync($x_accept_version = null, $include = null) + { + return $this->getClientAppsAsyncWithHttpInfo($x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getClientAppsAsyncWithHttpInfo + * + * Get client apps + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getClientAppsAsyncWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\ClientApp[]'; + $request = $this->getClientAppsRequest($x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getClientApps' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getClientAppsRequest($x_accept_version = null, $include = null) + { + + $resourcePath = '/client-apps'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateClientApp + * + * Update client app + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body7 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ClientApp + */ + public function updateClientApp($id, $body, $x_accept_version = null) + { + list($response) = $this->updateClientAppWithHttpInfo($id, $body, $x_accept_version); + return $response; + } + + /** + * Operation updateClientAppWithHttpInfo + * + * Update client app + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body7 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ClientApp, HTTP status code, HTTP response headers (array of strings) + */ + public function updateClientAppWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\ClientApp'; + $request = $this->updateClientAppRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ClientApp', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateClientAppAsync + * + * Update client app + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body7 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateClientAppAsync($id, $body, $x_accept_version = null) + { + return $this->updateClientAppAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateClientAppAsyncWithHttpInfo + * + * Update client app + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body7 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateClientAppAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\ClientApp'; + $request = $this->updateClientAppRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateClientApp' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body7 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateClientAppRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateClientApp' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateClientApp' + ); + } + + $resourcePath = '/client-apps/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/IODevicesApi.php b/lib/Api/IODevicesApi.php new file mode 100644 index 0000000..e6198d0 --- /dev/null +++ b/lib/Api/IODevicesApi.php @@ -0,0 +1,1498 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation deleteIoDevice + * + * Delete IO Device + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteIoDevice($id, $x_accept_version = null) + { + $this->deleteIoDeviceWithHttpInfo($id, $x_accept_version); + } + + /** + * Operation deleteIoDeviceWithHttpInfo + * + * Delete IO Device + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteIoDeviceWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteIoDeviceRequest($id, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteIoDeviceAsync + * + * Delete IO Device + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteIoDeviceAsync($id, $x_accept_version = null) + { + return $this->deleteIoDeviceAsyncWithHttpInfo($id, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteIoDeviceAsyncWithHttpInfo + * + * Delete IO Device + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteIoDeviceAsyncWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteIoDeviceRequest($id, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteIoDevice' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteIoDeviceRequest($id, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteIoDevice' + ); + } + + $resourcePath = '/iodevices/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getIoDevice + * + * Get IO Device + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Device + */ + public function getIoDevice($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getIoDeviceWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getIoDeviceWithHttpInfo + * + * Get IO Device + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Device, HTTP status code, HTTP response headers (array of strings) + */ + public function getIoDeviceWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Device'; + $request = $this->getIoDeviceRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Device', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getIoDeviceAsync + * + * Get IO Device + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIoDeviceAsync($id, $x_accept_version = null, $include = null) + { + return $this->getIoDeviceAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIoDeviceAsyncWithHttpInfo + * + * Get IO Device + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIoDeviceAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Device'; + $request = $this->getIoDeviceRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getIoDevice' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getIoDeviceRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getIoDevice' + ); + } + + $resourcePath = '/iodevices/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getIoDeviceChannels + * + * Get Channels that belong to IO Deice + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Channel + */ + public function getIoDeviceChannels($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getIoDeviceChannelsWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getIoDeviceChannelsWithHttpInfo + * + * Get Channels that belong to IO Deice + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) + */ + public function getIoDeviceChannelsWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Channel'; + $request = $this->getIoDeviceChannelsRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Channel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getIoDeviceChannelsAsync + * + * Get Channels that belong to IO Deice + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIoDeviceChannelsAsync($id, $x_accept_version = null, $include = null) + { + return $this->getIoDeviceChannelsAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIoDeviceChannelsAsyncWithHttpInfo + * + * Get Channels that belong to IO Deice + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIoDeviceChannelsAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Channel'; + $request = $this->getIoDeviceChannelsRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getIoDeviceChannels' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getIoDeviceChannelsRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getIoDeviceChannels' + ); + } + + $resourcePath = '/iodevices/{id}/channels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getIoDevices + * + * Get IO Devices + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Device[] + */ + public function getIoDevices($x_accept_version = null, $include = null) + { + list($response) = $this->getIoDevicesWithHttpInfo($x_accept_version, $include); + return $response; + } + + /** + * Operation getIoDevicesWithHttpInfo + * + * Get IO Devices + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Device[], HTTP status code, HTTP response headers (array of strings) + */ + public function getIoDevicesWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Device[]'; + $request = $this->getIoDevicesRequest($x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Device[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getIoDevicesAsync + * + * Get IO Devices + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIoDevicesAsync($x_accept_version = null, $include = null) + { + return $this->getIoDevicesAsyncWithHttpInfo($x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIoDevicesAsyncWithHttpInfo + * + * Get IO Devices + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIoDevicesAsyncWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Device[]'; + $request = $this->getIoDevicesRequest($x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getIoDevices' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getIoDevicesRequest($x_accept_version = null, $include = null) + { + + $resourcePath = '/iodevices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateIoDevice + * + * Update IO Device + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body8 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Device + */ + public function updateIoDevice($id, $body, $x_accept_version = null) + { + list($response) = $this->updateIoDeviceWithHttpInfo($id, $body, $x_accept_version); + return $response; + } + + /** + * Operation updateIoDeviceWithHttpInfo + * + * Update IO Device + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body8 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Device, HTTP status code, HTTP response headers (array of strings) + */ + public function updateIoDeviceWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Device'; + $request = $this->updateIoDeviceRequest($id, $body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Device', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateIoDeviceAsync + * + * Update IO Device + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body8 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateIoDeviceAsync($id, $body, $x_accept_version = null) + { + return $this->updateIoDeviceAsyncWithHttpInfo($id, $body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateIoDeviceAsyncWithHttpInfo + * + * Update IO Device + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body8 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateIoDeviceAsyncWithHttpInfo($id, $body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Device'; + $request = $this->updateIoDeviceRequest($id, $body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateIoDevice' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body8 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateIoDeviceRequest($id, $body, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateIoDevice' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateIoDevice' + ); + } + + $resourcePath = '/iodevices/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/LocationsApi.php b/lib/Api/LocationsApi.php new file mode 100644 index 0000000..49f96bc --- /dev/null +++ b/lib/Api/LocationsApi.php @@ -0,0 +1,1491 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createLocation + * + * Create a new location + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Location + */ + public function createLocation($x_accept_version = null) + { + list($response) = $this->createLocationWithHttpInfo($x_accept_version); + return $response; + } + + /** + * Operation createLocationWithHttpInfo + * + * Create a new location + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) + */ + public function createLocationWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Location'; + $request = $this->createLocationRequest($x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Location', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createLocationAsync + * + * Create a new location + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createLocationAsync($x_accept_version = null) + { + return $this->createLocationAsyncWithHttpInfo($x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createLocationAsyncWithHttpInfo + * + * Create a new location + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createLocationAsyncWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Location'; + $request = $this->createLocationRequest($x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createLocation' + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createLocationRequest($x_accept_version = null) + { + + $resourcePath = '/locations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLocation + * + * Delete location + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteLocation($id, $x_accept_version = null, $include = null) + { + $this->deleteLocationWithHttpInfo($id, $x_accept_version, $include); + } + + /** + * Operation deleteLocationWithHttpInfo + * + * Delete location + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLocationWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = ''; + $request = $this->deleteLocationRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteLocationAsync + * + * Delete location + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteLocationAsync($id, $x_accept_version = null, $include = null) + { + return $this->deleteLocationAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLocationAsyncWithHttpInfo + * + * Delete location + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteLocationAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = ''; + $request = $this->deleteLocationRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLocation' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteLocationRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteLocation' + ); + } + + $resourcePath = '/locations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLocation + * + * Get location by ID + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Location + */ + public function getLocation($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getLocationWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getLocationWithHttpInfo + * + * Get location by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) + */ + public function getLocationWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Location'; + $request = $this->getLocationRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Location', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLocationAsync + * + * Get location by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getLocationAsync($id, $x_accept_version = null, $include = null) + { + return $this->getLocationAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLocationAsyncWithHttpInfo + * + * Get location by ID + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getLocationAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Location'; + $request = $this->getLocationRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLocation' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getLocationRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getLocation' + ); + } + + $resourcePath = '/locations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLocations + * + * Get locations list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Location[] + */ + public function getLocations($x_accept_version = null, $include = null) + { + list($response) = $this->getLocationsWithHttpInfo($x_accept_version, $include); + return $response; + } + + /** + * Operation getLocationsWithHttpInfo + * + * Get locations list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Location[], HTTP status code, HTTP response headers (array of strings) + */ + public function getLocationsWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Location[]'; + $request = $this->getLocationsRequest($x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Location[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLocationsAsync + * + * Get locations list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getLocationsAsync($x_accept_version = null, $include = null) + { + return $this->getLocationsAsyncWithHttpInfo($x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLocationsAsyncWithHttpInfo + * + * Get locations list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getLocationsAsyncWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Location[]'; + $request = $this->getLocationsRequest($x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLocations' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getLocationsRequest($x_accept_version = null, $include = null) + { + + $resourcePath = '/locations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLocation + * + * Edit location + * + * @param int $id id (required) + * @param \Swagger\Client\Model\Body1 $body body (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Location + */ + public function updateLocation($id, $body, $x_accept_version = null, $include = null) + { + list($response) = $this->updateLocationWithHttpInfo($id, $body, $x_accept_version, $include); + return $response; + } + + /** + * Operation updateLocationWithHttpInfo + * + * Edit location + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body1 $body (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLocationWithHttpInfo($id, $body, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Location'; + $request = $this->updateLocationRequest($id, $body, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Location', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLocationAsync + * + * Edit location + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body1 $body (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLocationAsync($id, $body, $x_accept_version = null, $include = null) + { + return $this->updateLocationAsyncWithHttpInfo($id, $body, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLocationAsyncWithHttpInfo + * + * Edit location + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body1 $body (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLocationAsyncWithHttpInfo($id, $body, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Location'; + $request = $this->updateLocationRequest($id, $body, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLocation' + * + * @param int $id (required) + * @param \Swagger\Client\Model\Body1 $body (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateLocationRequest($id, $body, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateLocation' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateLocation' + ); + } + + $resourcePath = '/locations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/SchedulesApi.php b/lib/Api/SchedulesApi.php new file mode 100644 index 0000000..ab5f892 --- /dev/null +++ b/lib/Api/SchedulesApi.php @@ -0,0 +1,1728 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createSchedule + * + * Create a new schedule + * + * @param \Swagger\Client\Model\ScheduleRequest $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Schedule + */ + public function createSchedule($body, $x_accept_version = null) + { + list($response) = $this->createScheduleWithHttpInfo($body, $x_accept_version); + return $response; + } + + /** + * Operation createScheduleWithHttpInfo + * + * Create a new schedule + * + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) + */ + public function createScheduleWithHttpInfo($body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Schedule'; + $request = $this->createScheduleRequest($body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Schedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createScheduleAsync + * + * Create a new schedule + * + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createScheduleAsync($body, $x_accept_version = null) + { + return $this->createScheduleAsyncWithHttpInfo($body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createScheduleAsyncWithHttpInfo + * + * Create a new schedule + * + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createScheduleAsyncWithHttpInfo($body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\Schedule'; + $request = $this->createScheduleRequest($body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSchedule' + * + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createScheduleRequest($body, $x_accept_version = null) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling createSchedule' + ); + } + + $resourcePath = '/schedules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSchedule + * + * Delete Schedule + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSchedule($id, $x_accept_version = null) + { + $this->deleteScheduleWithHttpInfo($id, $x_accept_version); + } + + /** + * Operation deleteScheduleWithHttpInfo + * + * Delete Schedule + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteScheduleWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteScheduleRequest($id, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteScheduleAsync + * + * Delete Schedule + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteScheduleAsync($id, $x_accept_version = null) + { + return $this->deleteScheduleAsyncWithHttpInfo($id, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteScheduleAsyncWithHttpInfo + * + * Delete Schedule + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteScheduleAsyncWithHttpInfo($id, $x_accept_version = null) + { + $returnType = ''; + $request = $this->deleteScheduleRequest($id, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSchedule' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteScheduleRequest($id, $x_accept_version = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteSchedule' + ); + } + + $resourcePath = '/schedules/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation enableSchedules + * + * Enable schedules + * + * @param \Swagger\Client\Model\Body9 $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function enableSchedules($body, $x_accept_version = null) + { + $this->enableSchedulesWithHttpInfo($body, $x_accept_version); + } + + /** + * Operation enableSchedulesWithHttpInfo + * + * Enable schedules + * + * @param \Swagger\Client\Model\Body9 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function enableSchedulesWithHttpInfo($body, $x_accept_version = null) + { + $returnType = ''; + $request = $this->enableSchedulesRequest($body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation enableSchedulesAsync + * + * Enable schedules + * + * @param \Swagger\Client\Model\Body9 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function enableSchedulesAsync($body, $x_accept_version = null) + { + return $this->enableSchedulesAsyncWithHttpInfo($body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation enableSchedulesAsyncWithHttpInfo + * + * Enable schedules + * + * @param \Swagger\Client\Model\Body9 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function enableSchedulesAsyncWithHttpInfo($body, $x_accept_version = null) + { + $returnType = ''; + $request = $this->enableSchedulesRequest($body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'enableSchedules' + * + * @param \Swagger\Client\Model\Body9 $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function enableSchedulesRequest($body, $x_accept_version = null) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling enableSchedules' + ); + } + + $resourcePath = '/schedules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSchedule + * + * Get Schedule + * + * @param int $id id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Schedule + */ + public function getSchedule($id, $x_accept_version = null, $include = null) + { + list($response) = $this->getScheduleWithHttpInfo($id, $x_accept_version, $include); + return $response; + } + + /** + * Operation getScheduleWithHttpInfo + * + * Get Schedule + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) + */ + public function getScheduleWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Schedule'; + $request = $this->getScheduleRequest($id, $x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Schedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getScheduleAsync + * + * Get Schedule + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getScheduleAsync($id, $x_accept_version = null, $include = null) + { + return $this->getScheduleAsyncWithHttpInfo($id, $x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getScheduleAsyncWithHttpInfo + * + * Get Schedule + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getScheduleAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Schedule'; + $request = $this->getScheduleRequest($id, $x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSchedule' + * + * @param int $id (required) + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getScheduleRequest($id, $x_accept_version = null, $include = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getSchedule' + ); + } + + $resourcePath = '/schedules/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSchedules + * + * Get schedules list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Schedule[] + */ + public function getSchedules($x_accept_version = null, $include = null) + { + list($response) = $this->getSchedulesWithHttpInfo($x_accept_version, $include); + return $response; + } + + /** + * Operation getSchedulesWithHttpInfo + * + * Get schedules list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) + */ + public function getSchedulesWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Schedule[]'; + $request = $this->getSchedulesRequest($x_accept_version, $include); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Schedule[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSchedulesAsync + * + * Get schedules list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSchedulesAsync($x_accept_version = null, $include = null) + { + return $this->getSchedulesAsyncWithHttpInfo($x_accept_version, $include) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSchedulesAsyncWithHttpInfo + * + * Get schedules list + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSchedulesAsyncWithHttpInfo($x_accept_version = null, $include = null) + { + $returnType = '\Swagger\Client\Model\Schedule[]'; + $request = $this->getSchedulesRequest($x_accept_version, $include); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSchedules' + * + * @param string $x_accept_version API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSchedulesRequest($x_accept_version = null, $include = null) + { + + $resourcePath = '/schedules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); + } + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSchedule + * + * Update schedule + * + * @param int $id id (required) + * @param \Swagger\Client\Model\ScheduleRequest $body body (required) + * @param string $x_accept_version API Version (optional) + * @param bool $enable Set to `true` to enable the schedule after saving. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Schedule + */ + public function updateSchedule($id, $body, $x_accept_version = null, $enable = null) + { + list($response) = $this->updateScheduleWithHttpInfo($id, $body, $x_accept_version, $enable); + return $response; + } + + /** + * Operation updateScheduleWithHttpInfo + * + * Update schedule + * + * @param int $id (required) + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * @param bool $enable Set to `true` to enable the schedule after saving. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) + */ + public function updateScheduleWithHttpInfo($id, $body, $x_accept_version = null, $enable = null) + { + $returnType = '\Swagger\Client\Model\Schedule'; + $request = $this->updateScheduleRequest($id, $body, $x_accept_version, $enable); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Schedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateScheduleAsync + * + * Update schedule + * + * @param int $id (required) + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * @param bool $enable Set to `true` to enable the schedule after saving. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateScheduleAsync($id, $body, $x_accept_version = null, $enable = null) + { + return $this->updateScheduleAsyncWithHttpInfo($id, $body, $x_accept_version, $enable) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateScheduleAsyncWithHttpInfo + * + * Update schedule + * + * @param int $id (required) + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * @param bool $enable Set to `true` to enable the schedule after saving. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateScheduleAsyncWithHttpInfo($id, $body, $x_accept_version = null, $enable = null) + { + $returnType = '\Swagger\Client\Model\Schedule'; + $request = $this->updateScheduleRequest($id, $body, $x_accept_version, $enable); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSchedule' + * + * @param int $id (required) + * @param \Swagger\Client\Model\ScheduleRequest $body (required) + * @param string $x_accept_version API Version (optional) + * @param bool $enable Set to `true` to enable the schedule after saving. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateScheduleRequest($id, $body, $x_accept_version = null, $enable = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateSchedule' + ); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateSchedule' + ); + } + + $resourcePath = '/schedules/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($enable !== null) { + $queryParams['enable'] = ObjectSerializer::toQueryValue($enable); + } + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ServerApi.php b/lib/Api/ServerApi.php new file mode 100644 index 0000000..9c116a1 --- /dev/null +++ b/lib/Api/ServerApi.php @@ -0,0 +1,616 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation serverInfoGet + * + * Get server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\InlineResponse200 + */ + public function serverInfoGet($x_accept_version = null) + { + list($response) = $this->serverInfoGetWithHttpInfo($x_accept_version); + return $response; + } + + /** + * Operation serverInfoGetWithHttpInfo + * + * Get server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function serverInfoGetWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse200'; + $request = $this->serverInfoGetRequest($x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation serverInfoGetAsync + * + * Get server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function serverInfoGetAsync($x_accept_version = null) + { + return $this->serverInfoGetAsyncWithHttpInfo($x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation serverInfoGetAsyncWithHttpInfo + * + * Get server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function serverInfoGetAsyncWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse200'; + $request = $this->serverInfoGetRequest($x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'serverInfoGet' + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function serverInfoGetRequest($x_accept_version = null) + { + + $resourcePath = '/server-info'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation serverStatusGet + * + * Get the SUPLA Server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\InlineResponse2001 + */ + public function serverStatusGet($x_accept_version = null) + { + list($response) = $this->serverStatusGetWithHttpInfo($x_accept_version); + return $response; + } + + /** + * Operation serverStatusGetWithHttpInfo + * + * Get the SUPLA Server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\InlineResponse2001, HTTP status code, HTTP response headers (array of strings) + */ + public function serverStatusGetWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2001'; + $request = $this->serverStatusGetRequest($x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse2001', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse503', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation serverStatusGetAsync + * + * Get the SUPLA Server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function serverStatusGetAsync($x_accept_version = null) + { + return $this->serverStatusGetAsyncWithHttpInfo($x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation serverStatusGetAsyncWithHttpInfo + * + * Get the SUPLA Server status + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function serverStatusGetAsyncWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2001'; + $request = $this->serverStatusGetRequest($x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'serverStatusGet' + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function serverStatusGetRequest($x_accept_version = null) + { + + $resourcePath = '/server-status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php new file mode 100644 index 0000000..13e8d74 --- /dev/null +++ b/lib/Api/UsersApi.php @@ -0,0 +1,640 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation editCurrentUser + * + * Edit current user + * + * @param \Swagger\Client\Model\Body $body body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\InlineResponse2003 + */ + public function editCurrentUser($body, $x_accept_version = null) + { + list($response) = $this->editCurrentUserWithHttpInfo($body, $x_accept_version); + return $response; + } + + /** + * Operation editCurrentUserWithHttpInfo + * + * Edit current user + * + * @param \Swagger\Client\Model\Body $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\InlineResponse2003, HTTP status code, HTTP response headers (array of strings) + */ + public function editCurrentUserWithHttpInfo($body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2003'; + $request = $this->editCurrentUserRequest($body, $x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse2003', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation editCurrentUserAsync + * + * Edit current user + * + * @param \Swagger\Client\Model\Body $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function editCurrentUserAsync($body, $x_accept_version = null) + { + return $this->editCurrentUserAsyncWithHttpInfo($body, $x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation editCurrentUserAsyncWithHttpInfo + * + * Edit current user + * + * @param \Swagger\Client\Model\Body $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function editCurrentUserAsyncWithHttpInfo($body, $x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2003'; + $request = $this->editCurrentUserRequest($body, $x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'editCurrentUser' + * + * @param \Swagger\Client\Model\Body $body (required) + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function editCurrentUserRequest($body, $x_accept_version = null) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling editCurrentUser' + ); + } + + $resourcePath = '/users/current'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCurrentUser + * + * Get current user + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\InlineResponse2002 + */ + public function getCurrentUser($x_accept_version = null) + { + list($response) = $this->getCurrentUserWithHttpInfo($x_accept_version); + return $response; + } + + /** + * Operation getCurrentUserWithHttpInfo + * + * Get current user + * + * @param string $x_accept_version API Version (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\InlineResponse2002, HTTP status code, HTTP response headers (array of strings) + */ + public function getCurrentUserWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2002'; + $request = $this->getCurrentUserRequest($x_accept_version); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse()->getBody()->getContents() + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse2002', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCurrentUserAsync + * + * Get current user + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCurrentUserAsync($x_accept_version = null) + { + return $this->getCurrentUserAsyncWithHttpInfo($x_accept_version) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCurrentUserAsyncWithHttpInfo + * + * Get current user + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCurrentUserAsyncWithHttpInfo($x_accept_version = null) + { + $returnType = '\Swagger\Client\Model\InlineResponse2002'; + $request = $this->getCurrentUserRequest($x_accept_version); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCurrentUser' + * + * @param string $x_accept_version API Version (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCurrentUserRequest($x_accept_version = null) + { + + $resourcePath = '/users/current'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // header params + if ($x_accept_version !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/ApiException.php b/lib/ApiException.php new file mode 100644 index 0000000..8d6c450 --- /dev/null +++ b/lib/ApiException.php @@ -0,0 +1,122 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return mixed HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deseralized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/lib/Configuration.php b/lib/Configuration.php new file mode 100644 index 0000000..c61439a --- /dev/null +++ b/lib/Configuration.php @@ -0,0 +1,430 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the detault configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' OpenAPI Spec Version: 2.2.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } +} diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php new file mode 100644 index 0000000..f15e6a2 --- /dev/null +++ b/lib/HeaderSelector.php @@ -0,0 +1,109 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} + diff --git a/lib/Model/AccessID.php b/lib/Model/AccessID.php new file mode 100644 index 0000000..3e0130a --- /dev/null +++ b/lib/Model/AccessID.php @@ -0,0 +1,480 @@ + 'int', + 'caption' => 'string', + 'enabled' => 'bool', + 'locations_ids' => 'int[]', + 'client_apps_ids' => 'int[]', + 'locations' => '\Swagger\Client\Model\Location[]', + 'client_apps' => '\Swagger\Client\Model\ClientApp[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'caption' => null, + 'enabled' => null, + 'locations_ids' => null, + 'client_apps_ids' => null, + 'locations' => null, + 'client_apps' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'caption' => 'caption', + 'enabled' => 'enabled', + 'locations_ids' => 'locationsIds', + 'client_apps_ids' => 'clientAppsIds', + 'locations' => 'locations', + 'client_apps' => 'clientApps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'caption' => 'setCaption', + 'enabled' => 'setEnabled', + 'locations_ids' => 'setLocationsIds', + 'client_apps_ids' => 'setClientAppsIds', + 'locations' => 'setLocations', + 'client_apps' => 'setClientApps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'caption' => 'getCaption', + 'enabled' => 'getEnabled', + 'locations_ids' => 'getLocationsIds', + 'client_apps_ids' => 'getClientAppsIds', + 'locations' => 'getLocations', + 'client_apps' => 'getClientApps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['locations_ids'] = isset($data['locations_ids']) ? $data['locations_ids'] : null; + $this->container['client_apps_ids'] = isset($data['client_apps_ids']) ? $data['client_apps_ids'] : null; + $this->container['locations'] = isset($data['locations']) ? $data['locations'] : null; + $this->container['client_apps'] = isset($data['client_apps']) ? $data['client_apps'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Access ID identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption Location caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled `true` if the location is enabled, `false` otherwise + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets locations_ids + * + * @return int[] + */ + public function getLocationsIds() + { + return $this->container['locations_ids']; + } + + /** + * Sets locations_ids + * + * @param int[] $locations_ids array containing the location idenfifiers assigned to this access ID + * + * @return $this + */ + public function setLocationsIds($locations_ids) + { + $this->container['locations_ids'] = $locations_ids; + + return $this; + } + + /** + * Gets client_apps_ids + * + * @return int[] + */ + public function getClientAppsIds() + { + return $this->container['client_apps_ids']; + } + + /** + * Sets client_apps_ids + * + * @param int[] $client_apps_ids array containing the client apps idenfifiers assigned to this access ID + * + * @return $this + */ + public function setClientAppsIds($client_apps_ids) + { + $this->container['client_apps_ids'] = $client_apps_ids; + + return $this; + } + + /** + * Gets locations + * + * @return \Swagger\Client\Model\Location[] + */ + public function getLocations() + { + return $this->container['locations']; + } + + /** + * Sets locations + * + * @param \Swagger\Client\Model\Location[] $locations Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setLocations($locations) + { + $this->container['locations'] = $locations; + + return $this; + } + + /** + * Gets client_apps + * + * @return \Swagger\Client\Model\ClientApp[] + */ + public function getClientApps() + { + return $this->container['client_apps']; + } + + /** + * Sets client_apps + * + * @param \Swagger\Client\Model\ClientApp[] $client_apps Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setClientApps($client_apps) + { + $this->container['client_apps'] = $client_apps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body.php b/lib/Model/Body.php new file mode 100644 index 0000000..4c796c5 --- /dev/null +++ b/lib/Model/Body.php @@ -0,0 +1,344 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const ACTION_CHANGECLIENTS_REGISTRATION_ENABLED = 'change:clientsRegistrationEnabled'; + const ACTION_CHANGEIO_DEVICES_REGISTRATION_ENABLED = 'change:ioDevicesRegistrationEnabled'; + const ACTION_CHANGEUSER_TIMEZONE = 'change:userTimezone'; + const ACTION_CHANGEPASSWORD = 'change:password'; + const ACTION_AGREERULES = 'agree:rules'; + const ACTION_AGREECOOKIES = 'agree:cookies'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getActionAllowableValues() + { + return [ + self::ACTION_CHANGECLIENTS_REGISTRATION_ENABLED, + self::ACTION_CHANGEIO_DEVICES_REGISTRATION_ENABLED, + self::ACTION_CHANGEUSER_TIMEZONE, + self::ACTION_CHANGEPASSWORD, + self::ACTION_AGREERULES, + self::ACTION_AGREECOOKIES, + ]; + } + + + /** + * 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['action'] = isset($data['action']) ? $data['action'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getActionAllowableValues(); + if (!in_array($this->container['action'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'action', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getActionAllowableValues(); + if (!in_array($this->container['action'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action The `change:userTimezone` requires to provide also a `timezone` value in the request. The `change:password` requires to provide also a `newPassword` and `oldPassword` in the request. + * + * @return $this + */ + public function setAction($action) + { + $allowedValues = $this->getActionAllowableValues(); + if (!is_null($action) && !in_array($action, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'action', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['action'] = $action; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body1.php b/lib/Model/Body1.php new file mode 100644 index 0000000..62ae787 --- /dev/null +++ b/lib/Model/Body1.php @@ -0,0 +1,390 @@ + 'bool', + 'caption' => 'string', + 'password' => 'string', + 'access_ids_ids' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'enabled' => null, + 'caption' => null, + 'password' => null, + 'access_ids_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'caption' => 'caption', + 'password' => 'password', + 'access_ids_ids' => 'accessIdsIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'caption' => 'setCaption', + 'password' => 'setPassword', + 'access_ids_ids' => 'setAccessIdsIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'caption' => 'getCaption', + 'password' => 'getPassword', + 'access_ids_ids' => 'getAccessIdsIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['access_ids_ids'] = isset($data['access_ids_ids']) ? $data['access_ids_ids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password Provide new password if you want to change it. + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets access_ids_ids + * + * @return int[] + */ + public function getAccessIdsIds() + { + return $this->container['access_ids_ids']; + } + + /** + * Sets access_ids_ids + * + * @param int[] $access_ids_ids Access Identifiers identifiers to assign to this location. + * + * @return $this + */ + public function setAccessIdsIds($access_ids_ids) + { + $this->container['access_ids_ids'] = $access_ids_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body10.php b/lib/Model/Body10.php new file mode 100644 index 0000000..b46e9a3 --- /dev/null +++ b/lib/Model/Body10.php @@ -0,0 +1,420 @@ + 'bool', + 'caption' => 'string', + 'password' => 'string', + 'locations_ids' => 'int[]', + 'client_apps_ids' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'enabled' => null, + 'caption' => null, + 'password' => null, + 'locations_ids' => null, + 'client_apps_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'caption' => 'caption', + 'password' => 'password', + 'locations_ids' => 'locationsIds', + 'client_apps_ids' => 'clientAppsIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'caption' => 'setCaption', + 'password' => 'setPassword', + 'locations_ids' => 'setLocationsIds', + 'client_apps_ids' => 'setClientAppsIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'caption' => 'getCaption', + 'password' => 'getPassword', + 'locations_ids' => 'getLocationsIds', + 'client_apps_ids' => 'getClientAppsIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['locations_ids'] = isset($data['locations_ids']) ? $data['locations_ids'] : null; + $this->container['client_apps_ids'] = isset($data['client_apps_ids']) ? $data['client_apps_ids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password Provide new password if you want to change it. + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets locations_ids + * + * @return int[] + */ + public function getLocationsIds() + { + return $this->container['locations_ids']; + } + + /** + * Sets locations_ids + * + * @param int[] $locations_ids Locations identifiers to assign to this Access ID. + * + * @return $this + */ + public function setLocationsIds($locations_ids) + { + $this->container['locations_ids'] = $locations_ids; + + return $this; + } + + /** + * Gets client_apps_ids + * + * @return int[] + */ + public function getClientAppsIds() + { + return $this->container['client_apps_ids']; + } + + /** + * Sets client_apps_ids + * + * @param int[] $client_apps_ids Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. + * + * @return $this + */ + public function setClientAppsIds($client_apps_ids) + { + $this->container['client_apps_ids'] = $client_apps_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body2.php b/lib/Model/Body2.php new file mode 100644 index 0000000..87a72d2 --- /dev/null +++ b/lib/Model/Body2.php @@ -0,0 +1,540 @@ + 'int', + 'param1' => 'int', + 'param2' => 'int', + 'param3' => 'int', + 'caption' => 'string', + 'alt_icon' => 'int', + 'hidden' => 'bool', + 'location_id' => 'int', + 'inherited_location' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'function_id' => null, + 'param1' => null, + 'param2' => null, + 'param3' => null, + 'caption' => null, + 'alt_icon' => null, + 'hidden' => null, + 'location_id' => null, + 'inherited_location' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'function_id' => 'functionId', + 'param1' => 'param1', + 'param2' => 'param2', + 'param3' => 'param3', + 'caption' => 'caption', + 'alt_icon' => 'altIcon', + 'hidden' => 'hidden', + 'location_id' => 'locationId', + 'inherited_location' => 'inheritedLocation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'function_id' => 'setFunctionId', + 'param1' => 'setParam1', + 'param2' => 'setParam2', + 'param3' => 'setParam3', + 'caption' => 'setCaption', + 'alt_icon' => 'setAltIcon', + 'hidden' => 'setHidden', + 'location_id' => 'setLocationId', + 'inherited_location' => 'setInheritedLocation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'function_id' => 'getFunctionId', + 'param1' => 'getParam1', + 'param2' => 'getParam2', + 'param3' => 'getParam3', + 'caption' => 'getCaption', + 'alt_icon' => 'getAltIcon', + 'hidden' => 'getHidden', + 'location_id' => 'getLocationId', + 'inherited_location' => 'getInheritedLocation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['function_id'] = isset($data['function_id']) ? $data['function_id'] : null; + $this->container['param1'] = isset($data['param1']) ? $data['param1'] : null; + $this->container['param2'] = isset($data['param2']) ? $data['param2'] : null; + $this->container['param3'] = isset($data['param3']) ? $data['param3'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['inherited_location'] = isset($data['inherited_location']) ? $data['inherited_location'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets function_id + * + * @return int + */ + public function getFunctionId() + { + return $this->container['function_id']; + } + + /** + * Sets function_id + * + * @param int $function_id function_id + * + * @return $this + */ + public function setFunctionId($function_id) + { + $this->container['function_id'] = $function_id; + + return $this; + } + + /** + * Gets param1 + * + * @return int + */ + public function getParam1() + { + return $this->container['param1']; + } + + /** + * Sets param1 + * + * @param int $param1 param1 + * + * @return $this + */ + public function setParam1($param1) + { + $this->container['param1'] = $param1; + + return $this; + } + + /** + * Gets param2 + * + * @return int + */ + public function getParam2() + { + return $this->container['param2']; + } + + /** + * Sets param2 + * + * @param int $param2 param2 + * + * @return $this + */ + public function setParam2($param2) + { + $this->container['param2'] = $param2; + + return $this; + } + + /** + * Gets param3 + * + * @return int + */ + public function getParam3() + { + return $this->container['param3']; + } + + /** + * Sets param3 + * + * @param int $param3 param3 + * + * @return $this + */ + public function setParam3($param3) + { + $this->container['param3'] = $param3; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets alt_icon + * + * @return int + */ + public function getAltIcon() + { + return $this->container['alt_icon']; + } + + /** + * Sets alt_icon + * + * @param int $alt_icon alt_icon + * + * @return $this + */ + public function setAltIcon($alt_icon) + { + $this->container['alt_icon'] = $alt_icon; + + return $this; + } + + /** + * Gets hidden + * + * @return bool + */ + public function getHidden() + { + return $this->container['hidden']; + } + + /** + * Sets hidden + * + * @param bool $hidden hidden + * + * @return $this + */ + public function setHidden($hidden) + { + $this->container['hidden'] = $hidden; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + + /** + * Gets inherited_location + * + * @return bool + */ + public function getInheritedLocation() + { + return $this->container['inherited_location']; + } + + /** + * Sets inherited_location + * + * @param bool $inherited_location inherited_location + * + * @return $this + */ + public function setInheritedLocation($inherited_location) + { + $this->container['inherited_location'] = $inherited_location; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body3.php b/lib/Model/Body3.php new file mode 100644 index 0000000..da6a61c --- /dev/null +++ b/lib/Model/Body3.php @@ -0,0 +1,330 @@ + '\Swagger\Client\Model\ChannelFunctionActionEnum', + 'percentage' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null, + 'percentage' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'percentage' => 'percentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'percentage' => 'setPercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'percentage' => 'getPercentage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['percentage'] = isset($data['percentage']) ? $data['percentage'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets action + * + * @return \Swagger\Client\Model\ChannelFunctionActionEnum + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \Swagger\Client\Model\ChannelFunctionActionEnum $action action + * + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets percentage + * + * @return int + */ + public function getPercentage() + { + return $this->container['percentage']; + } + + /** + * Sets percentage + * + * @param int $percentage percentage + * + * @return $this + */ + public function setPercentage($percentage) + { + $this->container['percentage'] = $percentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body4.php b/lib/Model/Body4.php new file mode 100644 index 0000000..47921c4 --- /dev/null +++ b/lib/Model/Body4.php @@ -0,0 +1,420 @@ + 'string', + 'alt_icon' => 'int', + 'hidden' => 'bool', + 'location_id' => 'int', + 'channel_ids' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'caption' => null, + 'alt_icon' => null, + 'hidden' => null, + 'location_id' => null, + 'channel_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'caption' => 'caption', + 'alt_icon' => 'altIcon', + 'hidden' => 'hidden', + 'location_id' => 'locationId', + 'channel_ids' => 'channelIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'caption' => 'setCaption', + 'alt_icon' => 'setAltIcon', + 'hidden' => 'setHidden', + 'location_id' => 'setLocationId', + 'channel_ids' => 'setChannelIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'caption' => 'getCaption', + 'alt_icon' => 'getAltIcon', + 'hidden' => 'getHidden', + 'location_id' => 'getLocationId', + 'channel_ids' => 'getChannelIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['channel_ids'] = isset($data['channel_ids']) ? $data['channel_ids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets alt_icon + * + * @return int + */ + public function getAltIcon() + { + return $this->container['alt_icon']; + } + + /** + * Sets alt_icon + * + * @param int $alt_icon alt_icon + * + * @return $this + */ + public function setAltIcon($alt_icon) + { + $this->container['alt_icon'] = $alt_icon; + + return $this; + } + + /** + * Gets hidden + * + * @return bool + */ + public function getHidden() + { + return $this->container['hidden']; + } + + /** + * Sets hidden + * + * @param bool $hidden hidden + * + * @return $this + */ + public function setHidden($hidden) + { + $this->container['hidden'] = $hidden; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + + /** + * Gets channel_ids + * + * @return int[] + */ + public function getChannelIds() + { + return $this->container['channel_ids']; + } + + /** + * Sets channel_ids + * + * @param int[] $channel_ids channel_ids + * + * @return $this + */ + public function setChannelIds($channel_ids) + { + $this->container['channel_ids'] = $channel_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body5.php b/lib/Model/Body5.php new file mode 100644 index 0000000..dae2567 --- /dev/null +++ b/lib/Model/Body5.php @@ -0,0 +1,420 @@ + 'string', + 'alt_icon' => 'int', + 'hidden' => 'bool', + 'location_id' => 'int', + 'channel_ids' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'caption' => null, + 'alt_icon' => null, + 'hidden' => null, + 'location_id' => null, + 'channel_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'caption' => 'caption', + 'alt_icon' => 'altIcon', + 'hidden' => 'hidden', + 'location_id' => 'locationId', + 'channel_ids' => 'channelIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'caption' => 'setCaption', + 'alt_icon' => 'setAltIcon', + 'hidden' => 'setHidden', + 'location_id' => 'setLocationId', + 'channel_ids' => 'setChannelIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'caption' => 'getCaption', + 'alt_icon' => 'getAltIcon', + 'hidden' => 'getHidden', + 'location_id' => 'getLocationId', + 'channel_ids' => 'getChannelIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['channel_ids'] = isset($data['channel_ids']) ? $data['channel_ids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets alt_icon + * + * @return int + */ + public function getAltIcon() + { + return $this->container['alt_icon']; + } + + /** + * Sets alt_icon + * + * @param int $alt_icon alt_icon + * + * @return $this + */ + public function setAltIcon($alt_icon) + { + $this->container['alt_icon'] = $alt_icon; + + return $this; + } + + /** + * Gets hidden + * + * @return bool + */ + public function getHidden() + { + return $this->container['hidden']; + } + + /** + * Sets hidden + * + * @param bool $hidden hidden + * + * @return $this + */ + public function setHidden($hidden) + { + $this->container['hidden'] = $hidden; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + + /** + * Gets channel_ids + * + * @return int[] + */ + public function getChannelIds() + { + return $this->container['channel_ids']; + } + + /** + * Sets channel_ids + * + * @param int[] $channel_ids channel_ids + * + * @return $this + */ + public function setChannelIds($channel_ids) + { + $this->container['channel_ids'] = $channel_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body6.php b/lib/Model/Body6.php new file mode 100644 index 0000000..177ad67 --- /dev/null +++ b/lib/Model/Body6.php @@ -0,0 +1,330 @@ + '\Swagger\Client\Model\ChannelFunctionActionEnum', + 'percentage' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null, + 'percentage' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'percentage' => 'percentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'percentage' => 'setPercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'percentage' => 'getPercentage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['percentage'] = isset($data['percentage']) ? $data['percentage'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets action + * + * @return \Swagger\Client\Model\ChannelFunctionActionEnum + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \Swagger\Client\Model\ChannelFunctionActionEnum $action action + * + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets percentage + * + * @return int + */ + public function getPercentage() + { + return $this->container['percentage']; + } + + /** + * Sets percentage + * + * @param int $percentage percentage + * + * @return $this + */ + public function setPercentage($percentage) + { + $this->container['percentage'] = $percentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body7.php b/lib/Model/Body7.php new file mode 100644 index 0000000..dd0d118 --- /dev/null +++ b/lib/Model/Body7.php @@ -0,0 +1,360 @@ + 'string', + 'enabled' => 'bool', + 'access_id_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'caption' => null, + 'enabled' => null, + 'access_id_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'caption' => 'caption', + 'enabled' => 'enabled', + 'access_id_id' => 'accessIdId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'caption' => 'setCaption', + 'enabled' => 'setEnabled', + 'access_id_id' => 'setAccessIdId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'caption' => 'getCaption', + 'enabled' => 'getEnabled', + 'access_id_id' => 'getAccessIdId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['access_id_id'] = isset($data['access_id_id']) ? $data['access_id_id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets access_id_id + * + * @return int + */ + public function getAccessIdId() + { + return $this->container['access_id_id']; + } + + /** + * Sets access_id_id + * + * @param int $access_id_id access_id_id + * + * @return $this + */ + public function setAccessIdId($access_id_id) + { + $this->container['access_id_id'] = $access_id_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body8.php b/lib/Model/Body8.php new file mode 100644 index 0000000..6c27577 --- /dev/null +++ b/lib/Model/Body8.php @@ -0,0 +1,360 @@ + 'string', + 'enabled' => 'bool', + 'location_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'comment' => null, + 'enabled' => null, + 'location_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comment' => 'comment', + 'enabled' => 'enabled', + 'location_id' => 'locationId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comment' => 'setComment', + 'enabled' => 'setEnabled', + 'location_id' => 'setLocationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comment' => 'getComment', + 'enabled' => 'getEnabled', + 'location_id' => 'getLocationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets comment + * + * @return string + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string $comment comment + * + * @return $this + */ + public function setComment($comment) + { + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Body9.php b/lib/Model/Body9.php new file mode 100644 index 0000000..937729c --- /dev/null +++ b/lib/Model/Body9.php @@ -0,0 +1,300 @@ + 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'enable' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enable' => 'enable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enable' => 'setEnable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enable' => 'getEnable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['enable'] = isset($data['enable']) ? $data['enable'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets enable + * + * @return int[] + */ + public function getEnable() + { + return $this->container['enable']; + } + + /** + * Sets enable + * + * @param int[] $enable Array of schedule identifiers to enable + * + * @return $this + */ + public function setEnable($enable) + { + $this->container['enable'] = $enable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Channel.php b/lib/Model/Channel.php new file mode 100644 index 0000000..8c87785 --- /dev/null +++ b/lib/Model/Channel.php @@ -0,0 +1,840 @@ + 'int', + 'channel_number' => 'int', + 'caption' => 'string', + 'type' => '\Swagger\Client\Model\ChannelType', + 'function' => '\Swagger\Client\Model\ChannelFunction', + 'param1' => '\Swagger\Client\Model\ChannelParam', + 'param2' => '\Swagger\Client\Model\ChannelParam', + 'param3' => '\Swagger\Client\Model\ChannelParam', + 'alt_icon' => 'int', + 'hidden' => 'bool', + 'inherited_location' => 'bool', + 'iodevice_id' => 'int', + 'location_id' => 'int', + 'function_id' => 'int', + 'type_id' => 'int', + 'iodevice' => '\Swagger\Client\Model\Device', + 'location' => '\Swagger\Client\Model\Location', + 'connected' => 'bool', + 'supported_functions' => '\Swagger\Client\Model\ChannelFunction[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'channel_number' => null, + 'caption' => null, + 'type' => null, + 'function' => null, + 'param1' => null, + 'param2' => null, + 'param3' => null, + 'alt_icon' => null, + 'hidden' => null, + 'inherited_location' => null, + 'iodevice_id' => null, + 'location_id' => null, + 'function_id' => null, + 'type_id' => null, + 'iodevice' => null, + 'location' => null, + 'connected' => null, + 'supported_functions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'channel_number' => 'channelNumber', + 'caption' => 'caption', + 'type' => 'type', + 'function' => 'function', + 'param1' => 'param1', + 'param2' => 'param2', + 'param3' => 'param3', + 'alt_icon' => 'altIcon', + 'hidden' => 'hidden', + 'inherited_location' => 'inheritedLocation', + 'iodevice_id' => 'iodeviceId', + 'location_id' => 'locationId', + 'function_id' => 'functionId', + 'type_id' => 'typeId', + 'iodevice' => 'iodevice', + 'location' => 'location', + 'connected' => 'connected', + 'supported_functions' => 'supportedFunctions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'channel_number' => 'setChannelNumber', + 'caption' => 'setCaption', + 'type' => 'setType', + 'function' => 'setFunction', + 'param1' => 'setParam1', + 'param2' => 'setParam2', + 'param3' => 'setParam3', + 'alt_icon' => 'setAltIcon', + 'hidden' => 'setHidden', + 'inherited_location' => 'setInheritedLocation', + 'iodevice_id' => 'setIodeviceId', + 'location_id' => 'setLocationId', + 'function_id' => 'setFunctionId', + 'type_id' => 'setTypeId', + 'iodevice' => 'setIodevice', + 'location' => 'setLocation', + 'connected' => 'setConnected', + 'supported_functions' => 'setSupportedFunctions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'channel_number' => 'getChannelNumber', + 'caption' => 'getCaption', + 'type' => 'getType', + 'function' => 'getFunction', + 'param1' => 'getParam1', + 'param2' => 'getParam2', + 'param3' => 'getParam3', + 'alt_icon' => 'getAltIcon', + 'hidden' => 'getHidden', + 'inherited_location' => 'getInheritedLocation', + 'iodevice_id' => 'getIodeviceId', + 'location_id' => 'getLocationId', + 'function_id' => 'getFunctionId', + 'type_id' => 'getTypeId', + 'iodevice' => 'getIodevice', + 'location' => 'getLocation', + 'connected' => 'getConnected', + 'supported_functions' => 'getSupportedFunctions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['channel_number'] = isset($data['channel_number']) ? $data['channel_number'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['function'] = isset($data['function']) ? $data['function'] : null; + $this->container['param1'] = isset($data['param1']) ? $data['param1'] : null; + $this->container['param2'] = isset($data['param2']) ? $data['param2'] : null; + $this->container['param3'] = isset($data['param3']) ? $data['param3'] : null; + $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; + $this->container['inherited_location'] = isset($data['inherited_location']) ? $data['inherited_location'] : null; + $this->container['iodevice_id'] = isset($data['iodevice_id']) ? $data['iodevice_id'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['function_id'] = isset($data['function_id']) ? $data['function_id'] : null; + $this->container['type_id'] = isset($data['type_id']) ? $data['type_id'] : null; + $this->container['iodevice'] = isset($data['iodevice']) ? $data['iodevice'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['connected'] = isset($data['connected']) ? $data['connected'] : null; + $this->container['supported_functions'] = isset($data['supported_functions']) ? $data['supported_functions'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Channel identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets channel_number + * + * @return int + */ + public function getChannelNumber() + { + return $this->container['channel_number']; + } + + /** + * Sets channel_number + * + * @param int $channel_number Channel ordinal number in its IO Device + * + * @return $this + */ + public function setChannelNumber($channel_number) + { + $this->container['channel_number'] = $channel_number; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption Channel caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets type + * + * @return \Swagger\Client\Model\ChannelType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Swagger\Client\Model\ChannelType $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets function + * + * @return \Swagger\Client\Model\ChannelFunction + */ + public function getFunction() + { + return $this->container['function']; + } + + /** + * Sets function + * + * @param \Swagger\Client\Model\ChannelFunction $function function + * + * @return $this + */ + public function setFunction($function) + { + $this->container['function'] = $function; + + return $this; + } + + /** + * Gets param1 + * + * @return \Swagger\Client\Model\ChannelParam + */ + public function getParam1() + { + return $this->container['param1']; + } + + /** + * Sets param1 + * + * @param \Swagger\Client\Model\ChannelParam $param1 param1 + * + * @return $this + */ + public function setParam1($param1) + { + $this->container['param1'] = $param1; + + return $this; + } + + /** + * Gets param2 + * + * @return \Swagger\Client\Model\ChannelParam + */ + public function getParam2() + { + return $this->container['param2']; + } + + /** + * Sets param2 + * + * @param \Swagger\Client\Model\ChannelParam $param2 param2 + * + * @return $this + */ + public function setParam2($param2) + { + $this->container['param2'] = $param2; + + return $this; + } + + /** + * Gets param3 + * + * @return \Swagger\Client\Model\ChannelParam + */ + public function getParam3() + { + return $this->container['param3']; + } + + /** + * Sets param3 + * + * @param \Swagger\Client\Model\ChannelParam $param3 param3 + * + * @return $this + */ + public function setParam3($param3) + { + $this->container['param3'] = $param3; + + return $this; + } + + /** + * Gets alt_icon + * + * @return int + */ + public function getAltIcon() + { + return $this->container['alt_icon']; + } + + /** + * Sets alt_icon + * + * @param int $alt_icon Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` + * + * @return $this + */ + public function setAltIcon($alt_icon) + { + $this->container['alt_icon'] = $alt_icon; + + return $this; + } + + /** + * Gets hidden + * + * @return bool + */ + public function getHidden() + { + return $this->container['hidden']; + } + + /** + * Sets hidden + * + * @param bool $hidden Whether this channel is shown on client apps or not + * + * @return $this + */ + public function setHidden($hidden) + { + $this->container['hidden'] = $hidden; + + return $this; + } + + /** + * Gets inherited_location + * + * @return bool + */ + public function getInheritedLocation() + { + return $this->container['inherited_location']; + } + + /** + * Sets inherited_location + * + * @param bool $inherited_location Whether this channel inherits its IODevice's location (`true`) or not (`false`) + * + * @return $this + */ + public function setInheritedLocation($inherited_location) + { + $this->container['inherited_location'] = $inherited_location; + + return $this; + } + + /** + * Gets iodevice_id + * + * @return int + */ + public function getIodeviceId() + { + return $this->container['iodevice_id']; + } + + /** + * Sets iodevice_id + * + * @param int $iodevice_id iodevice_id + * + * @return $this + */ + public function setIodeviceId($iodevice_id) + { + $this->container['iodevice_id'] = $iodevice_id; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + + /** + * Gets function_id + * + * @return int + */ + public function getFunctionId() + { + return $this->container['function_id']; + } + + /** + * Sets function_id + * + * @param int $function_id function_id + * + * @return $this + */ + public function setFunctionId($function_id) + { + $this->container['function_id'] = $function_id; + + return $this; + } + + /** + * Gets type_id + * + * @return int + */ + public function getTypeId() + { + return $this->container['type_id']; + } + + /** + * Sets type_id + * + * @param int $type_id type_id + * + * @return $this + */ + public function setTypeId($type_id) + { + $this->container['type_id'] = $type_id; + + return $this; + } + + /** + * Gets iodevice + * + * @return \Swagger\Client\Model\Device + */ + public function getIodevice() + { + return $this->container['iodevice']; + } + + /** + * Sets iodevice + * + * @param \Swagger\Client\Model\Device $iodevice iodevice + * + * @return $this + */ + public function setIodevice($iodevice) + { + $this->container['iodevice'] = $iodevice; + + return $this; + } + + /** + * Gets location + * + * @return \Swagger\Client\Model\Location + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \Swagger\Client\Model\Location $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets connected + * + * @return bool + */ + public function getConnected() + { + return $this->container['connected']; + } + + /** + * Sets connected + * + * @param bool $connected connected + * + * @return $this + */ + public function setConnected($connected) + { + $this->container['connected'] = $connected; + + return $this; + } + + /** + * Gets supported_functions + * + * @return \Swagger\Client\Model\ChannelFunction[] + */ + public function getSupportedFunctions() + { + return $this->container['supported_functions']; + } + + /** + * Sets supported_functions + * + * @param \Swagger\Client\Model\ChannelFunction[] $supported_functions supported_functions + * + * @return $this + */ + public function setSupportedFunctions($supported_functions) + { + $this->container['supported_functions'] = $supported_functions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ChannelFunction.php b/lib/Model/ChannelFunction.php new file mode 100644 index 0000000..d288bd7 --- /dev/null +++ b/lib/Model/ChannelFunction.php @@ -0,0 +1,420 @@ + 'int', + 'name' => '\Swagger\Client\Model\ChannelFunctionEnumNames', + 'caption' => 'string', + 'max_alternative_icon_index' => 'int', + 'possible_actions' => '\Swagger\Client\Model\ChannelFunctionAction[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'name' => null, + 'caption' => null, + 'max_alternative_icon_index' => null, + 'possible_actions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'caption' => 'caption', + 'max_alternative_icon_index' => 'maxAlternativeIconIndex', + 'possible_actions' => 'possibleActions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'caption' => 'setCaption', + 'max_alternative_icon_index' => 'setMaxAlternativeIconIndex', + 'possible_actions' => 'setPossibleActions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'caption' => 'getCaption', + 'max_alternative_icon_index' => 'getMaxAlternativeIconIndex', + 'possible_actions' => 'getPossibleActions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['max_alternative_icon_index'] = isset($data['max_alternative_icon_index']) ? $data['max_alternative_icon_index'] : null; + $this->container['possible_actions'] = isset($data['possible_actions']) ? $data['possible_actions'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return \Swagger\Client\Model\ChannelFunctionEnumNames + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Swagger\Client\Model\ChannelFunctionEnumNames $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets max_alternative_icon_index + * + * @return int + */ + public function getMaxAlternativeIconIndex() + { + return $this->container['max_alternative_icon_index']; + } + + /** + * Sets max_alternative_icon_index + * + * @param int $max_alternative_icon_index max_alternative_icon_index + * + * @return $this + */ + public function setMaxAlternativeIconIndex($max_alternative_icon_index) + { + $this->container['max_alternative_icon_index'] = $max_alternative_icon_index; + + return $this; + } + + /** + * Gets possible_actions + * + * @return \Swagger\Client\Model\ChannelFunctionAction[] + */ + public function getPossibleActions() + { + return $this->container['possible_actions']; + } + + /** + * Sets possible_actions + * + * @param \Swagger\Client\Model\ChannelFunctionAction[] $possible_actions What can you with with this channel? + * + * @return $this + */ + public function setPossibleActions($possible_actions) + { + $this->container['possible_actions'] = $possible_actions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ChannelFunctionAction.php b/lib/Model/ChannelFunctionAction.php new file mode 100644 index 0000000..b5bad19 --- /dev/null +++ b/lib/Model/ChannelFunctionAction.php @@ -0,0 +1,360 @@ + 'int', + 'name' => '\Swagger\Client\Model\ChannelFunctionActionEnum', + 'caption' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'name' => null, + 'caption' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'caption' => 'caption' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'caption' => 'setCaption' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'caption' => 'getCaption' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return \Swagger\Client\Model\ChannelFunctionActionEnum + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Swagger\Client\Model\ChannelFunctionActionEnum $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ChannelFunctionActionEnum.php b/lib/Model/ChannelFunctionActionEnum.php new file mode 100644 index 0000000..335c86c --- /dev/null +++ b/lib/Model/ChannelFunctionActionEnum.php @@ -0,0 +1,77 @@ + 'int', + 'hidden' => 'bool', + 'caption' => 'string', + 'function' => '\Swagger\Client\Model\ChannelFunction', + 'function_id' => 'int', + 'location_id' => 'int', + 'location' => '\Swagger\Client\Model\Location', + 'channel_ids' => 'int[]', + 'channels' => '\Swagger\Client\Model\Channel[]', + 'alt_icon' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'hidden' => null, + 'caption' => null, + 'function' => null, + 'function_id' => null, + 'location_id' => null, + 'location' => null, + 'channel_ids' => null, + 'channels' => null, + 'alt_icon' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'hidden' => 'hidden', + 'caption' => 'caption', + 'function' => 'function', + 'function_id' => 'functionId', + 'location_id' => 'locationId', + 'location' => 'location', + 'channel_ids' => 'channelIds', + 'channels' => 'channels', + 'alt_icon' => 'altIcon' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'hidden' => 'setHidden', + 'caption' => 'setCaption', + 'function' => 'setFunction', + 'function_id' => 'setFunctionId', + 'location_id' => 'setLocationId', + 'location' => 'setLocation', + 'channel_ids' => 'setChannelIds', + 'channels' => 'setChannels', + 'alt_icon' => 'setAltIcon' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'hidden' => 'getHidden', + 'caption' => 'getCaption', + 'function' => 'getFunction', + 'function_id' => 'getFunctionId', + 'location_id' => 'getLocationId', + 'location' => 'getLocation', + 'channel_ids' => 'getChannelIds', + 'channels' => 'getChannels', + 'alt_icon' => 'getAltIcon' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['function'] = isset($data['function']) ? $data['function'] : null; + $this->container['function_id'] = isset($data['function_id']) ? $data['function_id'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['channel_ids'] = isset($data['channel_ids']) ? $data['channel_ids'] : null; + $this->container['channels'] = isset($data['channels']) ? $data['channels'] : null; + $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Channel group identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets hidden + * + * @return bool + */ + public function getHidden() + { + return $this->container['hidden']; + } + + /** + * Sets hidden + * + * @param bool $hidden Whether this channel group is shown on client apps or not + * + * @return $this + */ + public function setHidden($hidden) + { + $this->container['hidden'] = $hidden; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption Channel caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets function + * + * @return \Swagger\Client\Model\ChannelFunction + */ + public function getFunction() + { + return $this->container['function']; + } + + /** + * Sets function + * + * @param \Swagger\Client\Model\ChannelFunction $function function + * + * @return $this + */ + public function setFunction($function) + { + $this->container['function'] = $function; + + return $this; + } + + /** + * Gets function_id + * + * @return int + */ + public function getFunctionId() + { + return $this->container['function_id']; + } + + /** + * Sets function_id + * + * @param int $function_id function_id + * + * @return $this + */ + public function setFunctionId($function_id) + { + $this->container['function_id'] = $function_id; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + + /** + * Gets location + * + * @return \Swagger\Client\Model\Location + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \Swagger\Client\Model\Location $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets channel_ids + * + * @return int[] + */ + public function getChannelIds() + { + return $this->container['channel_ids']; + } + + /** + * Sets channel_ids + * + * @param int[] $channel_ids channel_ids + * + * @return $this + */ + public function setChannelIds($channel_ids) + { + $this->container['channel_ids'] = $channel_ids; + + return $this; + } + + /** + * Gets channels + * + * @return \Swagger\Client\Model\Channel[] + */ + public function getChannels() + { + return $this->container['channels']; + } + + /** + * Sets channels + * + * @param \Swagger\Client\Model\Channel[] $channels Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setChannels($channels) + { + $this->container['channels'] = $channels; + + return $this; + } + + /** + * Gets alt_icon + * + * @return int + */ + public function getAltIcon() + { + return $this->container['alt_icon']; + } + + /** + * Sets alt_icon + * + * @param int $alt_icon Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` + * + * @return $this + */ + public function setAltIcon($alt_icon) + { + $this->container['alt_icon'] = $alt_icon; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ChannelParam.php b/lib/Model/ChannelParam.php new file mode 100644 index 0000000..edce629 --- /dev/null +++ b/lib/Model/ChannelParam.php @@ -0,0 +1,276 @@ +container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ChannelType.php b/lib/Model/ChannelType.php new file mode 100644 index 0000000..306f81d --- /dev/null +++ b/lib/Model/ChannelType.php @@ -0,0 +1,472 @@ + 'int', + 'name' => 'string', + 'caption' => 'string', + 'output' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'name' => null, + 'caption' => null, + 'output' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'caption' => 'caption', + 'output' => 'output' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'caption' => 'setCaption', + 'output' => 'setOutput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'caption' => 'getCaption', + 'output' => 'getOutput' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const NAME_SENSORNO = 'SENSORNO'; + const NAME_SENSORNC = 'SENSORNC'; + const NAME_DISTANCESENSOR = 'DISTANCESENSOR'; + const NAME_CALLBUTTON = 'CALLBUTTON'; + const NAME_RELAYHFD4 = 'RELAYHFD4'; + const NAME_RELAYG5_LA1_A = 'RELAYG5LA1A'; + const NAME_RELAY2_XG5_LA1_A = 'RELAY2XG5LA1A'; + const NAME_RELAY = 'RELAY'; + const NAME_THERMOMETERDS18_B20 = 'THERMOMETERDS18B20'; + const NAME_DHT11 = 'DHT11'; + const NAME_DHT21 = 'DHT21'; + const NAME_DHT22 = 'DHT22'; + const NAME_AM2301 = 'AM2301'; + const NAME_AM2302 = 'AM2302'; + const NAME_THERMOMETER = 'THERMOMETER'; + const NAME_HUMIDITYSENSOR = 'HUMIDITYSENSOR'; + const NAME_HUMIDITYANDTEMPSENSOR = 'HUMIDITYANDTEMPSENSOR'; + const NAME_WINDSENSOR = 'WINDSENSOR'; + const NAME_PRESSURESENSOR = 'PRESSURESENSOR'; + const NAME_RAINSENSOR = 'RAINSENSOR'; + const NAME_WEIGHTSENSOR = 'WEIGHTSENSOR'; + const NAME_WEATHER_STATION = 'WEATHER_STATION'; + const NAME_DIMMER = 'DIMMER'; + const NAME_RGBLEDCONTROLLER = 'RGBLEDCONTROLLER'; + const NAME_DIMMERANDRGBLED = 'DIMMERANDRGBLED'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_SENSORNO, + self::NAME_SENSORNC, + self::NAME_DISTANCESENSOR, + self::NAME_CALLBUTTON, + self::NAME_RELAYHFD4, + self::NAME_RELAYG5_LA1_A, + self::NAME_RELAY2_XG5_LA1_A, + self::NAME_RELAY, + self::NAME_THERMOMETERDS18_B20, + self::NAME_DHT11, + self::NAME_DHT21, + self::NAME_DHT22, + self::NAME_AM2301, + self::NAME_AM2302, + self::NAME_THERMOMETER, + self::NAME_HUMIDITYSENSOR, + self::NAME_HUMIDITYANDTEMPSENSOR, + self::NAME_WINDSENSOR, + self::NAME_PRESSURESENSOR, + self::NAME_RAINSENSOR, + self::NAME_WEIGHTSENSOR, + self::NAME_WEATHER_STATION, + self::NAME_DIMMER, + self::NAME_RGBLEDCONTROLLER, + self::NAME_DIMMERANDRGBLED, + ]; + } + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['output'] = isset($data['output']) ? $data['output'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getNameAllowableValues(); + if (!in_array($this->container['name'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'name', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getNameAllowableValues(); + if (!in_array($this->container['name'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Channel type identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($name) && !in_array($name, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'name', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets output + * + * @return bool + */ + public function getOutput() + { + return $this->container['output']; + } + + /** + * Sets output + * + * @param bool $output Whether the channel is output type (i.e. can take action) or input (i.e. provide data) + * + * @return $this + */ + public function setOutput($output) + { + $this->container['output'] = $output; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ClientApp.php b/lib/Model/ClientApp.php new file mode 100644 index 0000000..1e8b484 --- /dev/null +++ b/lib/Model/ClientApp.php @@ -0,0 +1,660 @@ + 'int', + 'name' => 'string', + 'caption' => 'string', + 'enabled' => 'bool', + 'reg_ipv4' => 'int', + 'reg_date' => '\DateTime', + 'last_access_ipv4' => 'int', + 'last_access_date' => '\DateTime', + 'software_version' => 'string', + 'protocol_version' => 'int', + 'access_id_id' => 'int', + 'connected' => 'bool', + 'access_id' => '\Swagger\Client\Model\AccessID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'name' => null, + 'caption' => null, + 'enabled' => null, + 'reg_ipv4' => null, + 'reg_date' => 'date-time', + 'last_access_ipv4' => null, + 'last_access_date' => 'date-time', + 'software_version' => null, + 'protocol_version' => null, + 'access_id_id' => null, + 'connected' => null, + 'access_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'caption' => 'caption', + 'enabled' => 'enabled', + 'reg_ipv4' => 'regIpv4', + 'reg_date' => 'regDate', + 'last_access_ipv4' => 'lastAccessIpv4', + 'last_access_date' => 'lastAccessDate', + 'software_version' => 'softwareVersion', + 'protocol_version' => 'protocolVersion', + 'access_id_id' => 'accessIdId', + 'connected' => 'connected', + 'access_id' => 'accessId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'caption' => 'setCaption', + 'enabled' => 'setEnabled', + 'reg_ipv4' => 'setRegIpv4', + 'reg_date' => 'setRegDate', + 'last_access_ipv4' => 'setLastAccessIpv4', + 'last_access_date' => 'setLastAccessDate', + 'software_version' => 'setSoftwareVersion', + 'protocol_version' => 'setProtocolVersion', + 'access_id_id' => 'setAccessIdId', + 'connected' => 'setConnected', + 'access_id' => 'setAccessId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'caption' => 'getCaption', + 'enabled' => 'getEnabled', + 'reg_ipv4' => 'getRegIpv4', + 'reg_date' => 'getRegDate', + 'last_access_ipv4' => 'getLastAccessIpv4', + 'last_access_date' => 'getLastAccessDate', + 'software_version' => 'getSoftwareVersion', + 'protocol_version' => 'getProtocolVersion', + 'access_id_id' => 'getAccessIdId', + 'connected' => 'getConnected', + 'access_id' => 'getAccessId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['reg_ipv4'] = isset($data['reg_ipv4']) ? $data['reg_ipv4'] : null; + $this->container['reg_date'] = isset($data['reg_date']) ? $data['reg_date'] : null; + $this->container['last_access_ipv4'] = isset($data['last_access_ipv4']) ? $data['last_access_ipv4'] : null; + $this->container['last_access_date'] = isset($data['last_access_date']) ? $data['last_access_date'] : null; + $this->container['software_version'] = isset($data['software_version']) ? $data['software_version'] : null; + $this->container['protocol_version'] = isset($data['protocol_version']) ? $data['protocol_version'] : null; + $this->container['access_id_id'] = isset($data['access_id_id']) ? $data['access_id_id'] : null; + $this->container['connected'] = isset($data['connected']) ? $data['connected'] : null; + $this->container['access_id'] = isset($data['access_id']) ? $data['access_id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Client application identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets reg_ipv4 + * + * @return int + */ + public function getRegIpv4() + { + return $this->container['reg_ipv4']; + } + + /** + * Sets reg_ipv4 + * + * @param int $reg_ipv4 reg_ipv4 + * + * @return $this + */ + public function setRegIpv4($reg_ipv4) + { + $this->container['reg_ipv4'] = $reg_ipv4; + + return $this; + } + + /** + * Gets reg_date + * + * @return \DateTime + */ + public function getRegDate() + { + return $this->container['reg_date']; + } + + /** + * Sets reg_date + * + * @param \DateTime $reg_date reg_date + * + * @return $this + */ + public function setRegDate($reg_date) + { + $this->container['reg_date'] = $reg_date; + + return $this; + } + + /** + * Gets last_access_ipv4 + * + * @return int + */ + public function getLastAccessIpv4() + { + return $this->container['last_access_ipv4']; + } + + /** + * Sets last_access_ipv4 + * + * @param int $last_access_ipv4 last_access_ipv4 + * + * @return $this + */ + public function setLastAccessIpv4($last_access_ipv4) + { + $this->container['last_access_ipv4'] = $last_access_ipv4; + + return $this; + } + + /** + * Gets last_access_date + * + * @return \DateTime + */ + public function getLastAccessDate() + { + return $this->container['last_access_date']; + } + + /** + * Sets last_access_date + * + * @param \DateTime $last_access_date last_access_date + * + * @return $this + */ + public function setLastAccessDate($last_access_date) + { + $this->container['last_access_date'] = $last_access_date; + + return $this; + } + + /** + * Gets software_version + * + * @return string + */ + public function getSoftwareVersion() + { + return $this->container['software_version']; + } + + /** + * Sets software_version + * + * @param string $software_version software_version + * + * @return $this + */ + public function setSoftwareVersion($software_version) + { + $this->container['software_version'] = $software_version; + + return $this; + } + + /** + * Gets protocol_version + * + * @return int + */ + public function getProtocolVersion() + { + return $this->container['protocol_version']; + } + + /** + * Sets protocol_version + * + * @param int $protocol_version protocol_version + * + * @return $this + */ + public function setProtocolVersion($protocol_version) + { + $this->container['protocol_version'] = $protocol_version; + + return $this; + } + + /** + * Gets access_id_id + * + * @return int + */ + public function getAccessIdId() + { + return $this->container['access_id_id']; + } + + /** + * Sets access_id_id + * + * @param int $access_id_id access_id_id + * + * @return $this + */ + public function setAccessIdId($access_id_id) + { + $this->container['access_id_id'] = $access_id_id; + + return $this; + } + + /** + * Gets connected + * + * @return bool + */ + public function getConnected() + { + return $this->container['connected']; + } + + /** + * Sets connected + * + * @param bool $connected connected + * + * @return $this + */ + public function setConnected($connected) + { + $this->container['connected'] = $connected; + + return $this; + } + + /** + * Gets access_id + * + * @return \Swagger\Client\Model\AccessID + */ + public function getAccessId() + { + return $this->container['access_id']; + } + + /** + * Sets access_id + * + * @param \Swagger\Client\Model\AccessID $access_id access_id + * + * @return $this + */ + public function setAccessId($access_id) + { + $this->container['access_id'] = $access_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Device.php b/lib/Model/Device.php new file mode 100644 index 0000000..cb2d948 --- /dev/null +++ b/lib/Model/Device.php @@ -0,0 +1,810 @@ + 'int', + 'name' => 'string', + 'enabled' => 'bool', + 'comment' => 'string', + 'reg_date' => '\DateTime', + 'reg_ipv4' => 'int', + 'last_connected' => '\DateTime', + 'last_ipv4' => 'int', + 'software_version' => 'string', + 'g_uid_string' => 'string', + 'location_id' => 'int', + 'original_location_id' => 'int', + 'channels_ids' => 'int[]', + 'connected' => 'bool', + 'location' => '\Swagger\Client\Model\Location', + 'original_location' => '\Swagger\Client\Model\Location', + 'channels' => '\Swagger\Client\Model\Channel[]', + 'schedules' => '\Swagger\Client\Model\Schedule[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'name' => null, + 'enabled' => null, + 'comment' => null, + 'reg_date' => 'date-time', + 'reg_ipv4' => null, + 'last_connected' => 'date-time', + 'last_ipv4' => null, + 'software_version' => null, + 'g_uid_string' => null, + 'location_id' => null, + 'original_location_id' => null, + 'channels_ids' => null, + 'connected' => null, + 'location' => null, + 'original_location' => null, + 'channels' => null, + 'schedules' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'enabled' => 'enabled', + 'comment' => 'comment', + 'reg_date' => 'regDate', + 'reg_ipv4' => 'regIpv4', + 'last_connected' => 'lastConnected', + 'last_ipv4' => 'lastIpv4', + 'software_version' => 'softwareVersion', + 'g_uid_string' => 'gUIDString', + 'location_id' => 'locationId', + 'original_location_id' => 'originalLocationId', + 'channels_ids' => 'channelsIds', + 'connected' => 'connected', + 'location' => 'location', + 'original_location' => 'originalLocation', + 'channels' => 'channels', + 'schedules' => 'schedules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'enabled' => 'setEnabled', + 'comment' => 'setComment', + 'reg_date' => 'setRegDate', + 'reg_ipv4' => 'setRegIpv4', + 'last_connected' => 'setLastConnected', + 'last_ipv4' => 'setLastIpv4', + 'software_version' => 'setSoftwareVersion', + 'g_uid_string' => 'setGUidString', + 'location_id' => 'setLocationId', + 'original_location_id' => 'setOriginalLocationId', + 'channels_ids' => 'setChannelsIds', + 'connected' => 'setConnected', + 'location' => 'setLocation', + 'original_location' => 'setOriginalLocation', + 'channels' => 'setChannels', + 'schedules' => 'setSchedules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'enabled' => 'getEnabled', + 'comment' => 'getComment', + 'reg_date' => 'getRegDate', + 'reg_ipv4' => 'getRegIpv4', + 'last_connected' => 'getLastConnected', + 'last_ipv4' => 'getLastIpv4', + 'software_version' => 'getSoftwareVersion', + 'g_uid_string' => 'getGUidString', + 'location_id' => 'getLocationId', + 'original_location_id' => 'getOriginalLocationId', + 'channels_ids' => 'getChannelsIds', + 'connected' => 'getConnected', + 'location' => 'getLocation', + 'original_location' => 'getOriginalLocation', + 'channels' => 'getChannels', + 'schedules' => 'getSchedules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null; + $this->container['reg_date'] = isset($data['reg_date']) ? $data['reg_date'] : null; + $this->container['reg_ipv4'] = isset($data['reg_ipv4']) ? $data['reg_ipv4'] : null; + $this->container['last_connected'] = isset($data['last_connected']) ? $data['last_connected'] : null; + $this->container['last_ipv4'] = isset($data['last_ipv4']) ? $data['last_ipv4'] : null; + $this->container['software_version'] = isset($data['software_version']) ? $data['software_version'] : null; + $this->container['g_uid_string'] = isset($data['g_uid_string']) ? $data['g_uid_string'] : null; + $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['original_location_id'] = isset($data['original_location_id']) ? $data['original_location_id'] : null; + $this->container['channels_ids'] = isset($data['channels_ids']) ? $data['channels_ids'] : null; + $this->container['connected'] = isset($data['connected']) ? $data['connected'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['original_location'] = isset($data['original_location']) ? $data['original_location'] : null; + $this->container['channels'] = isset($data['channels']) ? $data['channels'] : null; + $this->container['schedules'] = isset($data['schedules']) ? $data['schedules'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Device identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets comment + * + * @return string + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string $comment comment + * + * @return $this + */ + public function setComment($comment) + { + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets reg_date + * + * @return \DateTime + */ + public function getRegDate() + { + return $this->container['reg_date']; + } + + /** + * Sets reg_date + * + * @param \DateTime $reg_date reg_date + * + * @return $this + */ + public function setRegDate($reg_date) + { + $this->container['reg_date'] = $reg_date; + + return $this; + } + + /** + * Gets reg_ipv4 + * + * @return int + */ + public function getRegIpv4() + { + return $this->container['reg_ipv4']; + } + + /** + * Sets reg_ipv4 + * + * @param int $reg_ipv4 reg_ipv4 + * + * @return $this + */ + public function setRegIpv4($reg_ipv4) + { + $this->container['reg_ipv4'] = $reg_ipv4; + + return $this; + } + + /** + * Gets last_connected + * + * @return \DateTime + */ + public function getLastConnected() + { + return $this->container['last_connected']; + } + + /** + * Sets last_connected + * + * @param \DateTime $last_connected last_connected + * + * @return $this + */ + public function setLastConnected($last_connected) + { + $this->container['last_connected'] = $last_connected; + + return $this; + } + + /** + * Gets last_ipv4 + * + * @return int + */ + public function getLastIpv4() + { + return $this->container['last_ipv4']; + } + + /** + * Sets last_ipv4 + * + * @param int $last_ipv4 last_ipv4 + * + * @return $this + */ + public function setLastIpv4($last_ipv4) + { + $this->container['last_ipv4'] = $last_ipv4; + + return $this; + } + + /** + * Gets software_version + * + * @return string + */ + public function getSoftwareVersion() + { + return $this->container['software_version']; + } + + /** + * Sets software_version + * + * @param string $software_version software_version + * + * @return $this + */ + public function setSoftwareVersion($software_version) + { + $this->container['software_version'] = $software_version; + + return $this; + } + + /** + * Gets g_uid_string + * + * @return string + */ + public function getGUidString() + { + return $this->container['g_uid_string']; + } + + /** + * Sets g_uid_string + * + * @param string $g_uid_string g_uid_string + * + * @return $this + */ + public function setGUidString($g_uid_string) + { + $this->container['g_uid_string'] = $g_uid_string; + + return $this; + } + + /** + * Gets location_id + * + * @return int + */ + public function getLocationId() + { + return $this->container['location_id']; + } + + /** + * Sets location_id + * + * @param int $location_id location_id + * + * @return $this + */ + public function setLocationId($location_id) + { + $this->container['location_id'] = $location_id; + + return $this; + } + + /** + * Gets original_location_id + * + * @return int + */ + public function getOriginalLocationId() + { + return $this->container['original_location_id']; + } + + /** + * Sets original_location_id + * + * @param int $original_location_id original_location_id + * + * @return $this + */ + public function setOriginalLocationId($original_location_id) + { + $this->container['original_location_id'] = $original_location_id; + + return $this; + } + + /** + * Gets channels_ids + * + * @return int[] + */ + public function getChannelsIds() + { + return $this->container['channels_ids']; + } + + /** + * Sets channels_ids + * + * @param int[] $channels_ids channels_ids + * + * @return $this + */ + public function setChannelsIds($channels_ids) + { + $this->container['channels_ids'] = $channels_ids; + + return $this; + } + + /** + * Gets connected + * + * @return bool + */ + public function getConnected() + { + return $this->container['connected']; + } + + /** + * Sets connected + * + * @param bool $connected connected + * + * @return $this + */ + public function setConnected($connected) + { + $this->container['connected'] = $connected; + + return $this; + } + + /** + * Gets location + * + * @return \Swagger\Client\Model\Location + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \Swagger\Client\Model\Location $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets original_location + * + * @return \Swagger\Client\Model\Location + */ + public function getOriginalLocation() + { + return $this->container['original_location']; + } + + /** + * Sets original_location + * + * @param \Swagger\Client\Model\Location $original_location original_location + * + * @return $this + */ + public function setOriginalLocation($original_location) + { + $this->container['original_location'] = $original_location; + + return $this; + } + + /** + * Gets channels + * + * @return \Swagger\Client\Model\Channel[] + */ + public function getChannels() + { + return $this->container['channels']; + } + + /** + * Sets channels + * + * @param \Swagger\Client\Model\Channel[] $channels Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setChannels($channels) + { + $this->container['channels'] = $channels; + + return $this; + } + + /** + * Gets schedules + * + * @return \Swagger\Client\Model\Schedule[] + */ + public function getSchedules() + { + return $this->container['schedules']; + } + + /** + * Sets schedules + * + * @param \Swagger\Client\Model\Schedule[] $schedules Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setSchedules($schedules) + { + $this->container['schedules'] = $schedules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse200.php b/lib/Model/InlineResponse200.php new file mode 100644 index 0000000..5cfac3d --- /dev/null +++ b/lib/Model/InlineResponse200.php @@ -0,0 +1,510 @@ + 'string', + 'time' => '\DateTime', + 'timezone' => '\Swagger\Client\Model\InlineResponse200Timezone', + 'authenticated' => 'bool', + 'username' => 'string', + 'cloud_version' => 'string', + 'api_version' => 'string', + 'supported_api_versions' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'address' => null, + 'time' => 'date-time', + 'timezone' => null, + 'authenticated' => null, + 'username' => null, + 'cloud_version' => null, + 'api_version' => null, + 'supported_api_versions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'time' => 'time', + 'timezone' => 'timezone', + 'authenticated' => 'authenticated', + 'username' => 'username', + 'cloud_version' => 'cloudVersion', + 'api_version' => 'apiVersion', + 'supported_api_versions' => 'supportedApiVersions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'time' => 'setTime', + 'timezone' => 'setTimezone', + 'authenticated' => 'setAuthenticated', + 'username' => 'setUsername', + 'cloud_version' => 'setCloudVersion', + 'api_version' => 'setApiVersion', + 'supported_api_versions' => 'setSupportedApiVersions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'time' => 'getTime', + 'timezone' => 'getTimezone', + 'authenticated' => 'getAuthenticated', + 'username' => 'getUsername', + 'cloud_version' => 'getCloudVersion', + 'api_version' => 'getApiVersion', + 'supported_api_versions' => 'getSupportedApiVersions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; + $this->container['authenticated'] = isset($data['authenticated']) ? $data['authenticated'] : null; + $this->container['username'] = isset($data['username']) ? $data['username'] : null; + $this->container['cloud_version'] = isset($data['cloud_version']) ? $data['cloud_version'] : null; + $this->container['api_version'] = isset($data['api_version']) ? $data['api_version'] : null; + $this->container['supported_api_versions'] = isset($data['supported_api_versions']) ? $data['supported_api_versions'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets address + * + * @return string + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string $address SUPLA Server address (to be used in smartphones) + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets time + * + * @return \DateTime + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param \DateTime $time Current server time + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets timezone + * + * @return \Swagger\Client\Model\InlineResponse200Timezone + */ + public function getTimezone() + { + return $this->container['timezone']; + } + + /** + * Sets timezone + * + * @param \Swagger\Client\Model\InlineResponse200Timezone $timezone timezone + * + * @return $this + */ + public function setTimezone($timezone) + { + $this->container['timezone'] = $timezone; + + return $this; + } + + /** + * Gets authenticated + * + * @return bool + */ + public function getAuthenticated() + { + return $this->container['authenticated']; + } + + /** + * Sets authenticated + * + * @param bool $authenticated authenticated + * + * @return $this + */ + public function setAuthenticated($authenticated) + { + $this->container['authenticated'] = $authenticated; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username Present only if `authenticated=true` + * + * @return $this + */ + public function setUsername($username) + { + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets cloud_version + * + * @return string + */ + public function getCloudVersion() + { + return $this->container['cloud_version']; + } + + /** + * Sets cloud_version + * + * @param string $cloud_version cloud_version + * + * @return $this + */ + public function setCloudVersion($cloud_version) + { + $this->container['cloud_version'] = $cloud_version; + + return $this; + } + + /** + * Gets api_version + * + * @return string + */ + public function getApiVersion() + { + return $this->container['api_version']; + } + + /** + * Sets api_version + * + * @param string $api_version api_version + * + * @return $this + */ + public function setApiVersion($api_version) + { + $this->container['api_version'] = $api_version; + + return $this; + } + + /** + * Gets supported_api_versions + * + * @return string[] + */ + public function getSupportedApiVersions() + { + return $this->container['supported_api_versions']; + } + + /** + * Sets supported_api_versions + * + * @param string[] $supported_api_versions supported_api_versions + * + * @return $this + */ + public function setSupportedApiVersions($supported_api_versions) + { + $this->container['supported_api_versions'] = $supported_api_versions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse2001.php b/lib/Model/InlineResponse2001.php new file mode 100644 index 0000000..390e646 --- /dev/null +++ b/lib/Model/InlineResponse2001.php @@ -0,0 +1,300 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse2002.php b/lib/Model/InlineResponse2002.php new file mode 100644 index 0000000..9a51cea --- /dev/null +++ b/lib/Model/InlineResponse2002.php @@ -0,0 +1,420 @@ + 'int', + 'email' => 'string', + 'timezone' => 'string', + 'clients_registration_enabled' => '\DateTime', + 'io_devices_registration_enabled' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'email' => 'email', + 'timezone' => null, + 'clients_registration_enabled' => 'date-time', + 'io_devices_registration_enabled' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'email' => 'email', + 'timezone' => 'timezone', + 'clients_registration_enabled' => 'clientsRegistrationEnabled', + 'io_devices_registration_enabled' => 'ioDevicesRegistrationEnabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'email' => 'setEmail', + 'timezone' => 'setTimezone', + 'clients_registration_enabled' => 'setClientsRegistrationEnabled', + 'io_devices_registration_enabled' => 'setIoDevicesRegistrationEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'email' => 'getEmail', + 'timezone' => 'getTimezone', + 'clients_registration_enabled' => 'getClientsRegistrationEnabled', + 'io_devices_registration_enabled' => 'getIoDevicesRegistrationEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; + $this->container['clients_registration_enabled'] = isset($data['clients_registration_enabled']) ? $data['clients_registration_enabled'] : null; + $this->container['io_devices_registration_enabled'] = isset($data['io_devices_registration_enabled']) ? $data['io_devices_registration_enabled'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets timezone + * + * @return string + */ + public function getTimezone() + { + return $this->container['timezone']; + } + + /** + * Sets timezone + * + * @param string $timezone timezone + * + * @return $this + */ + public function setTimezone($timezone) + { + $this->container['timezone'] = $timezone; + + return $this; + } + + /** + * Gets clients_registration_enabled + * + * @return \DateTime + */ + public function getClientsRegistrationEnabled() + { + return $this->container['clients_registration_enabled']; + } + + /** + * Sets clients_registration_enabled + * + * @param \DateTime $clients_registration_enabled clients_registration_enabled + * + * @return $this + */ + public function setClientsRegistrationEnabled($clients_registration_enabled) + { + $this->container['clients_registration_enabled'] = $clients_registration_enabled; + + return $this; + } + + /** + * Gets io_devices_registration_enabled + * + * @return \DateTime + */ + public function getIoDevicesRegistrationEnabled() + { + return $this->container['io_devices_registration_enabled']; + } + + /** + * Sets io_devices_registration_enabled + * + * @param \DateTime $io_devices_registration_enabled io_devices_registration_enabled + * + * @return $this + */ + public function setIoDevicesRegistrationEnabled($io_devices_registration_enabled) + { + $this->container['io_devices_registration_enabled'] = $io_devices_registration_enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse2003.php b/lib/Model/InlineResponse2003.php new file mode 100644 index 0000000..322c2d9 --- /dev/null +++ b/lib/Model/InlineResponse2003.php @@ -0,0 +1,300 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse2004.php b/lib/Model/InlineResponse2004.php new file mode 100644 index 0000000..7d8df81 --- /dev/null +++ b/lib/Model/InlineResponse2004.php @@ -0,0 +1,360 @@ + 'int', + 'temperature' => 'float', + 'humidity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'date_timestamp' => null, + 'temperature' => 'float', + 'humidity' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date_timestamp' => 'date_timestamp', + 'temperature' => 'temperature', + 'humidity' => 'humidity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date_timestamp' => 'setDateTimestamp', + 'temperature' => 'setTemperature', + 'humidity' => 'setHumidity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date_timestamp' => 'getDateTimestamp', + 'temperature' => 'getTemperature', + 'humidity' => 'getHumidity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['date_timestamp'] = isset($data['date_timestamp']) ? $data['date_timestamp'] : null; + $this->container['temperature'] = isset($data['temperature']) ? $data['temperature'] : null; + $this->container['humidity'] = isset($data['humidity']) ? $data['humidity'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets date_timestamp + * + * @return int + */ + public function getDateTimestamp() + { + return $this->container['date_timestamp']; + } + + /** + * Sets date_timestamp + * + * @param int $date_timestamp date_timestamp + * + * @return $this + */ + public function setDateTimestamp($date_timestamp) + { + $this->container['date_timestamp'] = $date_timestamp; + + return $this; + } + + /** + * Gets temperature + * + * @return float + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float $temperature Temperature in Celsius + * + * @return $this + */ + public function setTemperature($temperature) + { + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets humidity + * + * @return float + */ + public function getHumidity() + { + return $this->container['humidity']; + } + + /** + * Sets humidity + * + * @param float $humidity Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`. + * + * @return $this + */ + public function setHumidity($humidity) + { + $this->container['humidity'] = $humidity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse200Timezone.php b/lib/Model/InlineResponse200Timezone.php new file mode 100644 index 0000000..6d1594b --- /dev/null +++ b/lib/Model/InlineResponse200Timezone.php @@ -0,0 +1,330 @@ + 'string', + 'offset' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'offset' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'offset' => 'offset' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'offset' => 'setOffset' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'offset' => 'getOffset' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['offset'] = isset($data['offset']) ? $data['offset'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets offset + * + * @return int + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int $offset Timezone offset in minutes + * + * @return $this + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse400.php b/lib/Model/InlineResponse400.php new file mode 100644 index 0000000..13c09c2 --- /dev/null +++ b/lib/Model/InlineResponse400.php @@ -0,0 +1,330 @@ + 'int', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status status + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse4001.php b/lib/Model/InlineResponse4001.php new file mode 100644 index 0000000..80ac022 --- /dev/null +++ b/lib/Model/InlineResponse4001.php @@ -0,0 +1,330 @@ + 'int', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status status + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse409.php b/lib/Model/InlineResponse409.php new file mode 100644 index 0000000..2317c2c --- /dev/null +++ b/lib/Model/InlineResponse409.php @@ -0,0 +1,330 @@ + '\Swagger\Client\Model\Schedule[]', + 'groups' => '\Swagger\Client\Model\ChannelGroup[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'schedules' => null, + 'groups' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'schedules' => 'schedules', + 'groups' => 'groups' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'schedules' => 'setSchedules', + 'groups' => 'setGroups' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'schedules' => 'getSchedules', + 'groups' => 'getGroups' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['schedules'] = isset($data['schedules']) ? $data['schedules'] : null; + $this->container['groups'] = isset($data['groups']) ? $data['groups'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets schedules + * + * @return \Swagger\Client\Model\Schedule[] + */ + public function getSchedules() + { + return $this->container['schedules']; + } + + /** + * Sets schedules + * + * @param \Swagger\Client\Model\Schedule[] $schedules Schedules that will be deleted after this request. + * + * @return $this + */ + public function setSchedules($schedules) + { + $this->container['schedules'] = $schedules; + + return $this; + } + + /** + * Gets groups + * + * @return \Swagger\Client\Model\ChannelGroup[] + */ + public function getGroups() + { + return $this->container['groups']; + } + + /** + * Sets groups + * + * @param \Swagger\Client\Model\ChannelGroup[] $groups Channel groups that this channel will be removed from after this request. + * + * @return $this + */ + public function setGroups($groups) + { + $this->container['groups'] = $groups; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/InlineResponse503.php b/lib/Model/InlineResponse503.php new file mode 100644 index 0000000..22092b0 --- /dev/null +++ b/lib/Model/InlineResponse503.php @@ -0,0 +1,300 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/Location.php b/lib/Model/Location.php new file mode 100644 index 0000000..7d30635 --- /dev/null +++ b/lib/Model/Location.php @@ -0,0 +1,630 @@ + 'int', + 'caption' => 'string', + 'enabled' => 'bool', + 'iodevices_ids' => 'int[]', + 'channel_groups_ids' => 'int[]', + 'channels_ids' => 'int[]', + 'access_ids_ids' => 'int[]', + 'password' => 'string', + 'iodevices' => '\Swagger\Client\Model\Device[]', + 'channel_groups' => '\Swagger\Client\Model\ChannelGroup[]', + 'access_ids' => '\Swagger\Client\Model\AccessID[]', + 'channels' => '\Swagger\Client\Model\Channel[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'caption' => null, + 'enabled' => null, + 'iodevices_ids' => null, + 'channel_groups_ids' => null, + 'channels_ids' => null, + 'access_ids_ids' => null, + 'password' => null, + 'iodevices' => null, + 'channel_groups' => null, + 'access_ids' => null, + 'channels' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'caption' => 'caption', + 'enabled' => 'enabled', + 'iodevices_ids' => 'iodevicesIds', + 'channel_groups_ids' => 'channelGroupsIds', + 'channels_ids' => 'channelsIds', + 'access_ids_ids' => 'accessIdsIds', + 'password' => 'password', + 'iodevices' => 'iodevices', + 'channel_groups' => 'channelGroups', + 'access_ids' => 'accessIds', + 'channels' => 'channels' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'caption' => 'setCaption', + 'enabled' => 'setEnabled', + 'iodevices_ids' => 'setIodevicesIds', + 'channel_groups_ids' => 'setChannelGroupsIds', + 'channels_ids' => 'setChannelsIds', + 'access_ids_ids' => 'setAccessIdsIds', + 'password' => 'setPassword', + 'iodevices' => 'setIodevices', + 'channel_groups' => 'setChannelGroups', + 'access_ids' => 'setAccessIds', + 'channels' => 'setChannels' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'caption' => 'getCaption', + 'enabled' => 'getEnabled', + 'iodevices_ids' => 'getIodevicesIds', + 'channel_groups_ids' => 'getChannelGroupsIds', + 'channels_ids' => 'getChannelsIds', + 'access_ids_ids' => 'getAccessIdsIds', + 'password' => 'getPassword', + 'iodevices' => 'getIodevices', + 'channel_groups' => 'getChannelGroups', + 'access_ids' => 'getAccessIds', + 'channels' => 'getChannels' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['iodevices_ids'] = isset($data['iodevices_ids']) ? $data['iodevices_ids'] : null; + $this->container['channel_groups_ids'] = isset($data['channel_groups_ids']) ? $data['channel_groups_ids'] : null; + $this->container['channels_ids'] = isset($data['channels_ids']) ? $data['channels_ids'] : null; + $this->container['access_ids_ids'] = isset($data['access_ids_ids']) ? $data['access_ids_ids'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['iodevices'] = isset($data['iodevices']) ? $data['iodevices'] : null; + $this->container['channel_groups'] = isset($data['channel_groups']) ? $data['channel_groups'] : null; + $this->container['access_ids'] = isset($data['access_ids']) ? $data['access_ids'] : null; + $this->container['channels'] = isset($data['channels']) ? $data['channels'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Location identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption Location caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled `true` if the location is enabled, `false` otherwise + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets iodevices_ids + * + * @return int[] + */ + public function getIodevicesIds() + { + return $this->container['iodevices_ids']; + } + + /** + * Sets iodevices_ids + * + * @param int[] $iodevices_ids array containing the IO Devices identifiers assigned to this location + * + * @return $this + */ + public function setIodevicesIds($iodevices_ids) + { + $this->container['iodevices_ids'] = $iodevices_ids; + + return $this; + } + + /** + * Gets channel_groups_ids + * + * @return int[] + */ + public function getChannelGroupsIds() + { + return $this->container['channel_groups_ids']; + } + + /** + * Sets channel_groups_ids + * + * @param int[] $channel_groups_ids array containing the Channel groups identifiers assigned to this location + * + * @return $this + */ + public function setChannelGroupsIds($channel_groups_ids) + { + $this->container['channel_groups_ids'] = $channel_groups_ids; + + return $this; + } + + /** + * Gets channels_ids + * + * @return int[] + */ + public function getChannelsIds() + { + return $this->container['channels_ids']; + } + + /** + * Sets channels_ids + * + * @param int[] $channels_ids array containing the Channels identifiers expicitely assigned to this location + * + * @return $this + */ + public function setChannelsIds($channels_ids) + { + $this->container['channels_ids'] = $channels_ids; + + return $this; + } + + /** + * Gets access_ids_ids + * + * @return int[] + */ + public function getAccessIdsIds() + { + return $this->container['access_ids_ids']; + } + + /** + * Sets access_ids_ids + * + * @param int[] $access_ids_ids array containing the Access Identifiers identifiers assigned to this location + * + * @return $this + */ + public function setAccessIdsIds($access_ids_ids) + { + $this->container['access_ids_ids'] = $access_ids_ids; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password Location password (plain text). Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets iodevices + * + * @return \Swagger\Client\Model\Device[] + */ + public function getIodevices() + { + return $this->container['iodevices']; + } + + /** + * Sets iodevices + * + * @param \Swagger\Client\Model\Device[] $iodevices Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setIodevices($iodevices) + { + $this->container['iodevices'] = $iodevices; + + return $this; + } + + /** + * Gets channel_groups + * + * @return \Swagger\Client\Model\ChannelGroup[] + */ + public function getChannelGroups() + { + return $this->container['channel_groups']; + } + + /** + * Sets channel_groups + * + * @param \Swagger\Client\Model\ChannelGroup[] $channel_groups Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setChannelGroups($channel_groups) + { + $this->container['channel_groups'] = $channel_groups; + + return $this; + } + + /** + * Gets access_ids + * + * @return \Swagger\Client\Model\AccessID[] + */ + public function getAccessIds() + { + return $this->container['access_ids']; + } + + /** + * Sets access_ids + * + * @param \Swagger\Client\Model\AccessID[] $access_ids Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setAccessIds($access_ids) + { + $this->container['access_ids'] = $access_ids; + + return $this; + } + + /** + * Gets channels + * + * @return \Swagger\Client\Model\Channel[] + */ + public function getChannels() + { + return $this->container['channels']; + } + + /** + * Sets channels + * + * @param \Swagger\Client\Model\Channel[] $channels Returned only if requested by the `include` parameter. + * + * @return $this + */ + public function setChannels($channels) + { + $this->container['channels'] = $channels; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 0000000..1411e27 --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,95 @@ + 'int', + 'time_expression' => 'string', + 'action' => '\Swagger\Client\Model\ChannelFunctionAction', + 'mode' => 'string', + 'date_start' => '\DateTime', + 'date_end' => '\DateTime', + 'enabled' => 'bool', + 'caption' => 'string', + 'retry' => 'bool', + 'channel_id' => 'int', + 'action_id' => 'int', + 'channel' => '\Swagger\Client\Model\Channel', + 'closest_executions' => '\Swagger\Client\Model\ScheduleClosestExecutions[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'time_expression' => null, + 'action' => null, + 'mode' => null, + 'date_start' => 'date-time', + 'date_end' => 'date-time', + 'enabled' => null, + 'caption' => null, + 'retry' => null, + 'channel_id' => null, + 'action_id' => null, + 'channel' => null, + 'closest_executions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'time_expression' => 'timeExpression', + 'action' => 'action', + 'mode' => 'mode', + 'date_start' => 'dateStart', + 'date_end' => 'dateEnd', + 'enabled' => 'enabled', + 'caption' => 'caption', + 'retry' => 'retry', + 'channel_id' => 'channelId', + 'action_id' => 'actionId', + 'channel' => 'channel', + 'closest_executions' => 'closestExecutions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'time_expression' => 'setTimeExpression', + 'action' => 'setAction', + 'mode' => 'setMode', + 'date_start' => 'setDateStart', + 'date_end' => 'setDateEnd', + 'enabled' => 'setEnabled', + 'caption' => 'setCaption', + 'retry' => 'setRetry', + 'channel_id' => 'setChannelId', + 'action_id' => 'setActionId', + 'channel' => 'setChannel', + 'closest_executions' => 'setClosestExecutions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'time_expression' => 'getTimeExpression', + 'action' => 'getAction', + 'mode' => 'getMode', + 'date_start' => 'getDateStart', + 'date_end' => 'getDateEnd', + 'enabled' => 'getEnabled', + 'caption' => 'getCaption', + 'retry' => 'getRetry', + 'channel_id' => 'getChannelId', + 'action_id' => 'getActionId', + 'channel' => 'getChannel', + 'closest_executions' => 'getClosestExecutions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const MODE_MINUTELY = 'minutely'; + const MODE_HOURLY = 'hourly'; + const MODE_DAILY = 'daily'; + const MODE_ONCE = 'once'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getModeAllowableValues() + { + return [ + self::MODE_MINUTELY, + self::MODE_HOURLY, + self::MODE_DAILY, + self::MODE_ONCE, + ]; + } + + + /** + * 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['time_expression'] = isset($data['time_expression']) ? $data['time_expression'] : null; + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; + $this->container['date_start'] = isset($data['date_start']) ? $data['date_start'] : null; + $this->container['date_end'] = isset($data['date_end']) ? $data['date_end'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['retry'] = isset($data['retry']) ? $data['retry'] : null; + $this->container['channel_id'] = isset($data['channel_id']) ? $data['channel_id'] : null; + $this->container['action_id'] = isset($data['action_id']) ? $data['action_id'] : null; + $this->container['channel'] = isset($data['channel']) ? $data['channel'] : null; + $this->container['closest_executions'] = isset($data['closest_executions']) ? $data['closest_executions'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getModeAllowableValues(); + if (!in_array($this->container['mode'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'mode', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getModeAllowableValues(); + if (!in_array($this->container['mode'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Schedule identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets time_expression + * + * @return string + */ + public function getTimeExpression() + { + return $this->container['time_expression']; + } + + /** + * Sets time_expression + * + * @param string $time_expression Schedule time expression in crontab notation (with some custom additions). + * + * @return $this + */ + public function setTimeExpression($time_expression) + { + $this->container['time_expression'] = $time_expression; + + return $this; + } + + /** + * Gets action + * + * @return \Swagger\Client\Model\ChannelFunctionAction + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \Swagger\Client\Model\ChannelFunctionAction $action action + * + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets mode + * + * @return string + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param string $mode mode + * + * @return $this + */ + public function setMode($mode) + { + $allowedValues = $this->getModeAllowableValues(); + if (!is_null($mode) && !in_array($mode, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'mode', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets date_start + * + * @return \DateTime + */ + public function getDateStart() + { + return $this->container['date_start']; + } + + /** + * Sets date_start + * + * @param \DateTime $date_start date_start + * + * @return $this + */ + public function setDateStart($date_start) + { + $this->container['date_start'] = $date_start; + + return $this; + } + + /** + * Gets date_end + * + * @return \DateTime + */ + public function getDateEnd() + { + return $this->container['date_end']; + } + + /** + * Sets date_end + * + * @param \DateTime $date_end date_end + * + * @return $this + */ + public function setDateEnd($date_end) + { + $this->container['date_end'] = $date_end; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets retry + * + * @return bool + */ + public function getRetry() + { + return $this->container['retry']; + } + + /** + * Sets retry + * + * @param bool $retry retry + * + * @return $this + */ + public function setRetry($retry) + { + $this->container['retry'] = $retry; + + return $this; + } + + /** + * Gets channel_id + * + * @return int + */ + public function getChannelId() + { + return $this->container['channel_id']; + } + + /** + * Sets channel_id + * + * @param int $channel_id channel_id + * + * @return $this + */ + public function setChannelId($channel_id) + { + $this->container['channel_id'] = $channel_id; + + return $this; + } + + /** + * Gets action_id + * + * @return int + */ + public function getActionId() + { + return $this->container['action_id']; + } + + /** + * Sets action_id + * + * @param int $action_id action_id + * + * @return $this + */ + public function setActionId($action_id) + { + $this->container['action_id'] = $action_id; + + return $this; + } + + /** + * Gets channel + * + * @return \Swagger\Client\Model\Channel + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param \Swagger\Client\Model\Channel $channel channel + * + * @return $this + */ + public function setChannel($channel) + { + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets closest_executions + * + * @return \Swagger\Client\Model\ScheduleClosestExecutions[] + */ + public function getClosestExecutions() + { + return $this->container['closest_executions']; + } + + /** + * Sets closest_executions + * + * @param \Swagger\Client\Model\ScheduleClosestExecutions[] $closest_executions Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions. + * + * @return $this + */ + public function setClosestExecutions($closest_executions) + { + $this->container['closest_executions'] = $closest_executions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ScheduleClosestExecutions.php b/lib/Model/ScheduleClosestExecutions.php new file mode 100644 index 0000000..05563f1 --- /dev/null +++ b/lib/Model/ScheduleClosestExecutions.php @@ -0,0 +1,330 @@ + '\Swagger\Client\Model\SchedulePast[]', + 'future' => '\Swagger\Client\Model\ScheduleFuture[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'past' => null, + 'future' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'past' => 'past', + 'future' => 'future' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'past' => 'setPast', + 'future' => 'setFuture' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'past' => 'getPast', + 'future' => 'getFuture' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['past'] = isset($data['past']) ? $data['past'] : null; + $this->container['future'] = isset($data['future']) ? $data['future'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets past + * + * @return \Swagger\Client\Model\SchedulePast[] + */ + public function getPast() + { + return $this->container['past']; + } + + /** + * Sets past + * + * @param \Swagger\Client\Model\SchedulePast[] $past past + * + * @return $this + */ + public function setPast($past) + { + $this->container['past'] = $past; + + return $this; + } + + /** + * Gets future + * + * @return \Swagger\Client\Model\ScheduleFuture[] + */ + public function getFuture() + { + return $this->container['future']; + } + + /** + * Sets future + * + * @param \Swagger\Client\Model\ScheduleFuture[] $future future + * + * @return $this + */ + public function setFuture($future) + { + $this->container['future'] = $future; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ScheduleFuture.php b/lib/Model/ScheduleFuture.php new file mode 100644 index 0000000..172cb49 --- /dev/null +++ b/lib/Model/ScheduleFuture.php @@ -0,0 +1,300 @@ + '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'planned_timestamp' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'planned_timestamp' => 'plannedTimestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'planned_timestamp' => 'setPlannedTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'planned_timestamp' => 'getPlannedTimestamp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['planned_timestamp'] = isset($data['planned_timestamp']) ? $data['planned_timestamp'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets planned_timestamp + * + * @return \DateTime + */ + public function getPlannedTimestamp() + { + return $this->container['planned_timestamp']; + } + + /** + * Sets planned_timestamp + * + * @param \DateTime $planned_timestamp planned_timestamp + * + * @return $this + */ + public function setPlannedTimestamp($planned_timestamp) + { + $this->container['planned_timestamp'] = $planned_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/SchedulePast.php b/lib/Model/SchedulePast.php new file mode 100644 index 0000000..e11afe7 --- /dev/null +++ b/lib/Model/SchedulePast.php @@ -0,0 +1,390 @@ + '\DateTime', + 'result_timestamp' => '\DateTime', + 'failed' => 'bool', + 'result' => '\Swagger\Client\Model\ScheduleResult' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'planned_timestamp' => 'date-time', + 'result_timestamp' => 'date-time', + 'failed' => null, + 'result' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'planned_timestamp' => 'plannedTimestamp', + 'result_timestamp' => 'resultTimestamp', + 'failed' => 'failed', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'planned_timestamp' => 'setPlannedTimestamp', + 'result_timestamp' => 'setResultTimestamp', + 'failed' => 'setFailed', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'planned_timestamp' => 'getPlannedTimestamp', + 'result_timestamp' => 'getResultTimestamp', + 'failed' => 'getFailed', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['planned_timestamp'] = isset($data['planned_timestamp']) ? $data['planned_timestamp'] : null; + $this->container['result_timestamp'] = isset($data['result_timestamp']) ? $data['result_timestamp'] : null; + $this->container['failed'] = isset($data['failed']) ? $data['failed'] : null; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets planned_timestamp + * + * @return \DateTime + */ + public function getPlannedTimestamp() + { + return $this->container['planned_timestamp']; + } + + /** + * Sets planned_timestamp + * + * @param \DateTime $planned_timestamp planned_timestamp + * + * @return $this + */ + public function setPlannedTimestamp($planned_timestamp) + { + $this->container['planned_timestamp'] = $planned_timestamp; + + return $this; + } + + /** + * Gets result_timestamp + * + * @return \DateTime + */ + public function getResultTimestamp() + { + return $this->container['result_timestamp']; + } + + /** + * Sets result_timestamp + * + * @param \DateTime $result_timestamp result_timestamp + * + * @return $this + */ + public function setResultTimestamp($result_timestamp) + { + $this->container['result_timestamp'] = $result_timestamp; + + return $this; + } + + /** + * Gets failed + * + * @return bool + */ + public function getFailed() + { + return $this->container['failed']; + } + + /** + * Sets failed + * + * @param bool $failed failed + * + * @return $this + */ + public function setFailed($failed) + { + $this->container['failed'] = $failed; + + return $this; + } + + /** + * Gets result + * + * @return \Swagger\Client\Model\ScheduleResult + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \Swagger\Client\Model\ScheduleResult $result result + * + * @return $this + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ScheduleRequest.php b/lib/Model/ScheduleRequest.php new file mode 100644 index 0000000..1d24e93 --- /dev/null +++ b/lib/Model/ScheduleRequest.php @@ -0,0 +1,550 @@ + 'int', + 'action_id' => 'int', + 'mode' => 'string', + 'time_expression' => 'string', + 'date_start' => '\DateTime', + 'date_end' => '\DateTime', + 'caption' => 'string', + 'retry' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'channel_id' => null, + 'action_id' => null, + 'mode' => null, + 'time_expression' => null, + 'date_start' => 'date-time', + 'date_end' => 'date-time', + 'caption' => null, + 'retry' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'channel_id' => 'channelId', + 'action_id' => 'actionId', + 'mode' => 'mode', + 'time_expression' => 'timeExpression', + 'date_start' => 'dateStart', + 'date_end' => 'dateEnd', + 'caption' => 'caption', + 'retry' => 'retry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'channel_id' => 'setChannelId', + 'action_id' => 'setActionId', + 'mode' => 'setMode', + 'time_expression' => 'setTimeExpression', + 'date_start' => 'setDateStart', + 'date_end' => 'setDateEnd', + 'caption' => 'setCaption', + 'retry' => 'setRetry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'channel_id' => 'getChannelId', + 'action_id' => 'getActionId', + 'mode' => 'getMode', + 'time_expression' => 'getTimeExpression', + 'date_start' => 'getDateStart', + 'date_end' => 'getDateEnd', + 'caption' => 'getCaption', + 'retry' => 'getRetry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const MODE_ONCE = 'once'; + const MODE_MINUTELY = 'minutely'; + const MODE_DAILY = 'daily'; + const MODE_HOURLY = 'hourly'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getModeAllowableValues() + { + return [ + self::MODE_ONCE, + self::MODE_MINUTELY, + self::MODE_DAILY, + self::MODE_HOURLY, + ]; + } + + + /** + * 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['channel_id'] = isset($data['channel_id']) ? $data['channel_id'] : null; + $this->container['action_id'] = isset($data['action_id']) ? $data['action_id'] : null; + $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; + $this->container['time_expression'] = isset($data['time_expression']) ? $data['time_expression'] : null; + $this->container['date_start'] = isset($data['date_start']) ? $data['date_start'] : null; + $this->container['date_end'] = isset($data['date_end']) ? $data['date_end'] : null; + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + $this->container['retry'] = isset($data['retry']) ? $data['retry'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getModeAllowableValues(); + if (!in_array($this->container['mode'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'mode', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getModeAllowableValues(); + if (!in_array($this->container['mode'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets channel_id + * + * @return int + */ + public function getChannelId() + { + return $this->container['channel_id']; + } + + /** + * Sets channel_id + * + * @param int $channel_id channel_id + * + * @return $this + */ + public function setChannelId($channel_id) + { + $this->container['channel_id'] = $channel_id; + + return $this; + } + + /** + * Gets action_id + * + * @return int + */ + public function getActionId() + { + return $this->container['action_id']; + } + + /** + * Sets action_id + * + * @param int $action_id action_id + * + * @return $this + */ + public function setActionId($action_id) + { + $this->container['action_id'] = $action_id; + + return $this; + } + + /** + * Gets mode + * + * @return string + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param string $mode mode + * + * @return $this + */ + public function setMode($mode) + { + $allowedValues = $this->getModeAllowableValues(); + if (!is_null($mode) && !in_array($mode, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'mode', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets time_expression + * + * @return string + */ + public function getTimeExpression() + { + return $this->container['time_expression']; + } + + /** + * Sets time_expression + * + * @param string $time_expression Schedule time expression in crontab notation (with some custom additions). + * + * @return $this + */ + public function setTimeExpression($time_expression) + { + $this->container['time_expression'] = $time_expression; + + return $this; + } + + /** + * Gets date_start + * + * @return \DateTime + */ + public function getDateStart() + { + return $this->container['date_start']; + } + + /** + * Sets date_start + * + * @param \DateTime $date_start date_start + * + * @return $this + */ + public function setDateStart($date_start) + { + $this->container['date_start'] = $date_start; + + return $this; + } + + /** + * Gets date_end + * + * @return \DateTime + */ + public function getDateEnd() + { + return $this->container['date_end']; + } + + /** + * Sets date_end + * + * @param \DateTime $date_end date_end + * + * @return $this + */ + public function setDateEnd($date_end) + { + $this->container['date_end'] = $date_end; + + return $this; + } + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + + /** + * Gets retry + * + * @return bool + */ + public function getRetry() + { + return $this->container['retry']; + } + + /** + * Sets retry + * + * @param bool $retry retry + * + * @return $this + */ + public function setRetry($retry) + { + $this->container['retry'] = $retry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/Model/ScheduleResult.php b/lib/Model/ScheduleResult.php new file mode 100644 index 0000000..41129d9 --- /dev/null +++ b/lib/Model/ScheduleResult.php @@ -0,0 +1,300 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'caption' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'caption' => 'caption' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'caption' => 'setCaption' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'caption' => 'getCaption' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets caption + * + * @return string + */ + public function getCaption() + { + return $this->container['caption']; + } + + /** + * Sets caption + * + * @param string $caption caption + * + * @return $this + */ + public function setCaption($caption) + { + $this->container['caption'] = $caption; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php new file mode 100644 index 0000000..2514bc4 --- /dev/null +++ b/lib/ObjectSerializer.php @@ -0,0 +1,318 @@ +format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } elseif (is_object($data)) { + $values = []; + $formats = $data::swaggerFormats(); + foreach ($data::swaggerTypes() as $property => $swaggerType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null + && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(\DateTime::ATOM); + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $collectionFormat the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($collectionFormat) { + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'ssv': + return implode(' ', $collection); + + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null an single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + return new \DateTime($data); + } else { + return null; + } + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } elseif ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Swagger\Client\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/SuplaApi.php b/src/SuplaApi.php new file mode 100644 index 0000000..2645b75 --- /dev/null +++ b/src/SuplaApi.php @@ -0,0 +1,43 @@ +server = $server; + if (strpos($this->server, 'http') !== 0) { + $this->server = 'https://' . $server; + } + $this->tokenRequestData = [ + "client_id" => $clientId, + "client_secret" => $secret, + "grant_type" => 'password', + "username" => $username, + "password" => $password, + ]; + $this->httpClient = new Client(); + } + + private function retrieveToken() { + if ($this->token) { + return $this->token; + } + $response = $this->httpClient->post($this->server . '/oauth/v2/token', [\GuzzleHttp\RequestOptions::JSON => $this->tokenRequestData]); + $response = json_decode($response->getBody(), true); + return $this->token = $response['access_token']; + } + + /** @return UsersApi */ + public function users() { + return new UsersApi($this->httpClient, new SuplaApiConfiguration($this->server, $this->retrieveToken())); + } +} diff --git a/src/SuplaApiConfiguration.php b/src/SuplaApiConfiguration.php new file mode 100644 index 0000000..9964824 --- /dev/null +++ b/src/SuplaApiConfiguration.php @@ -0,0 +1,29 @@ +host = $server . '/api'; + $this->accessToken = $token; + } +} diff --git a/src/demo.php b/src/demo.php new file mode 100644 index 0000000..15716e8 --- /dev/null +++ b/src/demo.php @@ -0,0 +1,45 @@ +setApiKey('Authorization', 'YOUR_API_KEY'); +//// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); +//// Configure OAuth2 access token for authorization: password +//$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); +// +//$apiInstance = new Swagger\Client\Api\ChannelsApi( +//// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. +//// This is optional, `GuzzleHttp\Client` will be used as default. +// new GuzzleHttp\Client(), +// $config +//); +//$x_accept_version = "x_accept_version_example"; // string | API Version +//$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +//$function = array("function_example"); // string[] | +//$io = "io_example"; // string | Return only `input` or `output` channels. +//$has_function = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. +// +//try { +// $result = $apiInstance->getChannels($x_accept_version, $include, $function, $io, $has_function); +// foreach ($result as $channel) { +// $channel->getIodevice()-> +// } +// print_r($result); +//} catch (Exception $e) { +// echo 'Exception when calling ChannelsApi->getChannels: ', $e->getMessage(), PHP_EOL; +//} + + +$api = new \SuplaApi\Client\SuplaApi( + 'http://supla.local', + '1_6cabrio4xdcsw8sk4socc04k00os4ssw88wc0kkws0g4ogkwgg', + '54etn7d5ops0cooww80s0c8o88ssgkgsw4c4o8ks4wswgc0ww4', + 'api_1', + 'pass' +); + +$user = $api->users()->getCurrentUser(); +echo $user->getEmail(); +$api->users()->editCurrentUser(new \Swagger\Client\Model\Body(['action' => \Swagger\Client\Model\Body::ACTION_CHANGEPASSWORD])); + From 89c27a0d7e8c7b3653e6475044522f5663e5adbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Tue, 1 May 2018 12:48:01 +0200 Subject: [PATCH 02/13] PHPCBF --- src/SuplaApi.php | 5 ++++- src/SuplaApiConfiguration.php | 1 - src/demo.php | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SuplaApi.php b/src/SuplaApi.php index 2645b75..5a7940c 100644 --- a/src/SuplaApi.php +++ b/src/SuplaApi.php @@ -31,7 +31,10 @@ private function retrieveToken() { if ($this->token) { return $this->token; } - $response = $this->httpClient->post($this->server . '/oauth/v2/token', [\GuzzleHttp\RequestOptions::JSON => $this->tokenRequestData]); + $response = $this->httpClient->post( + $this->server . '/oauth/v2/token', + [\GuzzleHttp\RequestOptions::JSON => $this->tokenRequestData] + ); $response = json_decode($response->getBody(), true); return $this->token = $response['access_token']; } diff --git a/src/SuplaApiConfiguration.php b/src/SuplaApiConfiguration.php index 9964824..4c76a24 100644 --- a/src/SuplaApiConfiguration.php +++ b/src/SuplaApiConfiguration.php @@ -17,7 +17,6 @@ namespace SuplaApi\Client; - use Swagger\Client\Configuration; class SuplaApiConfiguration extends Configuration { diff --git a/src/demo.php b/src/demo.php index 15716e8..eaa88fd 100644 --- a/src/demo.php +++ b/src/demo.php @@ -42,4 +42,3 @@ $user = $api->users()->getCurrentUser(); echo $user->getEmail(); $api->users()->editCurrentUser(new \Swagger\Client\Model\Body(['action' => \Swagger\Client\Model\Body::ACTION_CHANGEPASSWORD])); - From be1c6f7078e8443c2f129e318d8455237c557cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 11:59:20 +0200 Subject: [PATCH 03/13] Default Swagger PHP Codegen template --- codegen-template/.php_cs | 18 + codegen-template/.travis.yml | 10 + codegen-template/ApiException.mustache | 111 +++++ codegen-template/Configuration.mustache | 422 +++++++++++++++++ codegen-template/HeaderSelector.mustache | 100 ++++ codegen-template/ModelInterface.mustache | 86 ++++ codegen-template/ObjectSerializer.mustache | 307 ++++++++++++ codegen-template/README.mustache | 141 ++++++ codegen-template/api.mustache | 516 +++++++++++++++++++++ codegen-template/api_doc.mustache | 79 ++++ codegen-template/api_test.mustache | 76 +++ codegen-template/composer.mustache | 39 ++ codegen-template/git_push.sh.mustache | 52 +++ codegen-template/model.mustache | 43 ++ codegen-template/model_doc.mustache | 11 + codegen-template/model_enum.mustache | 19 + codegen-template/model_generic.mustache | 418 +++++++++++++++++ codegen-template/model_test.mustache | 81 ++++ codegen-template/partial_header.mustache | 14 + codegen-template/phpunit.xml.mustache | 21 + 20 files changed, 2564 insertions(+) create mode 100644 codegen-template/.php_cs create mode 100644 codegen-template/.travis.yml create mode 100644 codegen-template/ApiException.mustache create mode 100644 codegen-template/Configuration.mustache create mode 100644 codegen-template/HeaderSelector.mustache create mode 100644 codegen-template/ModelInterface.mustache create mode 100644 codegen-template/ObjectSerializer.mustache create mode 100644 codegen-template/README.mustache create mode 100644 codegen-template/api.mustache create mode 100644 codegen-template/api_doc.mustache create mode 100644 codegen-template/api_test.mustache create mode 100644 codegen-template/composer.mustache create mode 100644 codegen-template/git_push.sh.mustache create mode 100644 codegen-template/model.mustache create mode 100644 codegen-template/model_doc.mustache create mode 100644 codegen-template/model_enum.mustache create mode 100644 codegen-template/model_generic.mustache create mode 100644 codegen-template/model_test.mustache create mode 100644 codegen-template/partial_header.mustache create mode 100644 codegen-template/phpunit.xml.mustache diff --git a/codegen-template/.php_cs b/codegen-template/.php_cs new file mode 100644 index 0000000..6b8e23c --- /dev/null +++ b/codegen-template/.php_cs @@ -0,0 +1,18 @@ +level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->setUsingCache(true) + ->fixers( + [ + 'ordered_use', + 'phpdoc_order', + 'short_array_syntax', + 'strict', + 'strict_param' + ] + ) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->in(__DIR__) + ); diff --git a/codegen-template/.travis.yml b/codegen-template/.travis.yml new file mode 100644 index 0000000..d77f382 --- /dev/null +++ b/codegen-template/.travis.yml @@ -0,0 +1,10 @@ +language: php +sudo: false +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/codegen-template/ApiException.mustache b/codegen-template/ApiException.mustache new file mode 100644 index 0000000..e8115d2 --- /dev/null +++ b/codegen-template/ApiException.mustache @@ -0,0 +1,111 @@ +partial_header}} +/** + * 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 {{invokerPackage}}; + +use \Exception; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ApiException extends Exception +{ + + /** + * The HTTP body of the server response either as Json or string. + * + * @var mixed + */ + protected $responseBody; + + /** + * The HTTP header of the server response. + * + * @var string[]|null + */ + protected $responseHeaders; + + /** + * The deserialized response object + * + * @var $responseObject; + */ + protected $responseObject; + + /** + * Constructor + * + * @param string $message Error message + * @param int $code HTTP status code + * @param string[]|null $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string + */ + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + { + parent::__construct($message, $code); + $this->responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return mixed HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deseralized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/codegen-template/Configuration.mustache b/codegen-template/Configuration.mustache new file mode 100644 index 0000000..cdbba93 --- /dev/null +++ b/codegen-template/Configuration.mustache @@ -0,0 +1,422 @@ +partial_header}} +/** + * 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 {{invokerPackage}}; + +/** + * Configuration Class Doc Comment + * PHP version 5 + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Configuration +{ + private static $defaultConfiguration; + + /** + * Associate array to store API key(s) + * + * @var string[] + */ + protected $apiKeys = []; + + /** + * Associate array to store API prefix (e.g. Bearer) + * + * @var string[] + */ + protected $apiKeyPrefixes = []; + + /** + * Access token for OAuth + * + * @var string + */ + protected $accessToken = ''; + + /** + * Username for HTTP basic authentication + * + * @var string + */ + protected $username = ''; + + /** + * Password for HTTP basic authentication + * + * @var string + */ + protected $password = ''; + + /** + * The host + * + * @var string + */ + protected $host = '{{basePath}}'; + + /** + * User agent of the HTTP request, set to "PHP-Swagger" by default + * + * @var string + */ + protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; + + /** + * Debug switch (default set to false) + * + * @var bool + */ + protected $debug = false; + + /** + * Debug file location (log to STDOUT by default) + * + * @var string + */ + protected $debugFile = 'php://output'; + + /** + * Debug file location (log to STDOUT by default) + * + * @var string + */ + protected $tempFolderPath; + + /** + * Constructor + */ + public function __construct() + { + $this->tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the detault configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' OpenAPI Spec Version: {{version}}' . PHP_EOL; + {{#artifactVersion}} + $report .= ' SDK Package Version: {{artifactVersion}}' . PHP_EOL; + {{/artifactVersion}} + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } +} diff --git a/codegen-template/HeaderSelector.mustache b/codegen-template/HeaderSelector.mustache new file mode 100644 index 0000000..909beb1 --- /dev/null +++ b/codegen-template/HeaderSelector.mustache @@ -0,0 +1,100 @@ +partial_header}} +/** + * 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 {{invokerPackage}}; + +use \Exception; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class HeaderSelector +{ + + /** + * @param string[] $accept + * @param string[] $contentTypes + * @return array + */ + public function selectHeaders($accept, $contentTypes) + { + $headers = []; + + $accept = $this->selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} + diff --git a/codegen-template/ModelInterface.mustache b/codegen-template/ModelInterface.mustache new file mode 100644 index 0000000..538bf66 --- /dev/null +++ b/codegen-template/ModelInterface.mustache @@ -0,0 +1,86 @@ +partial_header}} +/** + * 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 {{modelPackage}}; + +/** + * Interface abstracting model access. + * + * @package {{modelPackage}} + * @author Swagger Codegen team + */ +interface ModelInterface +{ + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(); + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes(); + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats(); + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @return array + */ + public static function attributeMap(); + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(); + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(); + + /** + * Show all the invalid properties with reasons. + * + * @return array + */ + public function listInvalidProperties(); + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(); +} diff --git a/codegen-template/ObjectSerializer.mustache b/codegen-template/ObjectSerializer.mustache new file mode 100644 index 0000000..460b69b --- /dev/null +++ b/codegen-template/ObjectSerializer.mustache @@ -0,0 +1,307 @@ +partial_header}} +/** + * 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 {{invokerPackage}}; + +/** + * ObjectSerializer Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ObjectSerializer +{ + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the SwaggerType of the data + * @param string $format the format of the Swagger type of the data + * + * @return string|object serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } elseif ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } elseif (is_object($data)) { + $values = []; + $formats = $data::swaggerFormats(); + foreach ($data::swaggerTypes() as $property => $swaggerType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null + && !in_array($swaggerType, [{{&primitives}}], true) + && method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(\DateTime::ATOM); + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $collectionFormat the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($collectionFormat) { + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'ssv': + return implode(' ', $collection); + + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null an single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + return new \DateTime($data); + } else { + return null; + } + } elseif (in_array($class, [{{&primitives}}], true)) { + settype($data, $class); + return $data; + } elseif ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\{{invokerPackage}}\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/codegen-template/README.mustache b/codegen-template/README.mustache new file mode 100644 index 0000000..e17247e --- /dev/null +++ b/codegen-template/README.mustache @@ -0,0 +1,141 @@ +# {{packagePath}} +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: {{appVersion}} +{{#artifactVersion}} +- Package version: {{artifactVersion}} +{{/artifactVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements + +PHP 5.5 and later + +## Installation & Usage +### Composer + +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: + +``` +{ + "repositories": [ + { + "type": "git", + "url": "https://github.com/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git" + } + ], + "require": { + "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + require_once('/path/to/{{packagePath}}/vendor/autoload.php'); +``` + +## Tests + +To run the unit tests: + +``` +composer install +./vendor/bin/phpunit +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}} +// Configure API key authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}} +// Configure OAuth2 access token for authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} +{{/hasAuthMethods}} + +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +?> +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}} All endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}}## {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} + diff --git a/codegen-template/api.mustache b/codegen-template/api.mustache new file mode 100644 index 0000000..cf5064c --- /dev/null +++ b/codegen-template/api.mustache @@ -0,0 +1,516 @@ +partial_header}} +/** + * 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 {{apiPackage}}; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use {{invokerPackage}}\ApiException; +use {{invokerPackage}}\Configuration; +use {{invokerPackage}}\HeaderSelector; +use {{invokerPackage}}\ObjectSerializer; + +/** + * {{classname}} Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +{{#operations}}class {{classname}} +{ + /** + * @var ClientInterface + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + +{{#operation}} + /** + * Operation {{{operationId}}} +{{#summary}} + * + * {{{summary}}} +{{/summary}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#allParams}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + return $response;{{/returnType}} + } + + /** + * Operation {{{operationId}}}WithHttpInfo +{{#summary}} + * + * {{{summary}}} +{{/summary}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#allParams}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) + */ + public function {{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + $returnType = '{{returnType}}'; + $request = $this->{{operationId}}Request({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + {{#returnType}} + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + return [null, $statusCode, $response->getHeaders()]; + {{/returnType}} + + } catch (ApiException $e) { + switch ($e->getCode()) { + {{#responses}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '{{dataType}}', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + {{/dataType}} + {{/responses}} + } + throw $e; + } + } + + /** + * Operation {{{operationId}}}Async + * + * {{{summary}}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#allParams}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function {{operationId}}Async({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + return $this->{{operationId}}AsyncWithHttpInfo({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation {{{operationId}}}AsyncWithHttpInfo + * + * {{{summary}}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#allParams}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function {{operationId}}AsyncWithHttpInfo({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + $returnType = '{{returnType}}'; + $request = $this->{{operationId}}Request({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + {{#returnType}} + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + return [null, $response->getStatusCode(), $response->getHeaders()]; + {{/returnType}} + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation '{{{operationId}}}' + * +{{#allParams}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function {{operationId}}Request({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter ${{paramName}} when calling {{operationId}}' + ); + } + {{/required}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}${{paramName}} !== null && {{/required}}strlen(${{paramName}}) > {{maxLength}}) { + throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + } + {{/maxLength}} + {{#minLength}} + if ({{^required}}${{paramName}} !== null && {{/required}}strlen(${{paramName}}) < {{minLength}}) { + throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if ({{^required}}${{paramName}} !== null && {{/required}}${{paramName}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if ({{^required}}${{paramName}} !== null && {{/required}}${{paramName}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if ({{^required}}${{paramName}} !== null && {{/required}}!preg_match("{{{pattern}}}", ${{paramName}})) { + throw new \InvalidArgumentException("invalid value for \"{{paramName}}\" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); + } + {{/pattern}} + {{#maxItems}} + if ({{^required}}${{paramName}} !== null && {{/required}}count(${{paramName}}) > {{maxItems}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + } + {{/maxItems}} + {{#minItems}} + if ({{^required}}${{paramName}} !== null && {{/required}}count(${{paramName}}) < {{minItems}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + + {{/hasValidation}} + {{/allParams}} + + $resourcePath = '{{{path}}}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + {{#queryParams}} + // query params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}', true); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $queryParams['{{baseName}}'] = ObjectSerializer::toQueryValue(${{paramName}}); + } + {{/queryParams}} + {{#headerParams}} + // header params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}'); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}}); + } + {{/headerParams}} + + {{#pathParams}} + // path params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}'); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $resourcePath = str_replace( + '{' . '{{baseName}}' . '}', + ObjectSerializer::toPathValue(${{paramName}}), + $resourcePath + ); + } + {{/pathParams}} + + {{#formParams}} + // form params + if (${{paramName}} !== null) { + {{#isFile}} + $multipart = true; + $formParams['{{baseName}}'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue(${{paramName}}), 'rb'); + {{/isFile}} + {{^isFile}} + $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); + {{/isFile}} + } + {{/formParams}} + // body params + $_tempBody = null; + {{#bodyParams}} + if (isset(${{paramName}})) { + $_tempBody = ${{paramName}}; + } + {{/bodyParams}} + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}], + [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + {{#authMethods}} + {{#isApiKey}} + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('{{keyParamName}}'); + if ($apiKey !== null) { + {{#isKeyInHeader}}$headers['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}} + } + {{/isApiKey}} + {{#isBasic}} + // this endpoint requires HTTP basic authentication + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + {{/isBasic}} + {{#isOAuth}} + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + {{/isOAuth}} + {{/authMethods}} + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + '{{httpMethod}}', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + {{/operation}} + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} +{{/operations}} diff --git a/codegen-template/api_doc.mustache b/codegen-template/api_doc.mustache new file mode 100644 index 0000000..4118b83 --- /dev/null +++ b/codegen-template/api_doc.mustache @@ -0,0 +1,79 @@ +# {{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 +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +{{/isBasic}}{{#isApiKey}} +// Configure API key authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}} +// Configure OAuth2 access token for authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} +{{/hasAuthMethods}} + +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### 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}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{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 request 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}} diff --git a/codegen-template/api_test.mustache b/codegen-template/api_test.mustache new file mode 100644 index 0000000..af93752 --- /dev/null +++ b/codegen-template/api_test.mustache @@ -0,0 +1,76 @@ +partial_header}} +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Please update the test case below to test the endpoint. + */ + +namespace {{invokerPackage}}; + +use \{{invokerPackage}}\Configuration; +use \{{invokerPackage}}\ApiException; +use \{{invokerPackage}}\ObjectSerializer; + +/** + * {{classname}}Test Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +{{#operations}}class {{classname}}Test extends \PHPUnit_Framework_TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass() + { + } + + /** + * Setup before running each test case + */ + public function setUp() + { + } + + /** + * Clean up after running each test case + */ + public function tearDown() + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass() + { + } + {{#operation}} + + /** + * Test case for {{{operationId}}} + * + * {{{summary}}}. + * + */ + public function test{{vendorExtensions.x-testOperationId}}() + { + } + {{/operation}} +} +{{/operations}} diff --git a/codegen-template/composer.mustache b/codegen-template/composer.mustache new file mode 100644 index 0000000..0a7732f --- /dev/null +++ b/codegen-template/composer.mustache @@ -0,0 +1,39 @@ +{ + "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}", + {{#artifactVersion}} + "version": "{{artifactVersion}}", + {{/artifactVersion}} + "description": "{{description}}", + "keywords": [ + "swagger", + "php", + "sdk", + "api" + ], + "homepage": "http://swagger.io", + "license": "proprietary", + "authors": [ + { + "name": "Swagger and contributors", + "homepage": "https://github.com/swagger-api/swagger-codegen" + } + ], + "require": { + "php": ">=5.5", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^6.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "squizlabs/php_codesniffer": "~2.6", + "friendsofphp/php-cs-fixer": "~1.12" + }, + "autoload": { + "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } + }, + "autoload-dev": { + "psr-4": { "{{escapedInvokerPackage}}\\" : "{{testBasePath}}/" } + } +} diff --git a/codegen-template/git_push.sh.mustache b/codegen-template/git_push.sh.mustache new file mode 100644 index 0000000..f65b794 --- /dev/null +++ b/codegen-template/git_push.sh.mustache @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/codegen-template/model.mustache b/codegen-template/model.mustache new file mode 100644 index 0000000..9382cfa --- /dev/null +++ b/codegen-template/model.mustache @@ -0,0 +1,43 @@ +partial_header}} +/** + * 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 {{modelPackage}}; +{{^isEnum}} +{{^parentSchema}} + +use \ArrayAccess; +{{/parentSchema}} +{{/isEnum}} +use \{{invokerPackage}}\ObjectSerializer; + +/** + * {{classname}} Class Doc Comment + * + * @category Class +{{#description}} + * @description {{description}} +{{/description}} + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +{{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/codegen-template/model_doc.mustache b/codegen-template/model_doc.mustache new file mode 100644 index 0000000..569550d --- /dev/null +++ b/codegen-template/model_doc.mustache @@ -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}} diff --git a/codegen-template/model_enum.mustache b/codegen-template/model_enum.mustache new file mode 100644 index 0000000..5e6b2ae --- /dev/null +++ b/codegen-template/model_enum.mustache @@ -0,0 +1,19 @@ +class {{classname}} +{ + /** + * Possible values of this enum + */ + {{#allowableValues}}{{#enumVars}}const {{{name}}} = {{{value}}}; + {{/enumVars}}{{/allowableValues}} + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + {{#allowableValues}}{{#enumVars}}self::{{{name}}},{{^-last}} + {{/-last}}{{/enumVars}}{{/allowableValues}} + ]; + } +} diff --git a/codegen-template/model_generic.mustache b/codegen-template/model_generic.mustache new file mode 100644 index 0000000..c2952c5 --- /dev/null +++ b/codegen-template/model_generic.mustache @@ -0,0 +1,418 @@ +class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^parentSchema}}implements ModelInterface, ArrayAccess{{/parentSchema}} +{ + const DISCRIMINATOR = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = '{{name}}'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + {{#vars}}'{{name}}' => {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{#hasMore}}, + {{/hasMore}}{{/vars}} + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes{{#parentSchema}} + parent::swaggerTypes(){{/parentSchema}}; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats{{#parentSchema}} + parent::swaggerFormats(){{/parentSchema}}; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + {{#vars}}'{{name}}' => '{{setter}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + {{#vars}}'{{name}}' => '{{getter}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return {{#parentSchema}}parent::attributeMap() + {{/parentSchema}}self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return {{#parentSchema}}parent::setters() + {{/parentSchema}}self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return {{#parentSchema}}parent::getters() + {{/parentSchema}}self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + {{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{enumName}}_{{{name}}} = {{{value}}}; + {{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}} + + {{#vars}}{{#isEnum}} + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function {{getter}}AllowableValues() + { + return [ + {{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^-last}} + {{/-last}}{{/enumVars}}{{/allowableValues}} + ]; + } + {{/isEnum}}{{/vars}} + + {{^parentSchema}} + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + {{/parentSchema}} + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + {{#parentSchema}} + parent::__construct($data); + + {{/parentSchema}} + {{#vars}} + $this->container['{{name}}'] = isset($data['{{name}}']) ? $data['{{name}}'] : {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}; + {{/vars}} + {{#discriminator}} + + // Initialize discriminator property with the model name. + $discriminator = array_search('{{discriminator}}', self::$attributeMap); + $this->container[$discriminator] = static::$swaggerModelName; + {{/discriminator}} + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + {{#parent}} + $invalidProperties = parent::listInvalidProperties(); + {{/parent}} + {{^parent}} + $invalidProperties = []; + {{/parent}} + + {{#vars}} + {{#required}} + if ($this->container['{{name}}'] === null) { + $invalidProperties[] = "'{{name}}' can't be null"; + } + {{/required}} + {{#isEnum}} + {{^isContainer}} + $allowedValues = $this->{{getter}}AllowableValues(); + if (!is_null($this->container['{{name}}']) && !in_array($this->container['{{name}}'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for '{{name}}', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + {{/isContainer}} + {{/isEnum}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(mb_strlen($this->container['{{name}}']) > {{maxLength}})) { + $invalidProperties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}."; + } + + {{/maxLength}} + {{#minLength}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(mb_strlen($this->container['{{name}}']) < {{minLength}})) { + $invalidProperties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}."; + } + + {{/minLength}} + {{#maximum}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { + $invalidProperties[] = "invalid value for '{{name}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}."; + } + + {{/maximum}} + {{#minimum}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { + $invalidProperties[] = "invalid value for '{{name}}', must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}."; + } + + {{/minimum}} + {{#pattern}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}!preg_match("{{{pattern}}}", $this->container['{{name}}'])) { + $invalidProperties[] = "invalid value for '{{name}}', must be conform to the pattern {{{pattern}}}."; + } + + {{/pattern}} + {{#maxItems}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) > {{maxItems}})) { + $invalidProperties[] = "invalid value for '{{name}}', number of items must be less than or equal to {{{maxItems}}}."; + } + + {{/maxItems}} + {{#minItems}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) < {{minItems}})) { + $invalidProperties[] = "invalid value for '{{name}}', number of items must be greater than or equal to {{{minItems}}}."; + } + + {{/minItems}} + {{/hasValidation}} + {{/vars}} + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + {{#vars}} + + /** + * Gets {{name}} + * + * @return {{datatype}} + */ + public function {{getter}}() + { + return $this->container['{{name}}']; + } + + /** + * Sets {{name}} + * + * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}} + * + * @return $this + */ + public function {{setter}}(${{name}}) + { + {{#isEnum}} + $allowedValues = $this->{{getter}}AllowableValues(); + {{^isContainer}} + if ({{^required}}!is_null(${{name}}) && {{/required}}!in_array(${{{name}}}, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for '{{name}}', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + {{/isContainer}} + {{#isContainer}} + if ({{^required}}!is_null(${{name}}) && {{/required}}array_diff(${{{name}}}, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for '{{name}}', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + {{/isContainer}} + {{/isEnum}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(mb_strlen(${{name}}) > {{maxLength}})) { + throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + }{{/maxLength}} + {{#minLength}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(mb_strlen(${{name}}) < {{minLength}})) { + throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { + throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { + throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(!preg_match("{{{pattern}}}", ${{name}}))) { + throw new \InvalidArgumentException("invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); + } + {{/pattern}} + {{#maxItems}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) > {{maxItems}})) { + throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + }{{/maxItems}} + {{#minItems}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) < {{minItems}})) { + throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + {{/hasValidation}} + $this->container['{{name}}'] = ${{name}}; + + return $this; + } + {{/vars}} + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/codegen-template/model_test.mustache b/codegen-template/model_test.mustache new file mode 100644 index 0000000..9906430 --- /dev/null +++ b/codegen-template/model_test.mustache @@ -0,0 +1,81 @@ +partial_header}} +/** + * 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 {{invokerPackage}}; + +/** + * {{classname}}Test Class Doc Comment + * + * @category Class + * @description {{#description}}{{description}}{{/description}}{{^description}}{{classname}}{{/description}} + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class {{classname}}Test 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 "{{classname}}" + */ + public function test{{classname}}() + { + } +{{#vars}} + + /** + * Test attribute "{{name}}" + */ + public function testProperty{{nameInCamelCase}}() + { + } +{{/vars}} +} +{{/model}} +{{/models}} diff --git a/codegen-template/partial_header.mustache b/codegen-template/partial_header.mustache new file mode 100644 index 0000000..4cf2337 --- /dev/null +++ b/codegen-template/partial_header.mustache @@ -0,0 +1,14 @@ +/** + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + * {{{appDescription}}} + * + {{/appDescription}} + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: {{{generatorVersion}}} + */ diff --git a/codegen-template/phpunit.xml.mustache b/codegen-template/phpunit.xml.mustache new file mode 100644 index 0000000..5de6fea --- /dev/null +++ b/codegen-template/phpunit.xml.mustache @@ -0,0 +1,21 @@ + + + + + {{apiTestPath}} + {{modelTestPath}} + + + + + + {{apiSrcPath}} + {{modelSrcPath}} + + + From 9acec2d30e5236e496175659332d0b6bd1e01ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 12:28:17 +0200 Subject: [PATCH 04/13] Client code generation with swagger-codegen --- .gitignore | 1 + README.md | 116 +- codegen-template/.php_cs | 18 - codegen-template/.travis.yml | 10 - codegen-template/README.mustache | 114 +- codegen-template/composer.mustache | 39 - codegen-template/config.json | 4 + codegen-template/git_push.sh.mustache | 52 - codegen-template/phpunit.xml.mustache | 21 - composer.json | 12 +- docs/Api/AccessIDsApi.md | 70 +- docs/Api/ChannelGroupsApi.md | 84 +- docs/Api/ChannelsApi.md | 104 +- docs/Api/ClientAppsApi.md | 42 +- docs/Api/IODevicesApi.md | 70 +- docs/Api/LocationsApi.md | 70 +- docs/Api/SchedulesApi.md | 84 +- docs/Api/ServerApi.md | 16 +- docs/Api/UsersApi.md | 32 +- docs/Model/AccessID.md | 6 +- docs/Model/Body1.md | 2 +- docs/Model/Body10.md | 4 +- docs/Model/Body2.md | 8 +- docs/Model/Body4.md | 6 +- docs/Model/Body5.md | 6 +- docs/Model/Body7.md | 2 +- docs/Model/Body8.md | 2 +- docs/Model/Channel.md | 16 +- docs/Model/ChannelFunction.md | 4 +- docs/Model/ChannelGroup.md | 8 +- docs/Model/ClientApp.md | 16 +- docs/Model/Device.md | 20 +- docs/Model/InlineResponse200.md | 6 +- docs/Model/InlineResponse2002.md | 4 - docs/Model/InlineResponse2003.md | 4 +- docs/Model/InlineResponse2004.md | 12 - docs/Model/Location.md | 12 +- docs/Model/Schedule.md | 12 +- docs/Model/ScheduleFuture.md | 2 +- docs/Model/SchedulePast.md | 4 +- docs/Model/ScheduleRequest.md | 10 +- docs/Model/UserRequest.md | 14 + lib/Api/AccessIDsApi.php | 225 +- lib/Api/ChannelGroupsApi.php | 272 +- lib/Api/ChannelsApi.php | 339 +- lib/Api/ClientAppsApi.php | 141 +- lib/Api/IODevicesApi.php | 227 +- lib/Api/LocationsApi.php | 225 +- lib/Api/SchedulesApi.php | 270 +- lib/Api/ServerApi.php | 84 +- lib/Api/UsersApi.php | 116 +- lib/ApiException.php | 7 +- lib/Configuration.php | 7 +- lib/HeaderSelector.php | 1 + lib/Model/AccessID.php | 93 +- lib/Model/Body.php | 29 +- lib/Model/Body1.php | 45 +- lib/Model/Body10.php | 69 +- lib/Model/Body2.php | 117 +- lib/Model/Body3.php | 21 +- lib/Model/Body4.php | 93 +- lib/Model/Body5.php | 93 +- lib/Model/Body6.php | 21 +- lib/Model/Body7.php | 45 +- lib/Model/Body8.php | 45 +- lib/Model/Body9.php | 21 +- lib/Model/Channel.php | 213 +- lib/Model/ChannelFunction.php | 69 +- lib/Model/ChannelFunctionAction.php | 21 +- lib/Model/ChannelFunctionActionEnum.php | 7 +- lib/Model/ChannelFunctionEnumNames.php | 7 +- lib/Model/ChannelGroup.php | 117 +- lib/Model/ChannelParam.php | 21 +- lib/Model/ChannelType.php | 29 +- lib/Model/ClientApp.php | 213 +- lib/Model/Device.php | 263 +- lib/Model/InlineResponse200.php | 93 +- lib/Model/InlineResponse2001.php | 21 +- lib/Model/InlineResponse2002.php | 151 +- lib/Model/InlineResponse2003.php | 107 +- lib/Model/InlineResponse200Timezone.php | 21 +- lib/Model/InlineResponse400.php | 21 +- lib/Model/InlineResponse4001.php | 21 +- lib/Model/InlineResponse409.php | 21 +- lib/Model/InlineResponse503.php | 21 +- lib/Model/Location.php | 165 +- lib/Model/ModelInterface.php | 1 + lib/Model/Schedule.php | 173 +- lib/Model/ScheduleClosestExecutions.php | 21 +- lib/Model/ScheduleFuture.php | 45 +- lib/Model/SchedulePast.php | 69 +- lib/Model/ScheduleRequest.php | 149 +- lib/Model/ScheduleResult.php | 21 +- ...InlineResponse2004.php => UserRequest.php} | 171 +- lib/ObjectSerializer.php | 9 +- swagger.json | 5394 +++++++++++++++++ 96 files changed, 8105 insertions(+), 3295 deletions(-) delete mode 100644 codegen-template/.php_cs delete mode 100644 codegen-template/.travis.yml delete mode 100644 codegen-template/composer.mustache create mode 100644 codegen-template/config.json delete mode 100644 codegen-template/git_push.sh.mustache delete mode 100644 codegen-template/phpunit.xml.mustache delete mode 100644 docs/Model/InlineResponse2004.md create mode 100644 docs/Model/UserRequest.md rename lib/Model/{InlineResponse2004.php => UserRequest.php} (57%) create mode 100644 swagger.json diff --git a/.gitignore b/.gitignore index b6caf46..61cb44c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ vendor/ /*.php +/*.jar diff --git a/README.md b/README.md index 9173a8d..c5ea34f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # SUPLA-API-CLIENT for PHP - - [![Latest Release](https://img.shields.io/github/release/SUPLA/api-client-php.svg)](https://github.com/SUPLA/api-client-php/releases/latest) - [![Build Status](https://travis-ci.org/SUPLA/api-client-php.svg?branch=master)](https://travis-ci.org/SUPLA/supla-cloud) - [![Packagist Downloads](https://img.shields.io/packagist/dt/SUPLA/api-client.svg)](https://packagist.org/packages/supla/api-client) + +[![Latest Release](https://img.shields.io/github/release/SUPLA/api-client-php.svg)](https://github.com/SUPLA/api-client-php/releases/latest) +[![Build Status](https://travis-ci.org/SUPLA/api-client-php.svg?branch=master)](https://travis-ci.org/SUPLA/supla-cloud) +[![Packagist Downloads](https://img.shields.io/packagist/dt/SUPLA/api-client.svg)](https://packagist.org/packages/supla/api-client) Your home connected. www.supla.org @@ -25,6 +25,8 @@ Then create an instance of a client in your code. ```php 'svrX.supla.org', 'clientId' => 'YOUR_CLIENT_ID', @@ -34,102 +36,10 @@ $client = new \Supla\ApiClient\SuplaApiClient([ ]); ``` -# Usage - -### Getting server info - -``` -$client->getServerInfo(); -``` - -TODO - - - -# SwaggerClient-php -No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2.2.0 -- Build package: io.swagger.codegen.languages.PhpClientCodegen - ## Requirements PHP 5.5 and later -## Installation & Usage -### Composer - -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: - -``` -{ - "repositories": [ - { - "type": "git", - "url": "https://github.com//.git" - } - ], - "require": { - "/": "*@dev" - } -} -``` - -Then run `composer install` - -### Manual Installation - -Download the files and include `autoload.php`: - -```php - require_once('/path/to/SwaggerClient-php/vendor/autoload.php'); -``` - -## Tests - -To run the unit tests: - -``` -composer install -./vendor/bin/phpunit -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```php -setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); -// Configure OAuth2 access token for authorization: password -$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\AccessIDsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$x_accept_version = "x_accept_version_example"; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->accessidsGet($x_accept_version, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AccessIDsApi->accessidsGet: ', $e->getMessage(), PHP_EOL; -} - -?> -``` - ## Documentation for API Endpoints All URIs are relative to *https://cloud.supla.org/api* @@ -207,7 +117,6 @@ Class | Method | HTTP request | Description - [InlineResponse2001](docs/Model/InlineResponse2001.md) - [InlineResponse2002](docs/Model/InlineResponse2002.md) - [InlineResponse2003](docs/Model/InlineResponse2003.md) - - [InlineResponse2004](docs/Model/InlineResponse2004.md) - [InlineResponse200Timezone](docs/Model/InlineResponse200Timezone.md) - [InlineResponse400](docs/Model/InlineResponse400.md) - [InlineResponse4001](docs/Model/InlineResponse4001.md) @@ -220,17 +129,12 @@ Class | Method | HTTP request | Description - [SchedulePast](docs/Model/SchedulePast.md) - [ScheduleRequest](docs/Model/ScheduleRequest.md) - [ScheduleResult](docs/Model/ScheduleResult.md) + - [UserRequest](docs/Model/UserRequest.md) ## Documentation For Authorization -## bearer - -- **Type**: API key -- **API key parameter name**: Authorization -- **Location**: HTTP header - ## password - **Type**: OAuth @@ -239,9 +143,3 @@ Class | Method | HTTP request | Description - **Scopes**: - **restapi**: full API access - -## Author - - - - diff --git a/codegen-template/.php_cs b/codegen-template/.php_cs deleted file mode 100644 index 6b8e23c..0000000 --- a/codegen-template/.php_cs +++ /dev/null @@ -1,18 +0,0 @@ -level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->setUsingCache(true) - ->fixers( - [ - 'ordered_use', - 'phpdoc_order', - 'short_array_syntax', - 'strict', - 'strict_param' - ] - ) - ->finder( - Symfony\CS\Finder\DefaultFinder::create() - ->in(__DIR__) - ); diff --git a/codegen-template/.travis.yml b/codegen-template/.travis.yml deleted file mode 100644 index d77f382..0000000 --- a/codegen-template/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php -sudo: false -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm -before_install: "composer install" -script: "vendor/bin/phpunit" diff --git a/codegen-template/README.mustache b/codegen-template/README.mustache index e17247e..2e1ea42 100644 --- a/codegen-template/README.mustache +++ b/codegen-template/README.mustache @@ -1,103 +1,45 @@ -# {{packagePath}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} - -This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: {{appVersion}} -{{#artifactVersion}} -- Package version: {{artifactVersion}} -{{/artifactVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} +# SUPLA-API-CLIENT for PHP -## Requirements +[![Latest Release](https://img.shields.io/github/release/SUPLA/api-client-php.svg)](https://github.com/SUPLA/api-client-php/releases/latest) +[![Build Status](https://travis-ci.org/SUPLA/api-client-php.svg?branch=master)](https://travis-ci.org/SUPLA/supla-cloud) +[![Packagist Downloads](https://img.shields.io/packagist/dt/SUPLA/api-client.svg)](https://packagist.org/packages/supla/api-client) -PHP 5.5 and later +Your home connected. www.supla.org -## Installation & Usage -### Composer +# Installation -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: +Install with [Composer](https://getcomposer.org/). ``` -{ - "repositories": [ - { - "type": "git", - "url": "https://github.com/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git" - } - ], - "require": { - "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}": "*@dev" - } -} -``` - -Then run `composer install` - -### Manual Installation - -Download the files and include `autoload.php`: - -```php - require_once('/path/to/{{packagePath}}/vendor/autoload.php'); +composer require supla/api-client ``` -## Tests +# Configuration -To run the unit tests: +Get the API configuration values from the SUPLA-CLOUD you use. +You can find them on the *RESTFUL API* page after enabling it. -``` -composer install -./vendor/bin/phpunit -``` +![](img/restful-api-cloud.jpg) -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: +Then create an instance of a client in your code. ```php setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}} -// Configure API key authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}} -// Configure OAuth2 access token for authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} -{{/hasAuthMethods}} - -$apiInstance = new {{invokerPackage}}\Api\{{classname}}( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(){{#hasAuthMethods}}, - $config{{/hasAuthMethods}} -); -{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} -{{/allParams}} - -try { - {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} - print_r($result);{{/returnType}} -} catch (Exception $e) { - echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; -} -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -?> + +$client = new \Supla\ApiClient\SuplaApiClient([ + 'server' => 'svrX.supla.org', + 'clientId' => 'YOUR_CLIENT_ID', + 'secret' => 'YOUR_SECRET', + 'username' => 'YOUR_USERNAME', + 'password' => 'YOUR_PASSWORD', +]); ``` +## Requirements + +PHP 5.5 and later + ## Documentation for API Endpoints All URIs are relative to *{{basePath}}* @@ -133,9 +75,3 @@ Class | Method | HTTP request | Description {{/isOAuth}} {{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} -{{/hasMore}}{{/apis}}{{/apiInfo}} - diff --git a/codegen-template/composer.mustache b/codegen-template/composer.mustache deleted file mode 100644 index 0a7732f..0000000 --- a/codegen-template/composer.mustache +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}", - {{#artifactVersion}} - "version": "{{artifactVersion}}", - {{/artifactVersion}} - "description": "{{description}}", - "keywords": [ - "swagger", - "php", - "sdk", - "api" - ], - "homepage": "http://swagger.io", - "license": "proprietary", - "authors": [ - { - "name": "Swagger and contributors", - "homepage": "https://github.com/swagger-api/swagger-codegen" - } - ], - "require": { - "php": ">=5.5", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~1.12" - }, - "autoload": { - "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } - }, - "autoload-dev": { - "psr-4": { "{{escapedInvokerPackage}}\\" : "{{testBasePath}}/" } - } -} diff --git a/codegen-template/config.json b/codegen-template/config.json new file mode 100644 index 0000000..ee336ac --- /dev/null +++ b/codegen-template/config.json @@ -0,0 +1,4 @@ +{ + "packagePath": "SuplaApiGenerated", + "variableNamingConvention": "camelCase" +} diff --git a/codegen-template/git_push.sh.mustache b/codegen-template/git_push.sh.mustache deleted file mode 100644 index f65b794..0000000 --- a/codegen-template/git_push.sh.mustache +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/codegen-template/phpunit.xml.mustache b/codegen-template/phpunit.xml.mustache deleted file mode 100644 index 5de6fea..0000000 --- a/codegen-template/phpunit.xml.mustache +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {{apiTestPath}} - {{modelTestPath}} - - - - - - {{apiSrcPath}} - {{modelSrcPath}} - - - diff --git a/composer.json b/composer.json index 9c17239..b425b9e 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,16 @@ }, "scripts": { "phpcs": "phpcs src --standard=phpcs-rules.xml", - "phpcbf": "phpcbf src --standard=phpcs-rules.xml" + "phpcbf": "phpcbf src --standard=phpcs-rules.xml", + "generate": [ + "rm -fr output", + "mkdir output", + "java -jar swagger-codegen.jar generate -i swagger.json -l php -o output -t codegen-template -c codegen-template/config.json", + "rm -fr docs lib README.md", + "mv output/SuplaApiGenerated/docs .", + "mv output/SuplaApiGenerated/lib .", + "mv output/SuplaApiGenerated/README.md .", + "rm -fr output" + ] } } diff --git a/docs/Api/AccessIDsApi.md b/docs/Api/AccessIDsApi.md index 9c340de..2f20cb5 100644 --- a/docs/Api/AccessIDsApi.md +++ b/docs/Api/AccessIDsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **accessidsGet** -> \Swagger\Client\Model\AccessID[] accessidsGet($x_accept_version, $include) +> \Swagger\Client\Model\AccessID[] accessidsGet($xAcceptVersion, $include) Get Access IDs list @@ -21,10 +21,6 @@ Get Access IDs list setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -34,11 +30,11 @@ $apiInstance = new Swagger\Client\Api\AccessIDsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->accessidsGet($x_accept_version, $include); + $result = $apiInstance->accessidsGet($xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccessIDsApi->accessidsGet: ', $e->getMessage(), PHP_EOL; @@ -50,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -59,7 +55,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -69,7 +65,7 @@ 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) # **accessidsPost** -> \Swagger\Client\Model\AccessID accessidsPost($x_accept_version) +> \Swagger\Client\Model\AccessID accessidsPost($xAcceptVersion) Create a new Access ID @@ -78,10 +74,6 @@ Create a new Access ID setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -91,10 +83,10 @@ $apiInstance = new Swagger\Client\Api\AccessIDsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->accessidsPost($x_accept_version); + $result = $apiInstance->accessidsPost($xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccessIDsApi->accessidsPost: ', $e->getMessage(), PHP_EOL; @@ -106,7 +98,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -114,7 +106,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -124,7 +116,7 @@ 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) # **deleteAccessID** -> deleteAccessID($id, $x_accept_version) +> deleteAccessID($id, $xAcceptVersion) Delete Access Identifier @@ -133,10 +125,6 @@ Delete Access Identifier setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -147,10 +135,10 @@ $apiInstance = new Swagger\Client\Api\AccessIDsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->deleteAccessID($id, $x_accept_version); + $apiInstance->deleteAccessID($id, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling AccessIDsApi->deleteAccessID: ', $e->getMessage(), PHP_EOL; } @@ -162,7 +150,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -170,7 +158,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -180,7 +168,7 @@ 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) # **getAccessID** -> \Swagger\Client\Model\AccessID getAccessID($id, $x_accept_version, $include) +> \Swagger\Client\Model\AccessID getAccessID($id, $xAcceptVersion, $include) Get Access ID @@ -189,10 +177,6 @@ Get Access ID setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -203,11 +187,11 @@ $apiInstance = new Swagger\Client\Api\AccessIDsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getAccessID($id, $x_accept_version, $include); + $result = $apiInstance->getAccessID($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccessIDsApi->getAccessID: ', $e->getMessage(), PHP_EOL; @@ -220,7 +204,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -229,7 +213,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -239,7 +223,7 @@ 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) # **updateAccessID** -> \Swagger\Client\Model\AccessID updateAccessID($id, $body, $x_accept_version) +> \Swagger\Client\Model\AccessID updateAccessID($id, $body, $xAcceptVersion) Edit Access ID @@ -248,10 +232,6 @@ Edit Access ID setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -263,10 +243,10 @@ $apiInstance = new Swagger\Client\Api\AccessIDsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body10(); // \Swagger\Client\Model\Body10 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->updateAccessID($id, $body, $x_accept_version); + $result = $apiInstance->updateAccessID($id, $body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccessIDsApi->updateAccessID: ', $e->getMessage(), PHP_EOL; @@ -280,7 +260,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body10**](../Model/Body10.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -288,7 +268,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/ChannelGroupsApi.md b/docs/Api/ChannelGroupsApi.md index a86029f..7a2b016 100644 --- a/docs/Api/ChannelGroupsApi.md +++ b/docs/Api/ChannelGroupsApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **createChannelGroup** -> \Swagger\Client\Model\ChannelGroup createChannelGroup($body, $x_accept_version) +> \Swagger\Client\Model\ChannelGroup createChannelGroup($body, $xAcceptVersion) Create a new channel group @@ -22,10 +22,6 @@ Create a new channel group setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -36,10 +32,10 @@ $apiInstance = new Swagger\Client\Api\ChannelGroupsApi( $config ); $body = new \Swagger\Client\Model\Body4(); // \Swagger\Client\Model\Body4 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->createChannelGroup($body, $x_accept_version); + $result = $apiInstance->createChannelGroup($body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelGroupsApi->createChannelGroup: ', $e->getMessage(), PHP_EOL; @@ -52,7 +48,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\Body4**](../Model/Body4.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -60,7 +56,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -70,7 +66,7 @@ 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) # **deleteChannelGroup** -> deleteChannelGroup($id, $x_accept_version) +> deleteChannelGroup($id, $xAcceptVersion) Delete Channel Group @@ -79,10 +75,6 @@ Delete Channel Group setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -93,10 +85,10 @@ $apiInstance = new Swagger\Client\Api\ChannelGroupsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->deleteChannelGroup($id, $x_accept_version); + $apiInstance->deleteChannelGroup($id, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling ChannelGroupsApi->deleteChannelGroup: ', $e->getMessage(), PHP_EOL; } @@ -108,7 +100,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -116,7 +108,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -126,7 +118,7 @@ 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) # **executeChannelGroupAction** -> executeChannelGroupAction($id, $body, $x_accept_version) +> executeChannelGroupAction($id, $body, $xAcceptVersion) Execute action on the channel group @@ -135,10 +127,6 @@ Execute action on the channel group setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -150,10 +138,10 @@ $apiInstance = new Swagger\Client\Api\ChannelGroupsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body6(); // \Swagger\Client\Model\Body6 | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->executeChannelGroupAction($id, $body, $x_accept_version); + $apiInstance->executeChannelGroupAction($id, $body, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling ChannelGroupsApi->executeChannelGroupAction: ', $e->getMessage(), PHP_EOL; } @@ -166,7 +154,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body6**](../Model/Body6.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -174,7 +162,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -184,7 +172,7 @@ 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) # **getChannelGroup** -> \Swagger\Client\Model\ChannelGroup getChannelGroup($id, $x_accept_version, $include) +> \Swagger\Client\Model\ChannelGroup getChannelGroup($id, $xAcceptVersion, $include) Get channel group by ID @@ -193,10 +181,6 @@ Get channel group by ID setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -207,11 +191,11 @@ $apiInstance = new Swagger\Client\Api\ChannelGroupsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getChannelGroup($id, $x_accept_version, $include); + $result = $apiInstance->getChannelGroup($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelGroupsApi->getChannelGroup: ', $e->getMessage(), PHP_EOL; @@ -224,7 +208,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -233,7 +217,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -243,7 +227,7 @@ 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) # **getChannelGroups** -> \Swagger\Client\Model\ChannelGroup[] getChannelGroups($x_accept_version, $include) +> \Swagger\Client\Model\ChannelGroup[] getChannelGroups($xAcceptVersion, $include) Get channels list @@ -252,10 +236,6 @@ Get channels list setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -265,11 +245,11 @@ $apiInstance = new Swagger\Client\Api\ChannelGroupsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getChannelGroups($x_accept_version, $include); + $result = $apiInstance->getChannelGroups($xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelGroupsApi->getChannelGroups: ', $e->getMessage(), PHP_EOL; @@ -281,7 +261,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -290,7 +270,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -300,7 +280,7 @@ 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) # **updateChannelGroup** -> \Swagger\Client\Model\ChannelGroup updateChannelGroup($id, $body, $x_accept_version) +> \Swagger\Client\Model\ChannelGroup updateChannelGroup($id, $body, $xAcceptVersion) Update channel group @@ -309,10 +289,6 @@ Update channel group setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -324,10 +300,10 @@ $apiInstance = new Swagger\Client\Api\ChannelGroupsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body5(); // \Swagger\Client\Model\Body5 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->updateChannelGroup($id, $body, $x_accept_version); + $result = $apiInstance->updateChannelGroup($id, $body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelGroupsApi->updateChannelGroup: ', $e->getMessage(), PHP_EOL; @@ -341,7 +317,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body5**](../Model/Body5.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -349,7 +325,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/ChannelsApi.md b/docs/Api/ChannelsApi.md index 5ad7283..3e1621f 100644 --- a/docs/Api/ChannelsApi.md +++ b/docs/Api/ChannelsApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description # **executeAction** -> executeAction($id, $body, $x_accept_version) +> executeAction($id, $body, $xAcceptVersion) Execute action on the channel @@ -23,10 +23,6 @@ Execute action on the channel setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -38,10 +34,10 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body3(); // \Swagger\Client\Model\Body3 | Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->executeAction($id, $body, $x_accept_version); + $apiInstance->executeAction($id, $body, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->executeAction: ', $e->getMessage(), PHP_EOL; } @@ -54,7 +50,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body3**](../Model/Body3.md)| Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -62,7 +58,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -72,7 +68,7 @@ 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) # **getChannel** -> \Swagger\Client\Model\Channel getChannel($id, $x_accept_version, $include) +> \Swagger\Client\Model\Channel getChannel($id, $xAcceptVersion, $include) Get channel by ID @@ -81,10 +77,6 @@ Get channel by ID setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -95,11 +87,11 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getChannel($id, $x_accept_version, $include); + $result = $apiInstance->getChannel($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->getChannel: ', $e->getMessage(), PHP_EOL; @@ -112,7 +104,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -121,7 +113,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -131,7 +123,7 @@ 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) # **getChannelMeasurementLogs** -> \Swagger\Client\Model\InlineResponse2004[] getChannelMeasurementLogs($id, $x_accept_version, $limit, $offset) +> \Swagger\Client\Model\InlineResponse2003[] getChannelMeasurementLogs($id, $xAcceptVersion, $limit, $offset) Get measurement logs. @@ -142,10 +134,6 @@ Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs or setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -156,12 +144,12 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $limit = 5000; // int | Maximum items count in response, from 1 to 5000 $offset = 56; // int | Pagination offset try { - $result = $apiInstance->getChannelMeasurementLogs($id, $x_accept_version, $limit, $offset); + $result = $apiInstance->getChannelMeasurementLogs($id, $xAcceptVersion, $limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->getChannelMeasurementLogs: ', $e->getMessage(), PHP_EOL; @@ -174,17 +162,17 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **limit** | **int**| Maximum items count in response, from 1 to 5000 | [optional] [default to 5000] **offset** | **int**| Pagination offset | [optional] ### Return type -[**\Swagger\Client\Model\InlineResponse2004[]**](../Model/InlineResponse2004.md) +[**\Swagger\Client\Model\InlineResponse2003[]**](../Model/InlineResponse2003.md) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -194,7 +182,7 @@ 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) # **getChannelMeasurementLogsCsvFile** -> \SplFileObject getChannelMeasurementLogsCsvFile($id, $x_accept_version) +> \SplFileObject getChannelMeasurementLogsCsvFile($id, $xAcceptVersion) Get measurement logs as zipped CSV file. @@ -205,10 +193,6 @@ Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs or setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -219,10 +203,10 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->getChannelMeasurementLogsCsvFile($id, $x_accept_version); + $result = $apiInstance->getChannelMeasurementLogsCsvFile($id, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->getChannelMeasurementLogsCsvFile: ', $e->getMessage(), PHP_EOL; @@ -235,7 +219,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -243,7 +227,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -253,7 +237,7 @@ 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) # **getChannelSchedules** -> \Swagger\Client\Model\Schedule[] getChannelSchedules($id, $x_accept_version, $include) +> \Swagger\Client\Model\Schedule[] getChannelSchedules($id, $xAcceptVersion, $include) Get schedules list of the channel @@ -262,10 +246,6 @@ Get schedules list of the channel setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -276,11 +256,11 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getChannelSchedules($id, $x_accept_version, $include); + $result = $apiInstance->getChannelSchedules($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->getChannelSchedules: ', $e->getMessage(), PHP_EOL; @@ -293,7 +273,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -302,7 +282,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -312,7 +292,7 @@ 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) # **getChannels** -> \Swagger\Client\Model\Channel[] getChannels($x_accept_version, $include, $function, $io, $has_function) +> \Swagger\Client\Model\Channel[] getChannels($xAcceptVersion, $include, $function, $io, $hasFunction) Get channels list @@ -321,10 +301,6 @@ Get channels list setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -334,14 +310,14 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. $function = array("function_example"); // string[] | $io = "io_example"; // string | Return only `input` or `output` channels. -$has_function = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. +$hasFunction = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. try { - $result = $apiInstance->getChannels($x_accept_version, $include, $function, $io, $has_function); + $result = $apiInstance->getChannels($xAcceptVersion, $include, $function, $io, $hasFunction); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->getChannels: ', $e->getMessage(), PHP_EOL; @@ -353,11 +329,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] **function** | [**string[]**](../Model/string.md)| | [optional] **io** | **string**| Return only `input` or `output` channels. | [optional] - **has_function** | **bool**| Return only channels with (`true`) or without (`false`) chosen functions. | [optional] + **hasFunction** | **bool**| Return only channels with (`true`) or without (`false`) chosen functions. | [optional] ### Return type @@ -365,7 +341,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -375,7 +351,7 @@ 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) # **updateChannel** -> \Swagger\Client\Model\Channel updateChannel($id, $body, $x_accept_version) +> \Swagger\Client\Model\Channel updateChannel($id, $body, $xAcceptVersion) Update channel @@ -384,10 +360,6 @@ Update channel setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -399,10 +371,10 @@ $apiInstance = new Swagger\Client\Api\ChannelsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body2(); // \Swagger\Client\Model\Body2 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->updateChannel($id, $body, $x_accept_version); + $result = $apiInstance->updateChannel($id, $body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ChannelsApi->updateChannel: ', $e->getMessage(), PHP_EOL; @@ -416,7 +388,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body2**](../Model/Body2.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -424,7 +396,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/ClientAppsApi.md b/docs/Api/ClientAppsApi.md index 1f26353..b79caa3 100644 --- a/docs/Api/ClientAppsApi.md +++ b/docs/Api/ClientAppsApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description # **deleteClientApp** -> deleteClientApp($id, $x_accept_version) +> deleteClientApp($id, $xAcceptVersion) Delete Client App @@ -19,10 +19,6 @@ Delete Client App setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -33,10 +29,10 @@ $apiInstance = new Swagger\Client\Api\ClientAppsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->deleteClientApp($id, $x_accept_version); + $apiInstance->deleteClientApp($id, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling ClientAppsApi->deleteClientApp: ', $e->getMessage(), PHP_EOL; } @@ -48,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -56,7 +52,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -66,7 +62,7 @@ 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) # **getClientApps** -> \Swagger\Client\Model\ClientApp[] getClientApps($x_accept_version, $include) +> \Swagger\Client\Model\ClientApp[] getClientApps($xAcceptVersion, $include) Get client apps @@ -75,10 +71,6 @@ Get client apps setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -88,11 +80,11 @@ $apiInstance = new Swagger\Client\Api\ClientAppsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getClientApps($x_accept_version, $include); + $result = $apiInstance->getClientApps($xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling ClientAppsApi->getClientApps: ', $e->getMessage(), PHP_EOL; @@ -104,7 +96,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -113,7 +105,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -123,7 +115,7 @@ 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) # **updateClientApp** -> \Swagger\Client\Model\ClientApp updateClientApp($id, $body, $x_accept_version) +> \Swagger\Client\Model\ClientApp updateClientApp($id, $body, $xAcceptVersion) Update client app @@ -132,10 +124,6 @@ Update client app setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -147,10 +135,10 @@ $apiInstance = new Swagger\Client\Api\ClientAppsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body7(); // \Swagger\Client\Model\Body7 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->updateClientApp($id, $body, $x_accept_version); + $result = $apiInstance->updateClientApp($id, $body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ClientAppsApi->updateClientApp: ', $e->getMessage(), PHP_EOL; @@ -164,7 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body7**](../Model/Body7.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -172,7 +160,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/IODevicesApi.md b/docs/Api/IODevicesApi.md index 7be845b..db14a70 100644 --- a/docs/Api/IODevicesApi.md +++ b/docs/Api/IODevicesApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **deleteIoDevice** -> deleteIoDevice($id, $x_accept_version) +> deleteIoDevice($id, $xAcceptVersion) Delete IO Device @@ -21,10 +21,6 @@ Delete IO Device setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -35,10 +31,10 @@ $apiInstance = new Swagger\Client\Api\IODevicesApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->deleteIoDevice($id, $x_accept_version); + $apiInstance->deleteIoDevice($id, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling IODevicesApi->deleteIoDevice: ', $e->getMessage(), PHP_EOL; } @@ -50,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -58,7 +54,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -68,7 +64,7 @@ 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) # **getIoDevice** -> \Swagger\Client\Model\Device getIoDevice($id, $x_accept_version, $include) +> \Swagger\Client\Model\Device getIoDevice($id, $xAcceptVersion, $include) Get IO Device @@ -77,10 +73,6 @@ Get IO Device setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -91,11 +83,11 @@ $apiInstance = new Swagger\Client\Api\IODevicesApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getIoDevice($id, $x_accept_version, $include); + $result = $apiInstance->getIoDevice($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling IODevicesApi->getIoDevice: ', $e->getMessage(), PHP_EOL; @@ -108,7 +100,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -117,7 +109,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -127,7 +119,7 @@ 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) # **getIoDeviceChannels** -> \Swagger\Client\Model\Channel getIoDeviceChannels($id, $x_accept_version, $include) +> \Swagger\Client\Model\Channel getIoDeviceChannels($id, $xAcceptVersion, $include) Get Channels that belong to IO Deice @@ -136,10 +128,6 @@ Get Channels that belong to IO Deice setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -150,11 +138,11 @@ $apiInstance = new Swagger\Client\Api\IODevicesApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getIoDeviceChannels($id, $x_accept_version, $include); + $result = $apiInstance->getIoDeviceChannels($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling IODevicesApi->getIoDeviceChannels: ', $e->getMessage(), PHP_EOL; @@ -167,7 +155,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -176,7 +164,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -186,7 +174,7 @@ 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) # **getIoDevices** -> \Swagger\Client\Model\Device[] getIoDevices($x_accept_version, $include) +> \Swagger\Client\Model\Device[] getIoDevices($xAcceptVersion, $include) Get IO Devices @@ -195,10 +183,6 @@ Get IO Devices setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -208,11 +192,11 @@ $apiInstance = new Swagger\Client\Api\IODevicesApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getIoDevices($x_accept_version, $include); + $result = $apiInstance->getIoDevices($xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling IODevicesApi->getIoDevices: ', $e->getMessage(), PHP_EOL; @@ -224,7 +208,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -233,7 +217,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -243,7 +227,7 @@ 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) # **updateIoDevice** -> \Swagger\Client\Model\Device updateIoDevice($id, $body, $x_accept_version) +> \Swagger\Client\Model\Device updateIoDevice($id, $body, $xAcceptVersion) Update IO Device @@ -252,10 +236,6 @@ Update IO Device setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -267,10 +247,10 @@ $apiInstance = new Swagger\Client\Api\IODevicesApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body8(); // \Swagger\Client\Model\Body8 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->updateIoDevice($id, $body, $x_accept_version); + $result = $apiInstance->updateIoDevice($id, $body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling IODevicesApi->updateIoDevice: ', $e->getMessage(), PHP_EOL; @@ -284,7 +264,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body8**](../Model/Body8.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -292,7 +272,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/LocationsApi.md b/docs/Api/LocationsApi.md index 8ec7d5a..0df8653 100644 --- a/docs/Api/LocationsApi.md +++ b/docs/Api/LocationsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **createLocation** -> \Swagger\Client\Model\Location createLocation($x_accept_version) +> \Swagger\Client\Model\Location createLocation($xAcceptVersion) Create a new location @@ -21,10 +21,6 @@ Create a new location setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -34,10 +30,10 @@ $apiInstance = new Swagger\Client\Api\LocationsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->createLocation($x_accept_version); + $result = $apiInstance->createLocation($xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling LocationsApi->createLocation: ', $e->getMessage(), PHP_EOL; @@ -49,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -57,7 +53,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -67,7 +63,7 @@ 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) # **deleteLocation** -> deleteLocation($id, $x_accept_version, $include) +> deleteLocation($id, $xAcceptVersion, $include) Delete location @@ -76,10 +72,6 @@ Delete location setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -90,11 +82,11 @@ $apiInstance = new Swagger\Client\Api\LocationsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $apiInstance->deleteLocation($id, $x_accept_version, $include); + $apiInstance->deleteLocation($id, $xAcceptVersion, $include); } catch (Exception $e) { echo 'Exception when calling LocationsApi->deleteLocation: ', $e->getMessage(), PHP_EOL; } @@ -106,7 +98,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -115,7 +107,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -125,7 +117,7 @@ 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) # **getLocation** -> \Swagger\Client\Model\Location getLocation($id, $x_accept_version, $include) +> \Swagger\Client\Model\Location getLocation($id, $xAcceptVersion, $include) Get location by ID @@ -134,10 +126,6 @@ Get location by ID setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -148,11 +136,11 @@ $apiInstance = new Swagger\Client\Api\LocationsApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getLocation($id, $x_accept_version, $include); + $result = $apiInstance->getLocation($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling LocationsApi->getLocation: ', $e->getMessage(), PHP_EOL; @@ -165,7 +153,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -174,7 +162,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -184,7 +172,7 @@ 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) # **getLocations** -> \Swagger\Client\Model\Location[] getLocations($x_accept_version, $include) +> \Swagger\Client\Model\Location[] getLocations($xAcceptVersion, $include) Get locations list @@ -193,10 +181,6 @@ Get locations list setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -206,11 +190,11 @@ $apiInstance = new Swagger\Client\Api\LocationsApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getLocations($x_accept_version, $include); + $result = $apiInstance->getLocations($xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling LocationsApi->getLocations: ', $e->getMessage(), PHP_EOL; @@ -222,7 +206,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -231,7 +215,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -241,7 +225,7 @@ 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) # **updateLocation** -> \Swagger\Client\Model\Location updateLocation($id, $body, $x_accept_version, $include) +> \Swagger\Client\Model\Location updateLocation($id, $body, $xAcceptVersion, $include) Edit location @@ -250,10 +234,6 @@ Edit location setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -265,11 +245,11 @@ $apiInstance = new Swagger\Client\Api\LocationsApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\Body1(); // \Swagger\Client\Model\Body1 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->updateLocation($id, $body, $x_accept_version, $include); + $result = $apiInstance->updateLocation($id, $body, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling LocationsApi->updateLocation: ', $e->getMessage(), PHP_EOL; @@ -283,7 +263,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body1**](../Model/Body1.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -292,7 +272,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/SchedulesApi.md b/docs/Api/SchedulesApi.md index 373fba9..a6bda54 100644 --- a/docs/Api/SchedulesApi.md +++ b/docs/Api/SchedulesApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **createSchedule** -> \Swagger\Client\Model\Schedule createSchedule($body, $x_accept_version) +> \Swagger\Client\Model\Schedule createSchedule($body, $xAcceptVersion) Create a new schedule @@ -22,10 +22,6 @@ Create a new schedule setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -36,10 +32,10 @@ $apiInstance = new Swagger\Client\Api\SchedulesApi( $config ); $body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->createSchedule($body, $x_accept_version); + $result = $apiInstance->createSchedule($body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling SchedulesApi->createSchedule: ', $e->getMessage(), PHP_EOL; @@ -52,7 +48,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\ScheduleRequest**](../Model/ScheduleRequest.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -60,7 +56,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -70,7 +66,7 @@ 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) # **deleteSchedule** -> deleteSchedule($id, $x_accept_version) +> deleteSchedule($id, $xAcceptVersion) Delete Schedule @@ -79,10 +75,6 @@ Delete Schedule setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -93,10 +85,10 @@ $apiInstance = new Swagger\Client\Api\SchedulesApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->deleteSchedule($id, $x_accept_version); + $apiInstance->deleteSchedule($id, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling SchedulesApi->deleteSchedule: ', $e->getMessage(), PHP_EOL; } @@ -108,7 +100,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -116,7 +108,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -126,7 +118,7 @@ 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) # **enableSchedules** -> enableSchedules($body, $x_accept_version) +> enableSchedules($body, $xAcceptVersion) Enable schedules @@ -135,10 +127,6 @@ Enable schedules setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -149,10 +137,10 @@ $apiInstance = new Swagger\Client\Api\SchedulesApi( $config ); $body = new \Swagger\Client\Model\Body9(); // \Swagger\Client\Model\Body9 | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $apiInstance->enableSchedules($body, $x_accept_version); + $apiInstance->enableSchedules($body, $xAcceptVersion); } catch (Exception $e) { echo 'Exception when calling SchedulesApi->enableSchedules: ', $e->getMessage(), PHP_EOL; } @@ -164,7 +152,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\Body9**](../Model/Body9.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -172,7 +160,7 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -182,7 +170,7 @@ 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) # **getSchedule** -> \Swagger\Client\Model\Schedule getSchedule($id, $x_accept_version, $include) +> \Swagger\Client\Model\Schedule getSchedule($id, $xAcceptVersion, $include) Get Schedule @@ -191,10 +179,6 @@ Get Schedule setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -205,11 +189,11 @@ $apiInstance = new Swagger\Client\Api\SchedulesApi( $config ); $id = 56; // int | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getSchedule($id, $x_accept_version, $include); + $result = $apiInstance->getSchedule($id, $xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling SchedulesApi->getSchedule: ', $e->getMessage(), PHP_EOL; @@ -222,7 +206,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -231,7 +215,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -241,7 +225,7 @@ 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) # **getSchedules** -> \Swagger\Client\Model\Schedule[] getSchedules($x_accept_version, $include) +> \Swagger\Client\Model\Schedule[] getSchedules($xAcceptVersion, $include) Get schedules list @@ -250,10 +234,6 @@ Get schedules list setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -263,11 +243,11 @@ $apiInstance = new Swagger\Client\Api\SchedulesApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $include = array("include_example"); // string[] | Specify what extra fields to include in the response. try { - $result = $apiInstance->getSchedules($x_accept_version, $include); + $result = $apiInstance->getSchedules($xAcceptVersion, $include); print_r($result); } catch (Exception $e) { echo 'Exception when calling SchedulesApi->getSchedules: ', $e->getMessage(), PHP_EOL; @@ -279,7 +259,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -288,7 +268,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -298,7 +278,7 @@ 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) # **updateSchedule** -> \Swagger\Client\Model\Schedule updateSchedule($id, $body, $x_accept_version, $enable) +> \Swagger\Client\Model\Schedule updateSchedule($id, $body, $xAcceptVersion, $enable) Update schedule @@ -307,10 +287,6 @@ Update schedule setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -322,11 +298,11 @@ $apiInstance = new Swagger\Client\Api\SchedulesApi( ); $id = 56; // int | $body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version $enable = true; // bool | Set to `true` to enable the schedule after saving. try { - $result = $apiInstance->updateSchedule($id, $body, $x_accept_version, $enable); + $result = $apiInstance->updateSchedule($id, $body, $xAcceptVersion, $enable); print_r($result); } catch (Exception $e) { echo 'Exception when calling SchedulesApi->updateSchedule: ', $e->getMessage(), PHP_EOL; @@ -340,7 +316,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\ScheduleRequest**](../Model/ScheduleRequest.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] **enable** | **bool**| Set to `true` to enable the schedule after saving. | [optional] ### Return type @@ -349,7 +325,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Api/ServerApi.md b/docs/Api/ServerApi.md index 36621b0..71ea12d 100644 --- a/docs/Api/ServerApi.md +++ b/docs/Api/ServerApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **serverInfoGet** -> \Swagger\Client\Model\InlineResponse200 serverInfoGet($x_accept_version) +> \Swagger\Client\Model\InlineResponse200 serverInfoGet($xAcceptVersion) Get server status @@ -23,10 +23,10 @@ $apiInstance = new Swagger\Client\Api\ServerApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->serverInfoGet($x_accept_version); + $result = $apiInstance->serverInfoGet($xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ServerApi->serverInfoGet: ', $e->getMessage(), PHP_EOL; @@ -38,7 +38,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -56,7 +56,7 @@ 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) # **serverStatusGet** -> \Swagger\Client\Model\InlineResponse2001 serverStatusGet($x_accept_version) +> \Swagger\Client\Model\InlineResponse2001 serverStatusGet($xAcceptVersion) Get the SUPLA Server status @@ -70,10 +70,10 @@ $apiInstance = new Swagger\Client\Api\ServerApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->serverStatusGet($x_accept_version); + $result = $apiInstance->serverStatusGet($xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling ServerApi->serverStatusGet: ', $e->getMessage(), PHP_EOL; @@ -85,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md index 86e246c..500cd0a 100644 --- a/docs/Api/UsersApi.md +++ b/docs/Api/UsersApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **editCurrentUser** -> \Swagger\Client\Model\InlineResponse2003 editCurrentUser($body, $x_accept_version) +> \Swagger\Client\Model\InlineResponse2002 editCurrentUser($body, $xAcceptVersion) Edit current user @@ -18,10 +18,6 @@ Edit current user setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -32,10 +28,10 @@ $apiInstance = new Swagger\Client\Api\UsersApi( $config ); $body = new \Swagger\Client\Model\Body(); // \Swagger\Client\Model\Body | -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->editCurrentUser($body, $x_accept_version); + $result = $apiInstance->editCurrentUser($body, $xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling UsersApi->editCurrentUser: ', $e->getMessage(), PHP_EOL; @@ -48,15 +44,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\Body**](../Model/Body.md)| | - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type -[**\Swagger\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\Swagger\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers @@ -66,7 +62,7 @@ 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) # **getCurrentUser** -> \Swagger\Client\Model\InlineResponse2002 getCurrentUser($x_accept_version) +> \Swagger\Client\Model\UserRequest getCurrentUser($xAcceptVersion) Get current user @@ -75,10 +71,6 @@ Get current user setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); // Configure OAuth2 access token for authorization: password $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -88,10 +80,10 @@ $apiInstance = new Swagger\Client\Api\UsersApi( new GuzzleHttp\Client(), $config ); -$x_accept_version = "x_accept_version_example"; // string | API Version +$xAcceptVersion = "\"2.2.0\""; // string | API Version try { - $result = $apiInstance->getCurrentUser($x_accept_version); + $result = $apiInstance->getCurrentUser($xAcceptVersion); print_r($result); } catch (Exception $e) { echo 'Exception when calling UsersApi->getCurrentUser: ', $e->getMessage(), PHP_EOL; @@ -103,15 +95,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_accept_version** | **string**| API Version | [optional] + **xAcceptVersion** | **string**| API Version | [optional] ### Return type -[**\Swagger\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md) +[**\Swagger\Client\Model\UserRequest**](../Model/UserRequest.md) ### Authorization -[bearer](../../README.md#bearer), [password](../../README.md#password) +[password](../../README.md#password) ### HTTP request headers diff --git a/docs/Model/AccessID.md b/docs/Model/AccessID.md index 58bb8da..fc4b22f 100644 --- a/docs/Model/AccessID.md +++ b/docs/Model/AccessID.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes **id** | **int** | Access ID identifier | [optional] **caption** | **string** | Location caption | [optional] **enabled** | **bool** | `true` if the location is enabled, `false` otherwise | [optional] -**locations_ids** | **int[]** | array containing the location idenfifiers assigned to this access ID | [optional] -**client_apps_ids** | **int[]** | array containing the client apps idenfifiers assigned to this access ID | [optional] +**locationsIds** | **int[]** | array containing the location idenfifiers assigned to this access ID | [optional] +**clientAppsIds** | **int[]** | array containing the client apps idenfifiers assigned to this access ID | [optional] **locations** | [**\Swagger\Client\Model\Location[]**](Location.md) | Returned only if requested by the `include` parameter. | [optional] -**client_apps** | [**\Swagger\Client\Model\ClientApp[]**](ClientApp.md) | Returned only if requested by the `include` parameter. | [optional] +**clientApps** | [**\Swagger\Client\Model\ClientApp[]**](ClientApp.md) | Returned only if requested by the `include` parameter. | [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/Body1.md b/docs/Model/Body1.md index 38570a8..15bcf48 100644 --- a/docs/Model/Body1.md +++ b/docs/Model/Body1.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **enabled** | **bool** | | [optional] **caption** | **string** | | [optional] **password** | **string** | Provide new password if you want to change it. | [optional] -**access_ids_ids** | **int[]** | Access Identifiers identifiers to assign to this location. | [optional] +**accessIdsIds** | **int[]** | Access Identifiers identifiers to assign to this location. | [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/Body10.md b/docs/Model/Body10.md index 2c6c27f..5212d12 100644 --- a/docs/Model/Body10.md +++ b/docs/Model/Body10.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **enabled** | **bool** | | [optional] **caption** | **string** | | [optional] **password** | **string** | Provide new password if you want to change it. | [optional] -**locations_ids** | **int[]** | Locations identifiers to assign to this Access ID. | [optional] -**client_apps_ids** | **int[]** | Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. | [optional] +**locationsIds** | **int[]** | Locations identifiers to assign to this Access ID. | [optional] +**clientAppsIds** | **int[]** | Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. | [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/Body2.md b/docs/Model/Body2.md index 21d2239..65f703c 100644 --- a/docs/Model/Body2.md +++ b/docs/Model/Body2.md @@ -3,15 +3,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**function_id** | **int** | | [optional] +**functionId** | **int** | | [optional] **param1** | **int** | | [optional] **param2** | **int** | | [optional] **param3** | **int** | | [optional] **caption** | **string** | | [optional] -**alt_icon** | **int** | | [optional] +**altIcon** | **int** | | [optional] **hidden** | **bool** | | [optional] -**location_id** | **int** | | [optional] -**inherited_location** | **bool** | | [optional] +**locationId** | **int** | | [optional] +**inheritedLocation** | **bool** | | [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/Body4.md b/docs/Model/Body4.md index a104d34..29c3af9 100644 --- a/docs/Model/Body4.md +++ b/docs/Model/Body4.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **caption** | **string** | | [optional] -**alt_icon** | **int** | | [optional] +**altIcon** | **int** | | [optional] **hidden** | **bool** | | [optional] -**location_id** | **int** | | [optional] -**channel_ids** | **int[]** | | [optional] +**locationId** | **int** | | [optional] +**channelIds** | **int[]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/Body5.md b/docs/Model/Body5.md index 742038c..c73eb92 100644 --- a/docs/Model/Body5.md +++ b/docs/Model/Body5.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **caption** | **string** | | [optional] -**alt_icon** | **int** | | [optional] +**altIcon** | **int** | | [optional] **hidden** | **bool** | | [optional] -**location_id** | **int** | | [optional] -**channel_ids** | **int[]** | | [optional] +**locationId** | **int** | | [optional] +**channelIds** | **int[]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/Body7.md b/docs/Model/Body7.md index eb8a8bf..85968f7 100644 --- a/docs/Model/Body7.md +++ b/docs/Model/Body7.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **caption** | **string** | | [optional] **enabled** | **bool** | | [optional] -**access_id_id** | **int** | | [optional] +**accessIdId** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/Body8.md b/docs/Model/Body8.md index 2791648..b756a22 100644 --- a/docs/Model/Body8.md +++ b/docs/Model/Body8.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **comment** | **string** | | [optional] **enabled** | **bool** | | [optional] -**location_id** | **int** | | [optional] +**locationId** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/Channel.md b/docs/Model/Channel.md index fbb1896..7d25575 100644 --- a/docs/Model/Channel.md +++ b/docs/Model/Channel.md @@ -4,24 +4,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Channel identifier | [optional] -**channel_number** | **int** | Channel ordinal number in its IO Device | [optional] +**channelNumber** | **int** | Channel ordinal number in its IO Device | [optional] **caption** | **string** | Channel caption | [optional] **type** | [**\Swagger\Client\Model\ChannelType**](ChannelType.md) | | [optional] **function** | [**\Swagger\Client\Model\ChannelFunction**](ChannelFunction.md) | | [optional] **param1** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] **param2** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] **param3** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] -**alt_icon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [optional] +**altIcon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [optional] **hidden** | **bool** | Whether this channel is shown on client apps or not | [optional] -**inherited_location** | **bool** | Whether this channel inherits its IODevice's location (`true`) or not (`false`) | [optional] -**iodevice_id** | **int** | | [optional] -**location_id** | **int** | | [optional] -**function_id** | **int** | | [optional] -**type_id** | **int** | | [optional] +**inheritedLocation** | **bool** | Whether this channel inherits its IODevice's location (`true`) or not (`false`) | [optional] +**iodeviceId** | **int** | | [optional] +**locationId** | **int** | | [optional] +**functionId** | **int** | | [optional] +**typeId** | **int** | | [optional] **iodevice** | [**\Swagger\Client\Model\Device**](Device.md) | | [optional] **location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] **connected** | **bool** | | [optional] -**supported_functions** | [**\Swagger\Client\Model\ChannelFunction[]**](ChannelFunction.md) | | [optional] +**supportedFunctions** | [**\Swagger\Client\Model\ChannelFunction[]**](ChannelFunction.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/ChannelFunction.md b/docs/Model/ChannelFunction.md index af34d93..42cf02a 100644 --- a/docs/Model/ChannelFunction.md +++ b/docs/Model/ChannelFunction.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **name** | [**\Swagger\Client\Model\ChannelFunctionEnumNames**](ChannelFunctionEnumNames.md) | | [optional] **caption** | **string** | | [optional] -**max_alternative_icon_index** | **int** | | [optional] -**possible_actions** | [**\Swagger\Client\Model\ChannelFunctionAction[]**](ChannelFunctionAction.md) | What can you with with this channel? | [optional] +**maxAlternativeIconIndex** | **int** | | [optional] +**possibleActions** | [**\Swagger\Client\Model\ChannelFunctionAction[]**](ChannelFunctionAction.md) | What can you with with this channel? | [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/ChannelGroup.md b/docs/Model/ChannelGroup.md index 008fb84..3e1141c 100644 --- a/docs/Model/ChannelGroup.md +++ b/docs/Model/ChannelGroup.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes **hidden** | **bool** | Whether this channel group is shown on client apps or not | [optional] **caption** | **string** | Channel caption | [optional] **function** | [**\Swagger\Client\Model\ChannelFunction**](ChannelFunction.md) | | [optional] -**function_id** | **int** | | [optional] -**location_id** | **int** | | [optional] +**functionId** | **int** | | [optional] +**locationId** | **int** | | [optional] **location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] -**channel_ids** | **int[]** | | [optional] +**channelIds** | **int[]** | | [optional] **channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [optional] -**alt_icon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [optional] +**altIcon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [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/ClientApp.md b/docs/Model/ClientApp.md index d959fa3..62e88c3 100644 --- a/docs/Model/ClientApp.md +++ b/docs/Model/ClientApp.md @@ -7,15 +7,15 @@ Name | Type | Description | Notes **name** | **string** | | [optional] **caption** | **string** | | [optional] **enabled** | **bool** | | [optional] -**reg_ipv4** | **int** | | [optional] -**reg_date** | [**\DateTime**](\DateTime.md) | | [optional] -**last_access_ipv4** | **int** | | [optional] -**last_access_date** | [**\DateTime**](\DateTime.md) | | [optional] -**software_version** | **string** | | [optional] -**protocol_version** | **int** | | [optional] -**access_id_id** | **int** | | [optional] +**regIpv4** | **int** | | [optional] +**regDate** | [**\DateTime**](\DateTime.md) | | [optional] +**lastAccessIpv4** | **int** | | [optional] +**lastAccessDate** | [**\DateTime**](\DateTime.md) | | [optional] +**softwareVersion** | **string** | | [optional] +**protocolVersion** | **int** | | [optional] +**accessIdId** | **int** | | [optional] **connected** | **bool** | | [optional] -**access_id** | [**\Swagger\Client\Model\AccessID**](AccessID.md) | | [optional] +**accessId** | [**\Swagger\Client\Model\AccessID**](AccessID.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/Device.md b/docs/Model/Device.md index 12be201..2de2a3a 100644 --- a/docs/Model/Device.md +++ b/docs/Model/Device.md @@ -7,18 +7,18 @@ Name | Type | Description | Notes **name** | **string** | | [optional] **enabled** | **bool** | | [optional] **comment** | **string** | | [optional] -**reg_date** | [**\DateTime**](\DateTime.md) | | [optional] -**reg_ipv4** | **int** | | [optional] -**last_connected** | [**\DateTime**](\DateTime.md) | | [optional] -**last_ipv4** | **int** | | [optional] -**software_version** | **string** | | [optional] -**g_uid_string** | **string** | | [optional] -**location_id** | **int** | | [optional] -**original_location_id** | **int** | | [optional] -**channels_ids** | **int[]** | | [optional] +**regDate** | [**\DateTime**](\DateTime.md) | | [optional] +**regIpv4** | **int** | | [optional] +**lastConnected** | [**\DateTime**](\DateTime.md) | | [optional] +**lastIpv4** | **int** | | [optional] +**softwareVersion** | **string** | | [optional] +**gUIDString** | **string** | | [optional] +**locationId** | **int** | | [optional] +**originalLocationId** | **int** | | [optional] +**channelsIds** | **int[]** | | [optional] **connected** | **bool** | | [optional] **location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] -**original_location** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] +**originalLocation** | [**\Swagger\Client\Model\Location**](Location.md) | | [optional] **channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [optional] **schedules** | [**\Swagger\Client\Model\Schedule[]**](Schedule.md) | Returned only if requested by the `include` parameter. | [optional] diff --git a/docs/Model/InlineResponse200.md b/docs/Model/InlineResponse200.md index bfaa48e..8305a5a 100644 --- a/docs/Model/InlineResponse200.md +++ b/docs/Model/InlineResponse200.md @@ -8,9 +8,9 @@ Name | Type | Description | Notes **timezone** | [**\Swagger\Client\Model\InlineResponse200Timezone**](InlineResponse200Timezone.md) | | [optional] **authenticated** | **bool** | | [optional] **username** | **string** | Present only if `authenticated=true` | [optional] -**cloud_version** | **string** | | [optional] -**api_version** | **string** | | [optional] -**supported_api_versions** | **string[]** | | [optional] +**cloudVersion** | **string** | | [optional] +**apiVersion** | **string** | | [optional] +**supportedApiVersions** | **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) diff --git a/docs/Model/InlineResponse2002.md b/docs/Model/InlineResponse2002.md index 8a0f9fb..1a50678 100644 --- a/docs/Model/InlineResponse2002.md +++ b/docs/Model/InlineResponse2002.md @@ -4,10 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**email** | **string** | | [optional] -**timezone** | **string** | | [optional] -**clients_registration_enabled** | [**\DateTime**](\DateTime.md) | | [optional] -**io_devices_registration_enabled** | [**\DateTime**](\DateTime.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/InlineResponse2003.md b/docs/Model/InlineResponse2003.md index b8acc5e..4a7fda8 100644 --- a/docs/Model/InlineResponse2003.md +++ b/docs/Model/InlineResponse2003.md @@ -3,7 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] +**dateTimestamp** | **int** | | [optional] +**temperature** | **float** | Temperature in Celsius | [optional] +**humidity** | **float** | Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`. | [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/InlineResponse2004.md b/docs/Model/InlineResponse2004.md deleted file mode 100644 index aa4bc8b..0000000 --- a/docs/Model/InlineResponse2004.md +++ /dev/null @@ -1,12 +0,0 @@ -# InlineResponse2004 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**date_timestamp** | **int** | | [optional] -**temperature** | **float** | Temperature in Celsius | [optional] -**humidity** | **float** | Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`. | [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/Location.md b/docs/Model/Location.md index a47a84b..5229200 100644 --- a/docs/Model/Location.md +++ b/docs/Model/Location.md @@ -6,14 +6,14 @@ Name | Type | Description | Notes **id** | **int** | Location identifier | [optional] **caption** | **string** | Location caption | [optional] **enabled** | **bool** | `true` if the location is enabled, `false` otherwise | [optional] -**iodevices_ids** | **int[]** | array containing the IO Devices identifiers assigned to this location | [optional] -**channel_groups_ids** | **int[]** | array containing the Channel groups identifiers assigned to this location | [optional] -**channels_ids** | **int[]** | array containing the Channels identifiers expicitely assigned to this location | [optional] -**access_ids_ids** | **int[]** | array containing the Access Identifiers identifiers assigned to this location | [optional] +**iodevicesIds** | **int[]** | array containing the IO Devices identifiers assigned to this location | [optional] +**channelGroupsIds** | **int[]** | array containing the Channel groups identifiers assigned to this location | [optional] +**channelsIds** | **int[]** | array containing the Channels identifiers expicitely assigned to this location | [optional] +**accessIdsIds** | **int[]** | array containing the Access Identifiers identifiers assigned to this location | [optional] **password** | **string** | Location password (plain text). Returned only if requested by the `include` parameter. | [optional] **iodevices** | [**\Swagger\Client\Model\Device[]**](Device.md) | Returned only if requested by the `include` parameter. | [optional] -**channel_groups** | [**\Swagger\Client\Model\ChannelGroup[]**](ChannelGroup.md) | Returned only if requested by the `include` parameter. | [optional] -**access_ids** | [**\Swagger\Client\Model\AccessID[]**](AccessID.md) | Returned only if requested by the `include` parameter. | [optional] +**channelGroups** | [**\Swagger\Client\Model\ChannelGroup[]**](ChannelGroup.md) | Returned only if requested by the `include` parameter. | [optional] +**accessIds** | [**\Swagger\Client\Model\AccessID[]**](AccessID.md) | Returned only if requested by the `include` parameter. | [optional] **channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [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/Schedule.md b/docs/Model/Schedule.md index 7373de3..f372df1 100644 --- a/docs/Model/Schedule.md +++ b/docs/Model/Schedule.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Schedule identifier | [optional] -**time_expression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] +**timeExpression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] **action** | [**\Swagger\Client\Model\ChannelFunctionAction**](ChannelFunctionAction.md) | | [optional] **mode** | **string** | | [optional] -**date_start** | [**\DateTime**](\DateTime.md) | | [optional] -**date_end** | [**\DateTime**](\DateTime.md) | | [optional] +**dateStart** | [**\DateTime**](\DateTime.md) | | [optional] +**dateEnd** | [**\DateTime**](\DateTime.md) | | [optional] **enabled** | **bool** | | [optional] **caption** | **string** | | [optional] **retry** | **bool** | | [optional] -**channel_id** | **int** | | [optional] -**action_id** | **int** | | [optional] +**channelId** | **int** | | [optional] +**actionId** | **int** | | [optional] **channel** | [**\Swagger\Client\Model\Channel**](Channel.md) | | [optional] -**closest_executions** | [**\Swagger\Client\Model\ScheduleClosestExecutions[]**](ScheduleClosestExecutions.md) | Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions. | [optional] +**closestExecutions** | [**\Swagger\Client\Model\ScheduleClosestExecutions[]**](ScheduleClosestExecutions.md) | Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions. | [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/ScheduleFuture.md b/docs/Model/ScheduleFuture.md index beecf1e..af29f3d 100644 --- a/docs/Model/ScheduleFuture.md +++ b/docs/Model/ScheduleFuture.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**planned_timestamp** | [**\DateTime**](\DateTime.md) | | [optional] +**plannedTimestamp** | [**\DateTime**](\DateTime.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/SchedulePast.md b/docs/Model/SchedulePast.md index 475d482..a5febe1 100644 --- a/docs/Model/SchedulePast.md +++ b/docs/Model/SchedulePast.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**planned_timestamp** | [**\DateTime**](\DateTime.md) | | [optional] -**result_timestamp** | [**\DateTime**](\DateTime.md) | | [optional] +**plannedTimestamp** | [**\DateTime**](\DateTime.md) | | [optional] +**resultTimestamp** | [**\DateTime**](\DateTime.md) | | [optional] **failed** | **bool** | | [optional] **result** | [**\Swagger\Client\Model\ScheduleResult**](ScheduleResult.md) | | [optional] diff --git a/docs/Model/ScheduleRequest.md b/docs/Model/ScheduleRequest.md index bdfd51c..d2eae88 100644 --- a/docs/Model/ScheduleRequest.md +++ b/docs/Model/ScheduleRequest.md @@ -3,12 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**channel_id** | **int** | | [optional] -**action_id** | **int** | | [optional] +**channelId** | **int** | | [optional] +**actionId** | **int** | | [optional] **mode** | **string** | | [optional] -**time_expression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] -**date_start** | [**\DateTime**](\DateTime.md) | | [optional] -**date_end** | [**\DateTime**](\DateTime.md) | | [optional] +**timeExpression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] +**dateStart** | [**\DateTime**](\DateTime.md) | | [optional] +**dateEnd** | [**\DateTime**](\DateTime.md) | | [optional] **caption** | **string** | | [optional] **retry** | **bool** | | [optional] diff --git a/docs/Model/UserRequest.md b/docs/Model/UserRequest.md new file mode 100644 index 0000000..c2aa032 --- /dev/null +++ b/docs/Model/UserRequest.md @@ -0,0 +1,14 @@ +# UserRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**email** | **string** | | [optional] +**timezone** | **string** | | [optional] +**clientsRegistrationEnabled** | [**\DateTime**](\DateTime.md) | | [optional] +**ioDevicesRegistrationEnabled** | [**\DateTime**](\DateTime.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/lib/Api/AccessIDsApi.php b/lib/Api/AccessIDsApi.php index c89230c..aa6f491 100644 --- a/lib/Api/AccessIDsApi.php +++ b/lib/Api/AccessIDsApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class AccessIDsApi @@ -60,6 +59,11 @@ class AccessIDsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -88,16 +92,16 @@ public function getConfig() * * Get Access IDs list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\AccessID[] */ - public function accessidsGet($x_accept_version = null, $include = null) + public function accessidsGet($xAcceptVersion = null, $include = null) { - list($response) = $this->accessidsGetWithHttpInfo($x_accept_version, $include); + list($response) = $this->accessidsGetWithHttpInfo($xAcceptVersion, $include); return $response; } @@ -106,17 +110,17 @@ public function accessidsGet($x_accept_version = null, $include = null) * * Get Access IDs list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\AccessID[], HTTP status code, HTTP response headers (array of strings) */ - public function accessidsGetWithHttpInfo($x_accept_version = null, $include = null) + public function accessidsGetWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\AccessID[]'; - $request = $this->accessidsGetRequest($x_accept_version, $include); + $request = $this->accessidsGetRequest($xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -127,7 +131,7 @@ public function accessidsGetWithHttpInfo($x_accept_version = null, $include = nu "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -182,15 +186,15 @@ public function accessidsGetWithHttpInfo($x_accept_version = null, $include = nu * * Get Access IDs list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsGetAsync($x_accept_version = null, $include = null) + public function accessidsGetAsync($xAcceptVersion = null, $include = null) { - return $this->accessidsGetAsyncWithHttpInfo($x_accept_version, $include) + return $this->accessidsGetAsyncWithHttpInfo($xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -203,16 +207,16 @@ function ($response) { * * Get Access IDs list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsGetAsyncWithHttpInfo($x_accept_version = null, $include = null) + public function accessidsGetAsyncWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\AccessID[]'; - $request = $this->accessidsGetRequest($x_accept_version, $include); + $request = $this->accessidsGetRequest($xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -254,13 +258,13 @@ function ($exception) { /** * Create request for operation 'accessidsGet' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function accessidsGetRequest($x_accept_version = null, $include = null) + protected function accessidsGetRequest($xAcceptVersion = null, $include = null) { $resourcePath = '/accessids'; @@ -278,8 +282,8 @@ protected function accessidsGetRequest($x_accept_version = null, $include = null $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -287,7 +291,7 @@ protected function accessidsGetRequest($x_accept_version = null, $include = null $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -326,11 +330,6 @@ protected function accessidsGetRequest($x_accept_version = null, $include = null } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -361,15 +360,15 @@ protected function accessidsGetRequest($x_accept_version = null, $include = null * * Create a new Access ID * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\AccessID */ - public function accessidsPost($x_accept_version = null) + public function accessidsPost($xAcceptVersion = null) { - list($response) = $this->accessidsPostWithHttpInfo($x_accept_version); + list($response) = $this->accessidsPostWithHttpInfo($xAcceptVersion); return $response; } @@ -378,16 +377,16 @@ public function accessidsPost($x_accept_version = null) * * Create a new Access ID * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) */ - public function accessidsPostWithHttpInfo($x_accept_version = null) + public function accessidsPostWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->accessidsPostRequest($x_accept_version); + $request = $this->accessidsPostRequest($xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -398,7 +397,7 @@ public function accessidsPostWithHttpInfo($x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -453,14 +452,14 @@ public function accessidsPostWithHttpInfo($x_accept_version = null) * * Create a new Access ID * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsPostAsync($x_accept_version = null) + public function accessidsPostAsync($xAcceptVersion = null) { - return $this->accessidsPostAsyncWithHttpInfo($x_accept_version) + return $this->accessidsPostAsyncWithHttpInfo($xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -473,15 +472,15 @@ function ($response) { * * Create a new Access ID * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsPostAsyncWithHttpInfo($x_accept_version = null) + public function accessidsPostAsyncWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->accessidsPostRequest($x_accept_version); + $request = $this->accessidsPostRequest($xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -523,12 +522,12 @@ function ($exception) { /** * Create request for operation 'accessidsPost' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function accessidsPostRequest($x_accept_version = null) + protected function accessidsPostRequest($xAcceptVersion = null) { $resourcePath = '/accessids'; @@ -539,8 +538,8 @@ protected function accessidsPostRequest($x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -548,7 +547,7 @@ protected function accessidsPostRequest($x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -587,11 +586,6 @@ protected function accessidsPostRequest($x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -623,15 +617,15 @@ protected function accessidsPostRequest($x_accept_version = null) * Delete Access Identifier * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteAccessID($id, $x_accept_version = null) + public function deleteAccessID($id, $xAcceptVersion = null) { - $this->deleteAccessIDWithHttpInfo($id, $x_accept_version); + $this->deleteAccessIDWithHttpInfo($id, $xAcceptVersion); } /** @@ -640,16 +634,16 @@ public function deleteAccessID($id, $x_accept_version = null) * Delete Access Identifier * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAccessIDWithHttpInfo($id, $x_accept_version = null) + public function deleteAccessIDWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteAccessIDRequest($id, $x_accept_version); + $request = $this->deleteAccessIDRequest($id, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -660,7 +654,7 @@ public function deleteAccessIDWithHttpInfo($id, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -694,14 +688,14 @@ public function deleteAccessIDWithHttpInfo($id, $x_accept_version = null) * Delete Access Identifier * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccessIDAsync($id, $x_accept_version = null) + public function deleteAccessIDAsync($id, $xAcceptVersion = null) { - return $this->deleteAccessIDAsyncWithHttpInfo($id, $x_accept_version) + return $this->deleteAccessIDAsyncWithHttpInfo($id, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -715,15 +709,15 @@ function ($response) { * Delete Access Identifier * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccessIDAsyncWithHttpInfo($id, $x_accept_version = null) + public function deleteAccessIDAsyncWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteAccessIDRequest($id, $x_accept_version); + $request = $this->deleteAccessIDRequest($id, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -752,15 +746,15 @@ function ($exception) { * Create request for operation 'deleteAccessID' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAccessIDRequest($id, $x_accept_version = null) + protected function deleteAccessIDRequest($id, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling deleteAccessID' ); @@ -774,8 +768,8 @@ protected function deleteAccessIDRequest($id, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -791,7 +785,7 @@ protected function deleteAccessIDRequest($id, $x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -830,11 +824,6 @@ protected function deleteAccessIDRequest($id, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -866,16 +855,16 @@ protected function deleteAccessIDRequest($id, $x_accept_version = null) * Get Access ID * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\AccessID */ - public function getAccessID($id, $x_accept_version = null, $include = null) + public function getAccessID($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getAccessIDWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getAccessIDWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -885,17 +874,17 @@ public function getAccessID($id, $x_accept_version = null, $include = null) * Get Access ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) */ - public function getAccessIDWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getAccessIDWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->getAccessIDRequest($id, $x_accept_version, $include); + $request = $this->getAccessIDRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -906,7 +895,7 @@ public function getAccessIDWithHttpInfo($id, $x_accept_version = null, $include "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -962,15 +951,15 @@ public function getAccessIDWithHttpInfo($id, $x_accept_version = null, $include * Get Access ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessIDAsync($id, $x_accept_version = null, $include = null) + public function getAccessIDAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getAccessIDAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getAccessIDAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -984,16 +973,16 @@ function ($response) { * Get Access ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessIDAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getAccessIDAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->getAccessIDRequest($id, $x_accept_version, $include); + $request = $this->getAccessIDRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1036,16 +1025,16 @@ function ($exception) { * Create request for operation 'getAccessID' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccessIDRequest($id, $x_accept_version = null, $include = null) + protected function getAccessIDRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getAccessID' ); @@ -1066,8 +1055,8 @@ protected function getAccessIDRequest($id, $x_accept_version = null, $include = $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1083,7 +1072,7 @@ protected function getAccessIDRequest($id, $x_accept_version = null, $include = $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1122,11 +1111,6 @@ protected function getAccessIDRequest($id, $x_accept_version = null, $include = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1159,15 +1143,15 @@ protected function getAccessIDRequest($id, $x_accept_version = null, $include = * * @param int $id id (required) * @param \Swagger\Client\Model\Body10 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\AccessID */ - public function updateAccessID($id, $body, $x_accept_version = null) + public function updateAccessID($id, $body, $xAcceptVersion = null) { - list($response) = $this->updateAccessIDWithHttpInfo($id, $body, $x_accept_version); + list($response) = $this->updateAccessIDWithHttpInfo($id, $body, $xAcceptVersion); return $response; } @@ -1178,16 +1162,16 @@ public function updateAccessID($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) */ - public function updateAccessIDWithHttpInfo($id, $body, $x_accept_version = null) + public function updateAccessIDWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->updateAccessIDRequest($id, $body, $x_accept_version); + $request = $this->updateAccessIDRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -1198,7 +1182,7 @@ public function updateAccessIDWithHttpInfo($id, $body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1255,14 +1239,14 @@ public function updateAccessIDWithHttpInfo($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccessIDAsync($id, $body, $x_accept_version = null) + public function updateAccessIDAsync($id, $body, $xAcceptVersion = null) { - return $this->updateAccessIDAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->updateAccessIDAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -1277,15 +1261,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccessIDAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function updateAccessIDAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->updateAccessIDRequest($id, $body, $x_accept_version); + $request = $this->updateAccessIDRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1329,21 +1313,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAccessIDRequest($id, $body, $x_accept_version = null) + protected function updateAccessIDRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateAccessID' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateAccessID' ); @@ -1357,8 +1341,8 @@ protected function updateAccessIDRequest($id, $body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1377,7 +1361,7 @@ protected function updateAccessIDRequest($id, $body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1416,11 +1400,6 @@ protected function updateAccessIDRequest($id, $body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/ChannelGroupsApi.php b/lib/Api/ChannelGroupsApi.php index c82f9ef..52068a7 100644 --- a/lib/Api/ChannelGroupsApi.php +++ b/lib/Api/ChannelGroupsApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ChannelGroupsApi @@ -60,6 +59,11 @@ class ChannelGroupsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -89,15 +93,15 @@ public function getConfig() * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup */ - public function createChannelGroup($body, $x_accept_version = null) + public function createChannelGroup($body, $xAcceptVersion = null) { - list($response) = $this->createChannelGroupWithHttpInfo($body, $x_accept_version); + list($response) = $this->createChannelGroupWithHttpInfo($body, $xAcceptVersion); return $response; } @@ -107,16 +111,16 @@ public function createChannelGroup($body, $x_accept_version = null) * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) */ - public function createChannelGroupWithHttpInfo($body, $x_accept_version = null) + public function createChannelGroupWithHttpInfo($body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->createChannelGroupRequest($body, $x_accept_version); + $request = $this->createChannelGroupRequest($body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -127,7 +131,7 @@ public function createChannelGroupWithHttpInfo($body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -183,14 +187,14 @@ public function createChannelGroupWithHttpInfo($body, $x_accept_version = null) * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChannelGroupAsync($body, $x_accept_version = null) + public function createChannelGroupAsync($body, $xAcceptVersion = null) { - return $this->createChannelGroupAsyncWithHttpInfo($body, $x_accept_version) + return $this->createChannelGroupAsyncWithHttpInfo($body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -204,15 +208,15 @@ function ($response) { * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChannelGroupAsyncWithHttpInfo($body, $x_accept_version = null) + public function createChannelGroupAsyncWithHttpInfo($body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->createChannelGroupRequest($body, $x_accept_version); + $request = $this->createChannelGroupRequest($body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -255,15 +259,15 @@ function ($exception) { * Create request for operation 'createChannelGroup' * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createChannelGroupRequest($body, $x_accept_version = null) + protected function createChannelGroupRequest($body, $xAcceptVersion = null) { // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling createChannelGroup' ); @@ -277,8 +281,8 @@ protected function createChannelGroupRequest($body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -289,7 +293,7 @@ protected function createChannelGroupRequest($body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -328,11 +332,6 @@ protected function createChannelGroupRequest($body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -364,15 +363,15 @@ protected function createChannelGroupRequest($body, $x_accept_version = null) * Delete Channel Group * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteChannelGroup($id, $x_accept_version = null) + public function deleteChannelGroup($id, $xAcceptVersion = null) { - $this->deleteChannelGroupWithHttpInfo($id, $x_accept_version); + $this->deleteChannelGroupWithHttpInfo($id, $xAcceptVersion); } /** @@ -381,16 +380,16 @@ public function deleteChannelGroup($id, $x_accept_version = null) * Delete Channel Group * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteChannelGroupWithHttpInfo($id, $x_accept_version = null) + public function deleteChannelGroupWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteChannelGroupRequest($id, $x_accept_version); + $request = $this->deleteChannelGroupRequest($id, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -401,7 +400,7 @@ public function deleteChannelGroupWithHttpInfo($id, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -435,14 +434,14 @@ public function deleteChannelGroupWithHttpInfo($id, $x_accept_version = null) * Delete Channel Group * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteChannelGroupAsync($id, $x_accept_version = null) + public function deleteChannelGroupAsync($id, $xAcceptVersion = null) { - return $this->deleteChannelGroupAsyncWithHttpInfo($id, $x_accept_version) + return $this->deleteChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -456,15 +455,15 @@ function ($response) { * Delete Channel Group * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteChannelGroupAsyncWithHttpInfo($id, $x_accept_version = null) + public function deleteChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteChannelGroupRequest($id, $x_accept_version); + $request = $this->deleteChannelGroupRequest($id, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -493,15 +492,15 @@ function ($exception) { * Create request for operation 'deleteChannelGroup' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteChannelGroupRequest($id, $x_accept_version = null) + protected function deleteChannelGroupRequest($id, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling deleteChannelGroup' ); @@ -515,8 +514,8 @@ protected function deleteChannelGroupRequest($id, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -532,7 +531,7 @@ protected function deleteChannelGroupRequest($id, $x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -571,11 +570,6 @@ protected function deleteChannelGroupRequest($id, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -608,15 +602,15 @@ protected function deleteChannelGroupRequest($id, $x_accept_version = null) * * @param int $id id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function executeChannelGroupAction($id, $body, $x_accept_version = null) + public function executeChannelGroupAction($id, $body, $xAcceptVersion = null) { - $this->executeChannelGroupActionWithHttpInfo($id, $body, $x_accept_version); + $this->executeChannelGroupActionWithHttpInfo($id, $body, $xAcceptVersion); } /** @@ -626,16 +620,16 @@ public function executeChannelGroupAction($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function executeChannelGroupActionWithHttpInfo($id, $body, $x_accept_version = null) + public function executeChannelGroupActionWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = ''; - $request = $this->executeChannelGroupActionRequest($id, $body, $x_accept_version); + $request = $this->executeChannelGroupActionRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -646,7 +640,7 @@ public function executeChannelGroupActionWithHttpInfo($id, $body, $x_accept_vers "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -689,14 +683,14 @@ public function executeChannelGroupActionWithHttpInfo($id, $body, $x_accept_vers * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeChannelGroupActionAsync($id, $body, $x_accept_version = null) + public function executeChannelGroupActionAsync($id, $body, $xAcceptVersion = null) { - return $this->executeChannelGroupActionAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->executeChannelGroupActionAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -711,15 +705,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeChannelGroupActionAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function executeChannelGroupActionAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = ''; - $request = $this->executeChannelGroupActionRequest($id, $body, $x_accept_version); + $request = $this->executeChannelGroupActionRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -749,21 +743,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function executeChannelGroupActionRequest($id, $body, $x_accept_version = null) + protected function executeChannelGroupActionRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling executeChannelGroupAction' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling executeChannelGroupAction' ); @@ -777,8 +771,8 @@ protected function executeChannelGroupActionRequest($id, $body, $x_accept_versio $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -797,7 +791,7 @@ protected function executeChannelGroupActionRequest($id, $body, $x_accept_versio } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -836,11 +830,6 @@ protected function executeChannelGroupActionRequest($id, $body, $x_accept_versio } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -872,16 +861,16 @@ protected function executeChannelGroupActionRequest($id, $body, $x_accept_versio * Get channel group by ID * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup */ - public function getChannelGroup($id, $x_accept_version = null, $include = null) + public function getChannelGroup($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getChannelGroupWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getChannelGroupWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -891,17 +880,17 @@ public function getChannelGroup($id, $x_accept_version = null, $include = null) * Get channel group by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) */ - public function getChannelGroupWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getChannelGroupWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->getChannelGroupRequest($id, $x_accept_version, $include); + $request = $this->getChannelGroupRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -912,7 +901,7 @@ public function getChannelGroupWithHttpInfo($id, $x_accept_version = null, $incl "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -968,15 +957,15 @@ public function getChannelGroupWithHttpInfo($id, $x_accept_version = null, $incl * Get channel group by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupAsync($id, $x_accept_version = null, $include = null) + public function getChannelGroupAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getChannelGroupAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -990,16 +979,16 @@ function ($response) { * Get channel group by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->getChannelGroupRequest($id, $x_accept_version, $include); + $request = $this->getChannelGroupRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1042,16 +1031,16 @@ function ($exception) { * Create request for operation 'getChannelGroup' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelGroupRequest($id, $x_accept_version = null, $include = null) + protected function getChannelGroupRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getChannelGroup' ); @@ -1072,8 +1061,8 @@ protected function getChannelGroupRequest($id, $x_accept_version = null, $includ $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1089,7 +1078,7 @@ protected function getChannelGroupRequest($id, $x_accept_version = null, $includ $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1128,11 +1117,6 @@ protected function getChannelGroupRequest($id, $x_accept_version = null, $includ } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1163,16 +1147,16 @@ protected function getChannelGroupRequest($id, $x_accept_version = null, $includ * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup[] */ - public function getChannelGroups($x_accept_version = null, $include = null) + public function getChannelGroups($xAcceptVersion = null, $include = null) { - list($response) = $this->getChannelGroupsWithHttpInfo($x_accept_version, $include); + list($response) = $this->getChannelGroupsWithHttpInfo($xAcceptVersion, $include); return $response; } @@ -1181,17 +1165,17 @@ public function getChannelGroups($x_accept_version = null, $include = null) * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelGroupsWithHttpInfo($x_accept_version = null, $include = null) + public function getChannelGroupsWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup[]'; - $request = $this->getChannelGroupsRequest($x_accept_version, $include); + $request = $this->getChannelGroupsRequest($xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -1202,7 +1186,7 @@ public function getChannelGroupsWithHttpInfo($x_accept_version = null, $include "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1257,15 +1241,15 @@ public function getChannelGroupsWithHttpInfo($x_accept_version = null, $include * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupsAsync($x_accept_version = null, $include = null) + public function getChannelGroupsAsync($xAcceptVersion = null, $include = null) { - return $this->getChannelGroupsAsyncWithHttpInfo($x_accept_version, $include) + return $this->getChannelGroupsAsyncWithHttpInfo($xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -1278,16 +1262,16 @@ function ($response) { * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupsAsyncWithHttpInfo($x_accept_version = null, $include = null) + public function getChannelGroupsAsyncWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup[]'; - $request = $this->getChannelGroupsRequest($x_accept_version, $include); + $request = $this->getChannelGroupsRequest($xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1329,13 +1313,13 @@ function ($exception) { /** * Create request for operation 'getChannelGroups' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelGroupsRequest($x_accept_version = null, $include = null) + protected function getChannelGroupsRequest($xAcceptVersion = null, $include = null) { $resourcePath = '/channel-groups'; @@ -1353,8 +1337,8 @@ protected function getChannelGroupsRequest($x_accept_version = null, $include = $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -1362,7 +1346,7 @@ protected function getChannelGroupsRequest($x_accept_version = null, $include = $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1401,11 +1385,6 @@ protected function getChannelGroupsRequest($x_accept_version = null, $include = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1438,15 +1417,15 @@ protected function getChannelGroupsRequest($x_accept_version = null, $include = * * @param int $id id (required) * @param \Swagger\Client\Model\Body5 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup */ - public function updateChannelGroup($id, $body, $x_accept_version = null) + public function updateChannelGroup($id, $body, $xAcceptVersion = null) { - list($response) = $this->updateChannelGroupWithHttpInfo($id, $body, $x_accept_version); + list($response) = $this->updateChannelGroupWithHttpInfo($id, $body, $xAcceptVersion); return $response; } @@ -1457,16 +1436,16 @@ public function updateChannelGroup($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) */ - public function updateChannelGroupWithHttpInfo($id, $body, $x_accept_version = null) + public function updateChannelGroupWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->updateChannelGroupRequest($id, $body, $x_accept_version); + $request = $this->updateChannelGroupRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -1477,7 +1456,7 @@ public function updateChannelGroupWithHttpInfo($id, $body, $x_accept_version = n "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1534,14 +1513,14 @@ public function updateChannelGroupWithHttpInfo($id, $body, $x_accept_version = n * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelGroupAsync($id, $body, $x_accept_version = null) + public function updateChannelGroupAsync($id, $body, $xAcceptVersion = null) { - return $this->updateChannelGroupAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->updateChannelGroupAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -1556,15 +1535,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelGroupAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function updateChannelGroupAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->updateChannelGroupRequest($id, $body, $x_accept_version); + $request = $this->updateChannelGroupRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1608,21 +1587,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateChannelGroupRequest($id, $body, $x_accept_version = null) + protected function updateChannelGroupRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateChannelGroup' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateChannelGroup' ); @@ -1636,8 +1615,8 @@ protected function updateChannelGroupRequest($id, $body, $x_accept_version = nul $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1656,7 +1635,7 @@ protected function updateChannelGroupRequest($id, $body, $x_accept_version = nul } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1695,11 +1674,6 @@ protected function updateChannelGroupRequest($id, $body, $x_accept_version = nul } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/ChannelsApi.php b/lib/Api/ChannelsApi.php index 76305c6..b94c3f8 100644 --- a/lib/Api/ChannelsApi.php +++ b/lib/Api/ChannelsApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ChannelsApi @@ -60,6 +59,11 @@ class ChannelsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -90,15 +94,15 @@ public function getConfig() * * @param int $id id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function executeAction($id, $body, $x_accept_version = null) + public function executeAction($id, $body, $xAcceptVersion = null) { - $this->executeActionWithHttpInfo($id, $body, $x_accept_version); + $this->executeActionWithHttpInfo($id, $body, $xAcceptVersion); } /** @@ -108,16 +112,16 @@ public function executeAction($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function executeActionWithHttpInfo($id, $body, $x_accept_version = null) + public function executeActionWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = ''; - $request = $this->executeActionRequest($id, $body, $x_accept_version); + $request = $this->executeActionRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -128,7 +132,7 @@ public function executeActionWithHttpInfo($id, $body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -171,14 +175,14 @@ public function executeActionWithHttpInfo($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeActionAsync($id, $body, $x_accept_version = null) + public function executeActionAsync($id, $body, $xAcceptVersion = null) { - return $this->executeActionAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->executeActionAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -193,15 +197,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeActionAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function executeActionAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = ''; - $request = $this->executeActionRequest($id, $body, $x_accept_version); + $request = $this->executeActionRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -231,21 +235,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function executeActionRequest($id, $body, $x_accept_version = null) + protected function executeActionRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling executeAction' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling executeAction' ); @@ -259,8 +263,8 @@ protected function executeActionRequest($id, $body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -279,7 +283,7 @@ protected function executeActionRequest($id, $body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -318,11 +322,6 @@ protected function executeActionRequest($id, $body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -354,16 +353,16 @@ protected function executeActionRequest($id, $body, $x_accept_version = null) * Get channel by ID * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel */ - public function getChannel($id, $x_accept_version = null, $include = null) + public function getChannel($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getChannelWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getChannelWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -373,17 +372,17 @@ public function getChannel($id, $x_accept_version = null, $include = null) * Get channel by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) */ - public function getChannelWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getChannelWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getChannelRequest($id, $x_accept_version, $include); + $request = $this->getChannelRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -394,7 +393,7 @@ public function getChannelWithHttpInfo($id, $x_accept_version = null, $include = "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -450,15 +449,15 @@ public function getChannelWithHttpInfo($id, $x_accept_version = null, $include = * Get channel by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelAsync($id, $x_accept_version = null, $include = null) + public function getChannelAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getChannelAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getChannelAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -472,16 +471,16 @@ function ($response) { * Get channel by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getChannelAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getChannelRequest($id, $x_accept_version, $include); + $request = $this->getChannelRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -524,16 +523,16 @@ function ($exception) { * Create request for operation 'getChannel' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelRequest($id, $x_accept_version = null, $include = null) + protected function getChannelRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getChannel' ); @@ -554,8 +553,8 @@ protected function getChannelRequest($id, $x_accept_version = null, $include = n $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -571,7 +570,7 @@ protected function getChannelRequest($id, $x_accept_version = null, $include = n $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -610,11 +609,6 @@ protected function getChannelRequest($id, $x_accept_version = null, $include = n } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -646,17 +640,17 @@ protected function getChannelRequest($id, $x_accept_version = null, $include = n * Get measurement logs. * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse2004[] + * @return \Swagger\Client\Model\InlineResponse2003[] */ - public function getChannelMeasurementLogs($id, $x_accept_version = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogs($id, $xAcceptVersion = null, $limit = '5000', $offset = null) { - list($response) = $this->getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version, $limit, $offset); + list($response) = $this->getChannelMeasurementLogsWithHttpInfo($id, $xAcceptVersion, $limit, $offset); return $response; } @@ -666,18 +660,18 @@ public function getChannelMeasurementLogs($id, $x_accept_version = null, $limit * Get measurement logs. * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse2004[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\InlineResponse2003[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogsWithHttpInfo($id, $xAcceptVersion = null, $limit = '5000', $offset = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2004[]'; - $request = $this->getChannelMeasurementLogsRequest($id, $x_accept_version, $limit, $offset); + $returnType = '\Swagger\Client\Model\InlineResponse2003[]'; + $request = $this->getChannelMeasurementLogsRequest($id, $xAcceptVersion, $limit, $offset); try { $options = $this->createHttpClientOption(); @@ -688,7 +682,7 @@ public function getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version = n "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -728,7 +722,7 @@ public function getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse2004[]', + '\Swagger\Client\Model\InlineResponse2003[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -752,16 +746,16 @@ public function getChannelMeasurementLogsWithHttpInfo($id, $x_accept_version = n * Get measurement logs. * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsAsync($id, $x_accept_version = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogsAsync($id, $xAcceptVersion = null, $limit = '5000', $offset = null) { - return $this->getChannelMeasurementLogsAsyncWithHttpInfo($id, $x_accept_version, $limit, $offset) + return $this->getChannelMeasurementLogsAsyncWithHttpInfo($id, $xAcceptVersion, $limit, $offset) ->then( function ($response) { return $response[0]; @@ -775,17 +769,17 @@ function ($response) { * Get measurement logs. * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsAsyncWithHttpInfo($id, $x_accept_version = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogsAsyncWithHttpInfo($id, $xAcceptVersion = null, $limit = '5000', $offset = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2004[]'; - $request = $this->getChannelMeasurementLogsRequest($id, $x_accept_version, $limit, $offset); + $returnType = '\Swagger\Client\Model\InlineResponse2003[]'; + $request = $this->getChannelMeasurementLogsRequest($id, $xAcceptVersion, $limit, $offset); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -828,17 +822,17 @@ function ($exception) { * Create request for operation 'getChannelMeasurementLogs' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelMeasurementLogsRequest($id, $x_accept_version = null, $limit = '5000', $offset = null) + protected function getChannelMeasurementLogsRequest($id, $xAcceptVersion = null, $limit = '5000', $offset = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getChannelMeasurementLogs' ); @@ -860,8 +854,8 @@ protected function getChannelMeasurementLogsRequest($id, $x_accept_version = nul $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -877,7 +871,7 @@ protected function getChannelMeasurementLogsRequest($id, $x_accept_version = nul $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -916,11 +910,6 @@ protected function getChannelMeasurementLogsRequest($id, $x_accept_version = nul } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -952,15 +941,15 @@ protected function getChannelMeasurementLogsRequest($id, $x_accept_version = nul * Get measurement logs as zipped CSV file. * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \SplFileObject */ - public function getChannelMeasurementLogsCsvFile($id, $x_accept_version = null) + public function getChannelMeasurementLogsCsvFile($id, $xAcceptVersion = null) { - list($response) = $this->getChannelMeasurementLogsCsvFileWithHttpInfo($id, $x_accept_version); + list($response) = $this->getChannelMeasurementLogsCsvFileWithHttpInfo($id, $xAcceptVersion); return $response; } @@ -970,16 +959,16 @@ public function getChannelMeasurementLogsCsvFile($id, $x_accept_version = null) * Get measurement logs as zipped CSV file. * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $x_accept_version = null) + public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $xAcceptVersion = null) { $returnType = '\SplFileObject'; - $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $x_accept_version); + $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -990,7 +979,7 @@ public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $x_accept_vers "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1054,14 +1043,14 @@ public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $x_accept_vers * Get measurement logs as zipped CSV file. * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsCsvFileAsync($id, $x_accept_version = null) + public function getChannelMeasurementLogsCsvFileAsync($id, $xAcceptVersion = null) { - return $this->getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $x_accept_version) + return $this->getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -1075,15 +1064,15 @@ function ($response) { * Get measurement logs as zipped CSV file. * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $x_accept_version = null) + public function getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $xAcceptVersion = null) { $returnType = '\SplFileObject'; - $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $x_accept_version); + $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1126,15 +1115,15 @@ function ($exception) { * Create request for operation 'getChannelMeasurementLogsCsvFile' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelMeasurementLogsCsvFileRequest($id, $x_accept_version = null) + protected function getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getChannelMeasurementLogsCsvFile' ); @@ -1148,8 +1137,8 @@ protected function getChannelMeasurementLogsCsvFileRequest($id, $x_accept_versio $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1165,7 +1154,7 @@ protected function getChannelMeasurementLogsCsvFileRequest($id, $x_accept_versio $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/zip'] ); } else { @@ -1204,11 +1193,6 @@ protected function getChannelMeasurementLogsCsvFileRequest($id, $x_accept_versio } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1240,16 +1224,16 @@ protected function getChannelMeasurementLogsCsvFileRequest($id, $x_accept_versio * Get schedules list of the channel * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule[] */ - public function getChannelSchedules($id, $x_accept_version = null, $include = null) + public function getChannelSchedules($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getChannelSchedulesWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getChannelSchedulesWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -1259,17 +1243,17 @@ public function getChannelSchedules($id, $x_accept_version = null, $include = nu * Get schedules list of the channel * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelSchedulesWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getChannelSchedulesWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getChannelSchedulesRequest($id, $x_accept_version, $include); + $request = $this->getChannelSchedulesRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -1280,7 +1264,7 @@ public function getChannelSchedulesWithHttpInfo($id, $x_accept_version = null, $ "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1336,15 +1320,15 @@ public function getChannelSchedulesWithHttpInfo($id, $x_accept_version = null, $ * Get schedules list of the channel * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelSchedulesAsync($id, $x_accept_version = null, $include = null) + public function getChannelSchedulesAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getChannelSchedulesAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getChannelSchedulesAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -1358,16 +1342,16 @@ function ($response) { * Get schedules list of the channel * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelSchedulesAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getChannelSchedulesAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getChannelSchedulesRequest($id, $x_accept_version, $include); + $request = $this->getChannelSchedulesRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1410,16 +1394,16 @@ function ($exception) { * Create request for operation 'getChannelSchedules' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelSchedulesRequest($id, $x_accept_version = null, $include = null) + protected function getChannelSchedulesRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getChannelSchedules' ); @@ -1440,8 +1424,8 @@ protected function getChannelSchedulesRequest($id, $x_accept_version = null, $in $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1457,7 +1441,7 @@ protected function getChannelSchedulesRequest($id, $x_accept_version = null, $in $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1496,11 +1480,6 @@ protected function getChannelSchedulesRequest($id, $x_accept_version = null, $in } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1531,19 +1510,19 @@ protected function getChannelSchedulesRequest($id, $x_accept_version = null, $in * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function function (optional) * @param string $io Return only `input` or `output` channels. (optional) - * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * @param bool $hasFunction Return only channels with (`true`) or without (`false`) chosen functions. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel[] */ - public function getChannels($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + public function getChannels($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) { - list($response) = $this->getChannelsWithHttpInfo($x_accept_version, $include, $function, $io, $has_function); + list($response) = $this->getChannelsWithHttpInfo($xAcceptVersion, $include, $function, $io, $hasFunction); return $response; } @@ -1552,20 +1531,20 @@ public function getChannels($x_accept_version = null, $include = null, $function * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) - * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * @param bool $hasFunction Return only channels with (`true`) or without (`false`) chosen functions. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelsWithHttpInfo($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + public function getChannelsWithHttpInfo($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) { $returnType = '\Swagger\Client\Model\Channel[]'; - $request = $this->getChannelsRequest($x_accept_version, $include, $function, $io, $has_function); + $request = $this->getChannelsRequest($xAcceptVersion, $include, $function, $io, $hasFunction); try { $options = $this->createHttpClientOption(); @@ -1576,7 +1555,7 @@ public function getChannelsWithHttpInfo($x_accept_version = null, $include = nul "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1631,18 +1610,18 @@ public function getChannelsWithHttpInfo($x_accept_version = null, $include = nul * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) - * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * @param bool $hasFunction Return only channels with (`true`) or without (`false`) chosen functions. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelsAsync($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + public function getChannelsAsync($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) { - return $this->getChannelsAsyncWithHttpInfo($x_accept_version, $include, $function, $io, $has_function) + return $this->getChannelsAsyncWithHttpInfo($xAcceptVersion, $include, $function, $io, $hasFunction) ->then( function ($response) { return $response[0]; @@ -1655,19 +1634,19 @@ function ($response) { * * Get channels list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) - * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * @param bool $hasFunction Return only channels with (`true`) or without (`false`) chosen functions. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelsAsyncWithHttpInfo($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + public function getChannelsAsyncWithHttpInfo($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) { $returnType = '\Swagger\Client\Model\Channel[]'; - $request = $this->getChannelsRequest($x_accept_version, $include, $function, $io, $has_function); + $request = $this->getChannelsRequest($xAcceptVersion, $include, $function, $io, $hasFunction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1709,16 +1688,16 @@ function ($exception) { /** * Create request for operation 'getChannels' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) - * @param bool $has_function Return only channels with (`true`) or without (`false`) chosen functions. (optional) + * @param bool $hasFunction Return only channels with (`true`) or without (`false`) chosen functions. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelsRequest($x_accept_version = null, $include = null, $function = null, $io = null, $has_function = null) + protected function getChannelsRequest($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) { $resourcePath = '/channels'; @@ -1747,12 +1726,12 @@ protected function getChannelsRequest($x_accept_version = null, $include = null, $queryParams['io'] = ObjectSerializer::toQueryValue($io); } // query params - if ($has_function !== null) { - $queryParams['hasFunction'] = ObjectSerializer::toQueryValue($has_function); + if ($hasFunction !== null) { + $queryParams['hasFunction'] = ObjectSerializer::toQueryValue($hasFunction); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -1760,7 +1739,7 @@ protected function getChannelsRequest($x_accept_version = null, $include = null, $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1799,11 +1778,6 @@ protected function getChannelsRequest($x_accept_version = null, $include = null, } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1836,15 +1810,15 @@ protected function getChannelsRequest($x_accept_version = null, $include = null, * * @param int $id id (required) * @param \Swagger\Client\Model\Body2 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel */ - public function updateChannel($id, $body, $x_accept_version = null) + public function updateChannel($id, $body, $xAcceptVersion = null) { - list($response) = $this->updateChannelWithHttpInfo($id, $body, $x_accept_version); + list($response) = $this->updateChannelWithHttpInfo($id, $body, $xAcceptVersion); return $response; } @@ -1855,16 +1829,16 @@ public function updateChannel($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) */ - public function updateChannelWithHttpInfo($id, $body, $x_accept_version = null) + public function updateChannelWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->updateChannelRequest($id, $body, $x_accept_version); + $request = $this->updateChannelRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -1875,7 +1849,7 @@ public function updateChannelWithHttpInfo($id, $body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1940,14 +1914,14 @@ public function updateChannelWithHttpInfo($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelAsync($id, $body, $x_accept_version = null) + public function updateChannelAsync($id, $body, $xAcceptVersion = null) { - return $this->updateChannelAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->updateChannelAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -1962,15 +1936,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function updateChannelAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->updateChannelRequest($id, $body, $x_accept_version); + $request = $this->updateChannelRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2014,21 +1988,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateChannelRequest($id, $body, $x_accept_version = null) + protected function updateChannelRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateChannel' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateChannel' ); @@ -2042,8 +2016,8 @@ protected function updateChannelRequest($id, $body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -2062,7 +2036,7 @@ protected function updateChannelRequest($id, $body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -2101,11 +2075,6 @@ protected function updateChannelRequest($id, $body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/ClientAppsApi.php b/lib/Api/ClientAppsApi.php index a712e62..487d5f5 100644 --- a/lib/Api/ClientAppsApi.php +++ b/lib/Api/ClientAppsApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ClientAppsApi @@ -60,6 +59,11 @@ class ClientAppsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -89,15 +93,15 @@ public function getConfig() * Delete Client App * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteClientApp($id, $x_accept_version = null) + public function deleteClientApp($id, $xAcceptVersion = null) { - $this->deleteClientAppWithHttpInfo($id, $x_accept_version); + $this->deleteClientAppWithHttpInfo($id, $xAcceptVersion); } /** @@ -106,16 +110,16 @@ public function deleteClientApp($id, $x_accept_version = null) * Delete Client App * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteClientAppWithHttpInfo($id, $x_accept_version = null) + public function deleteClientAppWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteClientAppRequest($id, $x_accept_version); + $request = $this->deleteClientAppRequest($id, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -126,7 +130,7 @@ public function deleteClientAppWithHttpInfo($id, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -160,14 +164,14 @@ public function deleteClientAppWithHttpInfo($id, $x_accept_version = null) * Delete Client App * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteClientAppAsync($id, $x_accept_version = null) + public function deleteClientAppAsync($id, $xAcceptVersion = null) { - return $this->deleteClientAppAsyncWithHttpInfo($id, $x_accept_version) + return $this->deleteClientAppAsyncWithHttpInfo($id, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -181,15 +185,15 @@ function ($response) { * Delete Client App * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteClientAppAsyncWithHttpInfo($id, $x_accept_version = null) + public function deleteClientAppAsyncWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteClientAppRequest($id, $x_accept_version); + $request = $this->deleteClientAppRequest($id, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -218,15 +222,15 @@ function ($exception) { * Create request for operation 'deleteClientApp' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteClientAppRequest($id, $x_accept_version = null) + protected function deleteClientAppRequest($id, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling deleteClientApp' ); @@ -240,8 +244,8 @@ protected function deleteClientAppRequest($id, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -257,7 +261,7 @@ protected function deleteClientAppRequest($id, $x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -296,11 +300,6 @@ protected function deleteClientAppRequest($id, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -331,16 +330,16 @@ protected function deleteClientAppRequest($id, $x_accept_version = null) * * Get client apps * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ClientApp[] */ - public function getClientApps($x_accept_version = null, $include = null) + public function getClientApps($xAcceptVersion = null, $include = null) { - list($response) = $this->getClientAppsWithHttpInfo($x_accept_version, $include); + list($response) = $this->getClientAppsWithHttpInfo($xAcceptVersion, $include); return $response; } @@ -349,17 +348,17 @@ public function getClientApps($x_accept_version = null, $include = null) * * Get client apps * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ClientApp[], HTTP status code, HTTP response headers (array of strings) */ - public function getClientAppsWithHttpInfo($x_accept_version = null, $include = null) + public function getClientAppsWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\ClientApp[]'; - $request = $this->getClientAppsRequest($x_accept_version, $include); + $request = $this->getClientAppsRequest($xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -370,7 +369,7 @@ public function getClientAppsWithHttpInfo($x_accept_version = null, $include = n "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -425,15 +424,15 @@ public function getClientAppsWithHttpInfo($x_accept_version = null, $include = n * * Get client apps * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getClientAppsAsync($x_accept_version = null, $include = null) + public function getClientAppsAsync($xAcceptVersion = null, $include = null) { - return $this->getClientAppsAsyncWithHttpInfo($x_accept_version, $include) + return $this->getClientAppsAsyncWithHttpInfo($xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -446,16 +445,16 @@ function ($response) { * * Get client apps * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getClientAppsAsyncWithHttpInfo($x_accept_version = null, $include = null) + public function getClientAppsAsyncWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\ClientApp[]'; - $request = $this->getClientAppsRequest($x_accept_version, $include); + $request = $this->getClientAppsRequest($xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -497,13 +496,13 @@ function ($exception) { /** * Create request for operation 'getClientApps' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getClientAppsRequest($x_accept_version = null, $include = null) + protected function getClientAppsRequest($xAcceptVersion = null, $include = null) { $resourcePath = '/client-apps'; @@ -521,8 +520,8 @@ protected function getClientAppsRequest($x_accept_version = null, $include = nul $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -530,7 +529,7 @@ protected function getClientAppsRequest($x_accept_version = null, $include = nul $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -569,11 +568,6 @@ protected function getClientAppsRequest($x_accept_version = null, $include = nul } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -606,15 +600,15 @@ protected function getClientAppsRequest($x_accept_version = null, $include = nul * * @param int $id id (required) * @param \Swagger\Client\Model\Body7 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ClientApp */ - public function updateClientApp($id, $body, $x_accept_version = null) + public function updateClientApp($id, $body, $xAcceptVersion = null) { - list($response) = $this->updateClientAppWithHttpInfo($id, $body, $x_accept_version); + list($response) = $this->updateClientAppWithHttpInfo($id, $body, $xAcceptVersion); return $response; } @@ -625,16 +619,16 @@ public function updateClientApp($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ClientApp, HTTP status code, HTTP response headers (array of strings) */ - public function updateClientAppWithHttpInfo($id, $body, $x_accept_version = null) + public function updateClientAppWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\ClientApp'; - $request = $this->updateClientAppRequest($id, $body, $x_accept_version); + $request = $this->updateClientAppRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -645,7 +639,7 @@ public function updateClientAppWithHttpInfo($id, $body, $x_accept_version = null "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -702,14 +696,14 @@ public function updateClientAppWithHttpInfo($id, $body, $x_accept_version = null * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateClientAppAsync($id, $body, $x_accept_version = null) + public function updateClientAppAsync($id, $body, $xAcceptVersion = null) { - return $this->updateClientAppAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->updateClientAppAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -724,15 +718,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateClientAppAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function updateClientAppAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\ClientApp'; - $request = $this->updateClientAppRequest($id, $body, $x_accept_version); + $request = $this->updateClientAppRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -776,21 +770,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateClientAppRequest($id, $body, $x_accept_version = null) + protected function updateClientAppRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateClientApp' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateClientApp' ); @@ -804,8 +798,8 @@ protected function updateClientAppRequest($id, $body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -824,7 +818,7 @@ protected function updateClientAppRequest($id, $body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -863,11 +857,6 @@ protected function updateClientAppRequest($id, $body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/IODevicesApi.php b/lib/Api/IODevicesApi.php index e6198d0..9cae5a2 100644 --- a/lib/Api/IODevicesApi.php +++ b/lib/Api/IODevicesApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class IODevicesApi @@ -60,6 +59,11 @@ class IODevicesApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -89,15 +93,15 @@ public function getConfig() * Delete IO Device * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteIoDevice($id, $x_accept_version = null) + public function deleteIoDevice($id, $xAcceptVersion = null) { - $this->deleteIoDeviceWithHttpInfo($id, $x_accept_version); + $this->deleteIoDeviceWithHttpInfo($id, $xAcceptVersion); } /** @@ -106,16 +110,16 @@ public function deleteIoDevice($id, $x_accept_version = null) * Delete IO Device * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteIoDeviceWithHttpInfo($id, $x_accept_version = null) + public function deleteIoDeviceWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteIoDeviceRequest($id, $x_accept_version); + $request = $this->deleteIoDeviceRequest($id, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -126,7 +130,7 @@ public function deleteIoDeviceWithHttpInfo($id, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -160,14 +164,14 @@ public function deleteIoDeviceWithHttpInfo($id, $x_accept_version = null) * Delete IO Device * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteIoDeviceAsync($id, $x_accept_version = null) + public function deleteIoDeviceAsync($id, $xAcceptVersion = null) { - return $this->deleteIoDeviceAsyncWithHttpInfo($id, $x_accept_version) + return $this->deleteIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -181,15 +185,15 @@ function ($response) { * Delete IO Device * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteIoDeviceAsyncWithHttpInfo($id, $x_accept_version = null) + public function deleteIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteIoDeviceRequest($id, $x_accept_version); + $request = $this->deleteIoDeviceRequest($id, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -218,15 +222,15 @@ function ($exception) { * Create request for operation 'deleteIoDevice' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteIoDeviceRequest($id, $x_accept_version = null) + protected function deleteIoDeviceRequest($id, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling deleteIoDevice' ); @@ -240,8 +244,8 @@ protected function deleteIoDeviceRequest($id, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -257,7 +261,7 @@ protected function deleteIoDeviceRequest($id, $x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -296,11 +300,6 @@ protected function deleteIoDeviceRequest($id, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -332,16 +331,16 @@ protected function deleteIoDeviceRequest($id, $x_accept_version = null) * Get IO Device * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Device */ - public function getIoDevice($id, $x_accept_version = null, $include = null) + public function getIoDevice($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getIoDeviceWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getIoDeviceWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -351,17 +350,17 @@ public function getIoDevice($id, $x_accept_version = null, $include = null) * Get IO Device * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Device, HTTP status code, HTTP response headers (array of strings) */ - public function getIoDeviceWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getIoDeviceWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->getIoDeviceRequest($id, $x_accept_version, $include); + $request = $this->getIoDeviceRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -372,7 +371,7 @@ public function getIoDeviceWithHttpInfo($id, $x_accept_version = null, $include "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -428,15 +427,15 @@ public function getIoDeviceWithHttpInfo($id, $x_accept_version = null, $include * Get IO Device * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceAsync($id, $x_accept_version = null, $include = null) + public function getIoDeviceAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getIoDeviceAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -450,16 +449,16 @@ function ($response) { * Get IO Device * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->getIoDeviceRequest($id, $x_accept_version, $include); + $request = $this->getIoDeviceRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -502,16 +501,16 @@ function ($exception) { * Create request for operation 'getIoDevice' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIoDeviceRequest($id, $x_accept_version = null, $include = null) + protected function getIoDeviceRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getIoDevice' ); @@ -532,8 +531,8 @@ protected function getIoDeviceRequest($id, $x_accept_version = null, $include = $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -549,7 +548,7 @@ protected function getIoDeviceRequest($id, $x_accept_version = null, $include = $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -588,11 +587,6 @@ protected function getIoDeviceRequest($id, $x_accept_version = null, $include = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -624,16 +618,16 @@ protected function getIoDeviceRequest($id, $x_accept_version = null, $include = * Get Channels that belong to IO Deice * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel */ - public function getIoDeviceChannels($id, $x_accept_version = null, $include = null) + public function getIoDeviceChannels($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getIoDeviceChannelsWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getIoDeviceChannelsWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -643,17 +637,17 @@ public function getIoDeviceChannels($id, $x_accept_version = null, $include = nu * Get Channels that belong to IO Deice * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) */ - public function getIoDeviceChannelsWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getIoDeviceChannelsWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getIoDeviceChannelsRequest($id, $x_accept_version, $include); + $request = $this->getIoDeviceChannelsRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -664,7 +658,7 @@ public function getIoDeviceChannelsWithHttpInfo($id, $x_accept_version = null, $ "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -720,15 +714,15 @@ public function getIoDeviceChannelsWithHttpInfo($id, $x_accept_version = null, $ * Get Channels that belong to IO Deice * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceChannelsAsync($id, $x_accept_version = null, $include = null) + public function getIoDeviceChannelsAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getIoDeviceChannelsAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getIoDeviceChannelsAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -742,16 +736,16 @@ function ($response) { * Get Channels that belong to IO Deice * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceChannelsAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getIoDeviceChannelsAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getIoDeviceChannelsRequest($id, $x_accept_version, $include); + $request = $this->getIoDeviceChannelsRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -794,16 +788,16 @@ function ($exception) { * Create request for operation 'getIoDeviceChannels' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIoDeviceChannelsRequest($id, $x_accept_version = null, $include = null) + protected function getIoDeviceChannelsRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getIoDeviceChannels' ); @@ -824,8 +818,8 @@ protected function getIoDeviceChannelsRequest($id, $x_accept_version = null, $in $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -841,7 +835,7 @@ protected function getIoDeviceChannelsRequest($id, $x_accept_version = null, $in $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -880,11 +874,6 @@ protected function getIoDeviceChannelsRequest($id, $x_accept_version = null, $in } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -915,16 +904,16 @@ protected function getIoDeviceChannelsRequest($id, $x_accept_version = null, $in * * Get IO Devices * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Device[] */ - public function getIoDevices($x_accept_version = null, $include = null) + public function getIoDevices($xAcceptVersion = null, $include = null) { - list($response) = $this->getIoDevicesWithHttpInfo($x_accept_version, $include); + list($response) = $this->getIoDevicesWithHttpInfo($xAcceptVersion, $include); return $response; } @@ -933,17 +922,17 @@ public function getIoDevices($x_accept_version = null, $include = null) * * Get IO Devices * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Device[], HTTP status code, HTTP response headers (array of strings) */ - public function getIoDevicesWithHttpInfo($x_accept_version = null, $include = null) + public function getIoDevicesWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Device[]'; - $request = $this->getIoDevicesRequest($x_accept_version, $include); + $request = $this->getIoDevicesRequest($xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -954,7 +943,7 @@ public function getIoDevicesWithHttpInfo($x_accept_version = null, $include = nu "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1009,15 +998,15 @@ public function getIoDevicesWithHttpInfo($x_accept_version = null, $include = nu * * Get IO Devices * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDevicesAsync($x_accept_version = null, $include = null) + public function getIoDevicesAsync($xAcceptVersion = null, $include = null) { - return $this->getIoDevicesAsyncWithHttpInfo($x_accept_version, $include) + return $this->getIoDevicesAsyncWithHttpInfo($xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -1030,16 +1019,16 @@ function ($response) { * * Get IO Devices * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDevicesAsyncWithHttpInfo($x_accept_version = null, $include = null) + public function getIoDevicesAsyncWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Device[]'; - $request = $this->getIoDevicesRequest($x_accept_version, $include); + $request = $this->getIoDevicesRequest($xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1081,13 +1070,13 @@ function ($exception) { /** * Create request for operation 'getIoDevices' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIoDevicesRequest($x_accept_version = null, $include = null) + protected function getIoDevicesRequest($xAcceptVersion = null, $include = null) { $resourcePath = '/iodevices'; @@ -1105,8 +1094,8 @@ protected function getIoDevicesRequest($x_accept_version = null, $include = null $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -1114,7 +1103,7 @@ protected function getIoDevicesRequest($x_accept_version = null, $include = null $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1153,11 +1142,6 @@ protected function getIoDevicesRequest($x_accept_version = null, $include = null } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1190,15 +1174,15 @@ protected function getIoDevicesRequest($x_accept_version = null, $include = null * * @param int $id id (required) * @param \Swagger\Client\Model\Body8 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Device */ - public function updateIoDevice($id, $body, $x_accept_version = null) + public function updateIoDevice($id, $body, $xAcceptVersion = null) { - list($response) = $this->updateIoDeviceWithHttpInfo($id, $body, $x_accept_version); + list($response) = $this->updateIoDeviceWithHttpInfo($id, $body, $xAcceptVersion); return $response; } @@ -1209,16 +1193,16 @@ public function updateIoDevice($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Device, HTTP status code, HTTP response headers (array of strings) */ - public function updateIoDeviceWithHttpInfo($id, $body, $x_accept_version = null) + public function updateIoDeviceWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->updateIoDeviceRequest($id, $body, $x_accept_version); + $request = $this->updateIoDeviceRequest($id, $body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -1229,7 +1213,7 @@ public function updateIoDeviceWithHttpInfo($id, $body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1286,14 +1270,14 @@ public function updateIoDeviceWithHttpInfo($id, $body, $x_accept_version = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateIoDeviceAsync($id, $body, $x_accept_version = null) + public function updateIoDeviceAsync($id, $body, $xAcceptVersion = null) { - return $this->updateIoDeviceAsyncWithHttpInfo($id, $body, $x_accept_version) + return $this->updateIoDeviceAsyncWithHttpInfo($id, $body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -1308,15 +1292,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateIoDeviceAsyncWithHttpInfo($id, $body, $x_accept_version = null) + public function updateIoDeviceAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->updateIoDeviceRequest($id, $body, $x_accept_version); + $request = $this->updateIoDeviceRequest($id, $body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1360,21 +1344,21 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateIoDeviceRequest($id, $body, $x_accept_version = null) + protected function updateIoDeviceRequest($id, $body, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateIoDevice' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateIoDevice' ); @@ -1388,8 +1372,8 @@ protected function updateIoDeviceRequest($id, $body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1408,7 +1392,7 @@ protected function updateIoDeviceRequest($id, $body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1447,11 +1431,6 @@ protected function updateIoDeviceRequest($id, $body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/LocationsApi.php b/lib/Api/LocationsApi.php index 49f96bc..a9e027d 100644 --- a/lib/Api/LocationsApi.php +++ b/lib/Api/LocationsApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class LocationsApi @@ -60,6 +59,11 @@ class LocationsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -88,15 +92,15 @@ public function getConfig() * * Create a new location * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location */ - public function createLocation($x_accept_version = null) + public function createLocation($xAcceptVersion = null) { - list($response) = $this->createLocationWithHttpInfo($x_accept_version); + list($response) = $this->createLocationWithHttpInfo($xAcceptVersion); return $response; } @@ -105,16 +109,16 @@ public function createLocation($x_accept_version = null) * * Create a new location * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) */ - public function createLocationWithHttpInfo($x_accept_version = null) + public function createLocationWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->createLocationRequest($x_accept_version); + $request = $this->createLocationRequest($xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -125,7 +129,7 @@ public function createLocationWithHttpInfo($x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -180,14 +184,14 @@ public function createLocationWithHttpInfo($x_accept_version = null) * * Create a new location * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLocationAsync($x_accept_version = null) + public function createLocationAsync($xAcceptVersion = null) { - return $this->createLocationAsyncWithHttpInfo($x_accept_version) + return $this->createLocationAsyncWithHttpInfo($xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -200,15 +204,15 @@ function ($response) { * * Create a new location * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLocationAsyncWithHttpInfo($x_accept_version = null) + public function createLocationAsyncWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->createLocationRequest($x_accept_version); + $request = $this->createLocationRequest($xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -250,12 +254,12 @@ function ($exception) { /** * Create request for operation 'createLocation' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createLocationRequest($x_accept_version = null) + protected function createLocationRequest($xAcceptVersion = null) { $resourcePath = '/locations'; @@ -266,8 +270,8 @@ protected function createLocationRequest($x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -275,7 +279,7 @@ protected function createLocationRequest($x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -314,11 +318,6 @@ protected function createLocationRequest($x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -350,16 +349,16 @@ protected function createLocationRequest($x_accept_version = null) * Delete location * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteLocation($id, $x_accept_version = null, $include = null) + public function deleteLocation($id, $xAcceptVersion = null, $include = null) { - $this->deleteLocationWithHttpInfo($id, $x_accept_version, $include); + $this->deleteLocationWithHttpInfo($id, $xAcceptVersion, $include); } /** @@ -368,17 +367,17 @@ public function deleteLocation($id, $x_accept_version = null, $include = null) * Delete location * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteLocationWithHttpInfo($id, $x_accept_version = null, $include = null) + public function deleteLocationWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = ''; - $request = $this->deleteLocationRequest($id, $x_accept_version, $include); + $request = $this->deleteLocationRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -389,7 +388,7 @@ public function deleteLocationWithHttpInfo($id, $x_accept_version = null, $inclu "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -423,15 +422,15 @@ public function deleteLocationWithHttpInfo($id, $x_accept_version = null, $inclu * Delete location * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteLocationAsync($id, $x_accept_version = null, $include = null) + public function deleteLocationAsync($id, $xAcceptVersion = null, $include = null) { - return $this->deleteLocationAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->deleteLocationAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -445,16 +444,16 @@ function ($response) { * Delete location * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteLocationAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function deleteLocationAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = ''; - $request = $this->deleteLocationRequest($id, $x_accept_version, $include); + $request = $this->deleteLocationRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -483,16 +482,16 @@ function ($exception) { * Create request for operation 'deleteLocation' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteLocationRequest($id, $x_accept_version = null, $include = null) + protected function deleteLocationRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling deleteLocation' ); @@ -513,8 +512,8 @@ protected function deleteLocationRequest($id, $x_accept_version = null, $include $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -530,7 +529,7 @@ protected function deleteLocationRequest($id, $x_accept_version = null, $include $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -569,11 +568,6 @@ protected function deleteLocationRequest($id, $x_accept_version = null, $include } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -605,16 +599,16 @@ protected function deleteLocationRequest($id, $x_accept_version = null, $include * Get location by ID * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location */ - public function getLocation($id, $x_accept_version = null, $include = null) + public function getLocation($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getLocationWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getLocationWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -624,17 +618,17 @@ public function getLocation($id, $x_accept_version = null, $include = null) * Get location by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) */ - public function getLocationWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getLocationWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->getLocationRequest($id, $x_accept_version, $include); + $request = $this->getLocationRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -645,7 +639,7 @@ public function getLocationWithHttpInfo($id, $x_accept_version = null, $include "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -701,15 +695,15 @@ public function getLocationWithHttpInfo($id, $x_accept_version = null, $include * Get location by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationAsync($id, $x_accept_version = null, $include = null) + public function getLocationAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getLocationAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getLocationAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -723,16 +717,16 @@ function ($response) { * Get location by ID * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getLocationAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->getLocationRequest($id, $x_accept_version, $include); + $request = $this->getLocationRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -775,16 +769,16 @@ function ($exception) { * Create request for operation 'getLocation' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLocationRequest($id, $x_accept_version = null, $include = null) + protected function getLocationRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getLocation' ); @@ -805,8 +799,8 @@ protected function getLocationRequest($id, $x_accept_version = null, $include = $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -822,7 +816,7 @@ protected function getLocationRequest($id, $x_accept_version = null, $include = $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -861,11 +855,6 @@ protected function getLocationRequest($id, $x_accept_version = null, $include = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -896,16 +885,16 @@ protected function getLocationRequest($id, $x_accept_version = null, $include = * * Get locations list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location[] */ - public function getLocations($x_accept_version = null, $include = null) + public function getLocations($xAcceptVersion = null, $include = null) { - list($response) = $this->getLocationsWithHttpInfo($x_accept_version, $include); + list($response) = $this->getLocationsWithHttpInfo($xAcceptVersion, $include); return $response; } @@ -914,17 +903,17 @@ public function getLocations($x_accept_version = null, $include = null) * * Get locations list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location[], HTTP status code, HTTP response headers (array of strings) */ - public function getLocationsWithHttpInfo($x_accept_version = null, $include = null) + public function getLocationsWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Location[]'; - $request = $this->getLocationsRequest($x_accept_version, $include); + $request = $this->getLocationsRequest($xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -935,7 +924,7 @@ public function getLocationsWithHttpInfo($x_accept_version = null, $include = nu "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -990,15 +979,15 @@ public function getLocationsWithHttpInfo($x_accept_version = null, $include = nu * * Get locations list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationsAsync($x_accept_version = null, $include = null) + public function getLocationsAsync($xAcceptVersion = null, $include = null) { - return $this->getLocationsAsyncWithHttpInfo($x_accept_version, $include) + return $this->getLocationsAsyncWithHttpInfo($xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -1011,16 +1000,16 @@ function ($response) { * * Get locations list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationsAsyncWithHttpInfo($x_accept_version = null, $include = null) + public function getLocationsAsyncWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Location[]'; - $request = $this->getLocationsRequest($x_accept_version, $include); + $request = $this->getLocationsRequest($xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1062,13 +1051,13 @@ function ($exception) { /** * Create request for operation 'getLocations' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLocationsRequest($x_accept_version = null, $include = null) + protected function getLocationsRequest($xAcceptVersion = null, $include = null) { $resourcePath = '/locations'; @@ -1086,8 +1075,8 @@ protected function getLocationsRequest($x_accept_version = null, $include = null $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -1095,7 +1084,7 @@ protected function getLocationsRequest($x_accept_version = null, $include = null $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1134,11 +1123,6 @@ protected function getLocationsRequest($x_accept_version = null, $include = null } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1171,16 +1155,16 @@ protected function getLocationsRequest($x_accept_version = null, $include = null * * @param int $id id (required) * @param \Swagger\Client\Model\Body1 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location */ - public function updateLocation($id, $body, $x_accept_version = null, $include = null) + public function updateLocation($id, $body, $xAcceptVersion = null, $include = null) { - list($response) = $this->updateLocationWithHttpInfo($id, $body, $x_accept_version, $include); + list($response) = $this->updateLocationWithHttpInfo($id, $body, $xAcceptVersion, $include); return $response; } @@ -1191,17 +1175,17 @@ public function updateLocation($id, $body, $x_accept_version = null, $include = * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) */ - public function updateLocationWithHttpInfo($id, $body, $x_accept_version = null, $include = null) + public function updateLocationWithHttpInfo($id, $body, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->updateLocationRequest($id, $body, $x_accept_version, $include); + $request = $this->updateLocationRequest($id, $body, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -1212,7 +1196,7 @@ public function updateLocationWithHttpInfo($id, $body, $x_accept_version = null, "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1269,15 +1253,15 @@ public function updateLocationWithHttpInfo($id, $body, $x_accept_version = null, * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLocationAsync($id, $body, $x_accept_version = null, $include = null) + public function updateLocationAsync($id, $body, $xAcceptVersion = null, $include = null) { - return $this->updateLocationAsyncWithHttpInfo($id, $body, $x_accept_version, $include) + return $this->updateLocationAsyncWithHttpInfo($id, $body, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -1292,16 +1276,16 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLocationAsyncWithHttpInfo($id, $body, $x_accept_version = null, $include = null) + public function updateLocationAsyncWithHttpInfo($id, $body, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->updateLocationRequest($id, $body, $x_accept_version, $include); + $request = $this->updateLocationRequest($id, $body, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1345,22 +1329,22 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateLocationRequest($id, $body, $x_accept_version = null, $include = null) + protected function updateLocationRequest($id, $body, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateLocation' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateLocation' ); @@ -1381,8 +1365,8 @@ protected function updateLocationRequest($id, $body, $x_accept_version = null, $ $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1401,7 +1385,7 @@ protected function updateLocationRequest($id, $body, $x_accept_version = null, $ } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1440,11 +1424,6 @@ protected function updateLocationRequest($id, $body, $x_accept_version = null, $ } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/SchedulesApi.php b/lib/Api/SchedulesApi.php index ab5f892..3e52c0c 100644 --- a/lib/Api/SchedulesApi.php +++ b/lib/Api/SchedulesApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class SchedulesApi @@ -60,6 +59,11 @@ class SchedulesApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -89,15 +93,15 @@ public function getConfig() * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule */ - public function createSchedule($body, $x_accept_version = null) + public function createSchedule($body, $xAcceptVersion = null) { - list($response) = $this->createScheduleWithHttpInfo($body, $x_accept_version); + list($response) = $this->createScheduleWithHttpInfo($body, $xAcceptVersion); return $response; } @@ -107,16 +111,16 @@ public function createSchedule($body, $x_accept_version = null) * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ - public function createScheduleWithHttpInfo($body, $x_accept_version = null) + public function createScheduleWithHttpInfo($body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->createScheduleRequest($body, $x_accept_version); + $request = $this->createScheduleRequest($body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -127,7 +131,7 @@ public function createScheduleWithHttpInfo($body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -183,14 +187,14 @@ public function createScheduleWithHttpInfo($body, $x_accept_version = null) * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createScheduleAsync($body, $x_accept_version = null) + public function createScheduleAsync($body, $xAcceptVersion = null) { - return $this->createScheduleAsyncWithHttpInfo($body, $x_accept_version) + return $this->createScheduleAsyncWithHttpInfo($body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -204,15 +208,15 @@ function ($response) { * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createScheduleAsyncWithHttpInfo($body, $x_accept_version = null) + public function createScheduleAsyncWithHttpInfo($body, $xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->createScheduleRequest($body, $x_accept_version); + $request = $this->createScheduleRequest($body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -255,15 +259,15 @@ function ($exception) { * Create request for operation 'createSchedule' * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createScheduleRequest($body, $x_accept_version = null) + protected function createScheduleRequest($body, $xAcceptVersion = null) { // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling createSchedule' ); @@ -277,8 +281,8 @@ protected function createScheduleRequest($body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -289,7 +293,7 @@ protected function createScheduleRequest($body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -328,11 +332,6 @@ protected function createScheduleRequest($body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -364,15 +363,15 @@ protected function createScheduleRequest($body, $x_accept_version = null) * Delete Schedule * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteSchedule($id, $x_accept_version = null) + public function deleteSchedule($id, $xAcceptVersion = null) { - $this->deleteScheduleWithHttpInfo($id, $x_accept_version); + $this->deleteScheduleWithHttpInfo($id, $xAcceptVersion); } /** @@ -381,16 +380,16 @@ public function deleteSchedule($id, $x_accept_version = null) * Delete Schedule * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteScheduleWithHttpInfo($id, $x_accept_version = null) + public function deleteScheduleWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteScheduleRequest($id, $x_accept_version); + $request = $this->deleteScheduleRequest($id, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -401,7 +400,7 @@ public function deleteScheduleWithHttpInfo($id, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -435,14 +434,14 @@ public function deleteScheduleWithHttpInfo($id, $x_accept_version = null) * Delete Schedule * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteScheduleAsync($id, $x_accept_version = null) + public function deleteScheduleAsync($id, $xAcceptVersion = null) { - return $this->deleteScheduleAsyncWithHttpInfo($id, $x_accept_version) + return $this->deleteScheduleAsyncWithHttpInfo($id, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -456,15 +455,15 @@ function ($response) { * Delete Schedule * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteScheduleAsyncWithHttpInfo($id, $x_accept_version = null) + public function deleteScheduleAsyncWithHttpInfo($id, $xAcceptVersion = null) { $returnType = ''; - $request = $this->deleteScheduleRequest($id, $x_accept_version); + $request = $this->deleteScheduleRequest($id, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -493,15 +492,15 @@ function ($exception) { * Create request for operation 'deleteSchedule' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteScheduleRequest($id, $x_accept_version = null) + protected function deleteScheduleRequest($id, $xAcceptVersion = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling deleteSchedule' ); @@ -515,8 +514,8 @@ protected function deleteScheduleRequest($id, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -532,7 +531,7 @@ protected function deleteScheduleRequest($id, $x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -571,11 +570,6 @@ protected function deleteScheduleRequest($id, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -607,15 +601,15 @@ protected function deleteScheduleRequest($id, $x_accept_version = null) * Enable schedules * * @param \Swagger\Client\Model\Body9 $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function enableSchedules($body, $x_accept_version = null) + public function enableSchedules($body, $xAcceptVersion = null) { - $this->enableSchedulesWithHttpInfo($body, $x_accept_version); + $this->enableSchedulesWithHttpInfo($body, $xAcceptVersion); } /** @@ -624,16 +618,16 @@ public function enableSchedules($body, $x_accept_version = null) * Enable schedules * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function enableSchedulesWithHttpInfo($body, $x_accept_version = null) + public function enableSchedulesWithHttpInfo($body, $xAcceptVersion = null) { $returnType = ''; - $request = $this->enableSchedulesRequest($body, $x_accept_version); + $request = $this->enableSchedulesRequest($body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -644,7 +638,7 @@ public function enableSchedulesWithHttpInfo($body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -678,14 +672,14 @@ public function enableSchedulesWithHttpInfo($body, $x_accept_version = null) * Enable schedules * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function enableSchedulesAsync($body, $x_accept_version = null) + public function enableSchedulesAsync($body, $xAcceptVersion = null) { - return $this->enableSchedulesAsyncWithHttpInfo($body, $x_accept_version) + return $this->enableSchedulesAsyncWithHttpInfo($body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -699,15 +693,15 @@ function ($response) { * Enable schedules * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function enableSchedulesAsyncWithHttpInfo($body, $x_accept_version = null) + public function enableSchedulesAsyncWithHttpInfo($body, $xAcceptVersion = null) { $returnType = ''; - $request = $this->enableSchedulesRequest($body, $x_accept_version); + $request = $this->enableSchedulesRequest($body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -736,15 +730,15 @@ function ($exception) { * Create request for operation 'enableSchedules' * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function enableSchedulesRequest($body, $x_accept_version = null) + protected function enableSchedulesRequest($body, $xAcceptVersion = null) { // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling enableSchedules' ); @@ -758,8 +752,8 @@ protected function enableSchedulesRequest($body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -770,7 +764,7 @@ protected function enableSchedulesRequest($body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -809,11 +803,6 @@ protected function enableSchedulesRequest($body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -845,16 +834,16 @@ protected function enableSchedulesRequest($body, $x_accept_version = null) * Get Schedule * * @param int $id id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule */ - public function getSchedule($id, $x_accept_version = null, $include = null) + public function getSchedule($id, $xAcceptVersion = null, $include = null) { - list($response) = $this->getScheduleWithHttpInfo($id, $x_accept_version, $include); + list($response) = $this->getScheduleWithHttpInfo($id, $xAcceptVersion, $include); return $response; } @@ -864,17 +853,17 @@ public function getSchedule($id, $x_accept_version = null, $include = null) * Get Schedule * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ - public function getScheduleWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getScheduleWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->getScheduleRequest($id, $x_accept_version, $include); + $request = $this->getScheduleRequest($id, $xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -885,7 +874,7 @@ public function getScheduleWithHttpInfo($id, $x_accept_version = null, $include "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -941,15 +930,15 @@ public function getScheduleWithHttpInfo($id, $x_accept_version = null, $include * Get Schedule * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getScheduleAsync($id, $x_accept_version = null, $include = null) + public function getScheduleAsync($id, $xAcceptVersion = null, $include = null) { - return $this->getScheduleAsyncWithHttpInfo($id, $x_accept_version, $include) + return $this->getScheduleAsyncWithHttpInfo($id, $xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -963,16 +952,16 @@ function ($response) { * Get Schedule * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getScheduleAsyncWithHttpInfo($id, $x_accept_version = null, $include = null) + public function getScheduleAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->getScheduleRequest($id, $x_accept_version, $include); + $request = $this->getScheduleRequest($id, $xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1015,16 +1004,16 @@ function ($exception) { * Create request for operation 'getSchedule' * * @param int $id (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getScheduleRequest($id, $x_accept_version = null, $include = null) + protected function getScheduleRequest($id, $xAcceptVersion = null, $include = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling getSchedule' ); @@ -1045,8 +1034,8 @@ protected function getScheduleRequest($id, $x_accept_version = null, $include = $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1062,7 +1051,7 @@ protected function getScheduleRequest($id, $x_accept_version = null, $include = $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1101,11 +1090,6 @@ protected function getScheduleRequest($id, $x_accept_version = null, $include = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1136,16 +1120,16 @@ protected function getScheduleRequest($id, $x_accept_version = null, $include = * * Get schedules list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule[] */ - public function getSchedules($x_accept_version = null, $include = null) + public function getSchedules($xAcceptVersion = null, $include = null) { - list($response) = $this->getSchedulesWithHttpInfo($x_accept_version, $include); + list($response) = $this->getSchedulesWithHttpInfo($xAcceptVersion, $include); return $response; } @@ -1154,17 +1138,17 @@ public function getSchedules($x_accept_version = null, $include = null) * * Get schedules list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) */ - public function getSchedulesWithHttpInfo($x_accept_version = null, $include = null) + public function getSchedulesWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getSchedulesRequest($x_accept_version, $include); + $request = $this->getSchedulesRequest($xAcceptVersion, $include); try { $options = $this->createHttpClientOption(); @@ -1175,7 +1159,7 @@ public function getSchedulesWithHttpInfo($x_accept_version = null, $include = nu "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1230,15 +1214,15 @@ public function getSchedulesWithHttpInfo($x_accept_version = null, $include = nu * * Get schedules list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSchedulesAsync($x_accept_version = null, $include = null) + public function getSchedulesAsync($xAcceptVersion = null, $include = null) { - return $this->getSchedulesAsyncWithHttpInfo($x_accept_version, $include) + return $this->getSchedulesAsyncWithHttpInfo($xAcceptVersion, $include) ->then( function ($response) { return $response[0]; @@ -1251,16 +1235,16 @@ function ($response) { * * Get schedules list * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSchedulesAsyncWithHttpInfo($x_accept_version = null, $include = null) + public function getSchedulesAsyncWithHttpInfo($xAcceptVersion = null, $include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getSchedulesRequest($x_accept_version, $include); + $request = $this->getSchedulesRequest($xAcceptVersion, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1302,13 +1286,13 @@ function ($exception) { /** * Create request for operation 'getSchedules' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getSchedulesRequest($x_accept_version = null, $include = null) + protected function getSchedulesRequest($xAcceptVersion = null, $include = null) { $resourcePath = '/schedules'; @@ -1326,8 +1310,8 @@ protected function getSchedulesRequest($x_accept_version = null, $include = null $queryParams['include'] = ObjectSerializer::toQueryValue($include); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -1335,7 +1319,7 @@ protected function getSchedulesRequest($x_accept_version = null, $include = null $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1374,11 +1358,6 @@ protected function getSchedulesRequest($x_accept_version = null, $include = null } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1411,16 +1390,16 @@ protected function getSchedulesRequest($x_accept_version = null, $include = null * * @param int $id id (required) * @param \Swagger\Client\Model\ScheduleRequest $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule */ - public function updateSchedule($id, $body, $x_accept_version = null, $enable = null) + public function updateSchedule($id, $body, $xAcceptVersion = null, $enable = null) { - list($response) = $this->updateScheduleWithHttpInfo($id, $body, $x_accept_version, $enable); + list($response) = $this->updateScheduleWithHttpInfo($id, $body, $xAcceptVersion, $enable); return $response; } @@ -1431,17 +1410,17 @@ public function updateSchedule($id, $body, $x_accept_version = null, $enable = n * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ - public function updateScheduleWithHttpInfo($id, $body, $x_accept_version = null, $enable = null) + public function updateScheduleWithHttpInfo($id, $body, $xAcceptVersion = null, $enable = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->updateScheduleRequest($id, $body, $x_accept_version, $enable); + $request = $this->updateScheduleRequest($id, $body, $xAcceptVersion, $enable); try { $options = $this->createHttpClientOption(); @@ -1452,7 +1431,7 @@ public function updateScheduleWithHttpInfo($id, $body, $x_accept_version = null, "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1509,15 +1488,15 @@ public function updateScheduleWithHttpInfo($id, $body, $x_accept_version = null, * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateScheduleAsync($id, $body, $x_accept_version = null, $enable = null) + public function updateScheduleAsync($id, $body, $xAcceptVersion = null, $enable = null) { - return $this->updateScheduleAsyncWithHttpInfo($id, $body, $x_accept_version, $enable) + return $this->updateScheduleAsyncWithHttpInfo($id, $body, $xAcceptVersion, $enable) ->then( function ($response) { return $response[0]; @@ -1532,16 +1511,16 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateScheduleAsyncWithHttpInfo($id, $body, $x_accept_version = null, $enable = null) + public function updateScheduleAsyncWithHttpInfo($id, $body, $xAcceptVersion = null, $enable = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->updateScheduleRequest($id, $body, $x_accept_version, $enable); + $request = $this->updateScheduleRequest($id, $body, $xAcceptVersion, $enable); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1585,22 +1564,22 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateScheduleRequest($id, $body, $x_accept_version = null, $enable = null) + protected function updateScheduleRequest($id, $body, $xAcceptVersion = null, $enable = null) { // verify the required parameter 'id' is set - if ($id === null) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateSchedule' ); } // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateSchedule' ); @@ -1618,8 +1597,8 @@ protected function updateScheduleRequest($id, $body, $x_accept_version = null, $ $queryParams['enable'] = ObjectSerializer::toQueryValue($enable); } // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } // path params @@ -1638,7 +1617,7 @@ protected function updateScheduleRequest($id, $body, $x_accept_version = null, $ } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -1677,11 +1656,6 @@ protected function updateScheduleRequest($id, $body, $x_accept_version = null, $ } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/Api/ServerApi.php b/lib/Api/ServerApi.php index 9c116a1..da81d1e 100644 --- a/lib/Api/ServerApi.php +++ b/lib/Api/ServerApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ServerApi @@ -60,6 +59,11 @@ class ServerApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -88,15 +92,15 @@ public function getConfig() * * Get server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\InlineResponse200 */ - public function serverInfoGet($x_accept_version = null) + public function serverInfoGet($xAcceptVersion = null) { - list($response) = $this->serverInfoGetWithHttpInfo($x_accept_version); + list($response) = $this->serverInfoGetWithHttpInfo($xAcceptVersion); return $response; } @@ -105,16 +109,16 @@ public function serverInfoGet($x_accept_version = null) * * Get server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) */ - public function serverInfoGetWithHttpInfo($x_accept_version = null) + public function serverInfoGetWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\InlineResponse200'; - $request = $this->serverInfoGetRequest($x_accept_version); + $request = $this->serverInfoGetRequest($xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -125,7 +129,7 @@ public function serverInfoGetWithHttpInfo($x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -180,14 +184,14 @@ public function serverInfoGetWithHttpInfo($x_accept_version = null) * * Get server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverInfoGetAsync($x_accept_version = null) + public function serverInfoGetAsync($xAcceptVersion = null) { - return $this->serverInfoGetAsyncWithHttpInfo($x_accept_version) + return $this->serverInfoGetAsyncWithHttpInfo($xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -200,15 +204,15 @@ function ($response) { * * Get server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverInfoGetAsyncWithHttpInfo($x_accept_version = null) + public function serverInfoGetAsyncWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\InlineResponse200'; - $request = $this->serverInfoGetRequest($x_accept_version); + $request = $this->serverInfoGetRequest($xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -250,12 +254,12 @@ function ($exception) { /** * Create request for operation 'serverInfoGet' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverInfoGetRequest($x_accept_version = null) + protected function serverInfoGetRequest($xAcceptVersion = null) { $resourcePath = '/server-info'; @@ -266,8 +270,8 @@ protected function serverInfoGetRequest($x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -275,7 +279,7 @@ protected function serverInfoGetRequest($x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -340,15 +344,15 @@ protected function serverInfoGetRequest($x_accept_version = null) * * Get the SUPLA Server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\InlineResponse2001 */ - public function serverStatusGet($x_accept_version = null) + public function serverStatusGet($xAcceptVersion = null) { - list($response) = $this->serverStatusGetWithHttpInfo($x_accept_version); + list($response) = $this->serverStatusGetWithHttpInfo($xAcceptVersion); return $response; } @@ -357,16 +361,16 @@ public function serverStatusGet($x_accept_version = null) * * Get the SUPLA Server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\InlineResponse2001, HTTP status code, HTTP response headers (array of strings) */ - public function serverStatusGetWithHttpInfo($x_accept_version = null) + public function serverStatusGetWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\InlineResponse2001'; - $request = $this->serverStatusGetRequest($x_accept_version); + $request = $this->serverStatusGetRequest($xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -377,7 +381,7 @@ public function serverStatusGetWithHttpInfo($x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -440,14 +444,14 @@ public function serverStatusGetWithHttpInfo($x_accept_version = null) * * Get the SUPLA Server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverStatusGetAsync($x_accept_version = null) + public function serverStatusGetAsync($xAcceptVersion = null) { - return $this->serverStatusGetAsyncWithHttpInfo($x_accept_version) + return $this->serverStatusGetAsyncWithHttpInfo($xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -460,15 +464,15 @@ function ($response) { * * Get the SUPLA Server status * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverStatusGetAsyncWithHttpInfo($x_accept_version = null) + public function serverStatusGetAsyncWithHttpInfo($xAcceptVersion = null) { $returnType = '\Swagger\Client\Model\InlineResponse2001'; - $request = $this->serverStatusGetRequest($x_accept_version); + $request = $this->serverStatusGetRequest($xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -510,12 +514,12 @@ function ($exception) { /** * Create request for operation 'serverStatusGet' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverStatusGetRequest($x_accept_version = null) + protected function serverStatusGetRequest($xAcceptVersion = null) { $resourcePath = '/server-status'; @@ -526,8 +530,8 @@ protected function serverStatusGetRequest($x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -535,7 +539,7 @@ protected function serverStatusGetRequest($x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index 13e8d74..e28d0a7 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -44,8 +44,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class UsersApi @@ -60,6 +59,11 @@ class UsersApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -89,15 +93,15 @@ public function getConfig() * Edit current user * * @param \Swagger\Client\Model\Body $body body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse2003 + * @return \Swagger\Client\Model\InlineResponse2002 */ - public function editCurrentUser($body, $x_accept_version = null) + public function editCurrentUser($body, $xAcceptVersion = null) { - list($response) = $this->editCurrentUserWithHttpInfo($body, $x_accept_version); + list($response) = $this->editCurrentUserWithHttpInfo($body, $xAcceptVersion); return $response; } @@ -107,16 +111,16 @@ public function editCurrentUser($body, $x_accept_version = null) * Edit current user * * @param \Swagger\Client\Model\Body $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse2003, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\InlineResponse2002, HTTP status code, HTTP response headers (array of strings) */ - public function editCurrentUserWithHttpInfo($body, $x_accept_version = null) + public function editCurrentUserWithHttpInfo($body, $xAcceptVersion = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2003'; - $request = $this->editCurrentUserRequest($body, $x_accept_version); + $returnType = '\Swagger\Client\Model\InlineResponse2002'; + $request = $this->editCurrentUserRequest($body, $xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -127,7 +131,7 @@ public function editCurrentUserWithHttpInfo($body, $x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -167,7 +171,7 @@ public function editCurrentUserWithHttpInfo($body, $x_accept_version = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse2003', + '\Swagger\Client\Model\InlineResponse2002', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -183,14 +187,14 @@ public function editCurrentUserWithHttpInfo($body, $x_accept_version = null) * Edit current user * * @param \Swagger\Client\Model\Body $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editCurrentUserAsync($body, $x_accept_version = null) + public function editCurrentUserAsync($body, $xAcceptVersion = null) { - return $this->editCurrentUserAsyncWithHttpInfo($body, $x_accept_version) + return $this->editCurrentUserAsyncWithHttpInfo($body, $xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -204,15 +208,15 @@ function ($response) { * Edit current user * * @param \Swagger\Client\Model\Body $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editCurrentUserAsyncWithHttpInfo($body, $x_accept_version = null) + public function editCurrentUserAsyncWithHttpInfo($body, $xAcceptVersion = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2003'; - $request = $this->editCurrentUserRequest($body, $x_accept_version); + $returnType = '\Swagger\Client\Model\InlineResponse2002'; + $request = $this->editCurrentUserRequest($body, $xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -255,15 +259,15 @@ function ($exception) { * Create request for operation 'editCurrentUser' * * @param \Swagger\Client\Model\Body $body (required) - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function editCurrentUserRequest($body, $x_accept_version = null) + protected function editCurrentUserRequest($body, $xAcceptVersion = null) { // verify the required parameter 'body' is set - if ($body === null) { + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling editCurrentUser' ); @@ -277,8 +281,8 @@ protected function editCurrentUserRequest($body, $x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -289,7 +293,7 @@ protected function editCurrentUserRequest($body, $x_accept_version = null) } if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -328,11 +332,6 @@ protected function editCurrentUserRequest($body, $x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -363,15 +362,15 @@ protected function editCurrentUserRequest($body, $x_accept_version = null) * * Get current user * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse2002 + * @return \Swagger\Client\Model\UserRequest */ - public function getCurrentUser($x_accept_version = null) + public function getCurrentUser($xAcceptVersion = null) { - list($response) = $this->getCurrentUserWithHttpInfo($x_accept_version); + list($response) = $this->getCurrentUserWithHttpInfo($xAcceptVersion); return $response; } @@ -380,16 +379,16 @@ public function getCurrentUser($x_accept_version = null) * * Get current user * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse2002, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\UserRequest, HTTP status code, HTTP response headers (array of strings) */ - public function getCurrentUserWithHttpInfo($x_accept_version = null) + public function getCurrentUserWithHttpInfo($xAcceptVersion = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2002'; - $request = $this->getCurrentUserRequest($x_accept_version); + $returnType = '\Swagger\Client\Model\UserRequest'; + $request = $this->getCurrentUserRequest($xAcceptVersion); try { $options = $this->createHttpClientOption(); @@ -400,7 +399,7 @@ public function getCurrentUserWithHttpInfo($x_accept_version = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse()->getBody()->getContents() + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -440,7 +439,7 @@ public function getCurrentUserWithHttpInfo($x_accept_version = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse2002', + '\Swagger\Client\Model\UserRequest', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -455,14 +454,14 @@ public function getCurrentUserWithHttpInfo($x_accept_version = null) * * Get current user * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentUserAsync($x_accept_version = null) + public function getCurrentUserAsync($xAcceptVersion = null) { - return $this->getCurrentUserAsyncWithHttpInfo($x_accept_version) + return $this->getCurrentUserAsyncWithHttpInfo($xAcceptVersion) ->then( function ($response) { return $response[0]; @@ -475,15 +474,15 @@ function ($response) { * * Get current user * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentUserAsyncWithHttpInfo($x_accept_version = null) + public function getCurrentUserAsyncWithHttpInfo($xAcceptVersion = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2002'; - $request = $this->getCurrentUserRequest($x_accept_version); + $returnType = '\Swagger\Client\Model\UserRequest'; + $request = $this->getCurrentUserRequest($xAcceptVersion); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -525,12 +524,12 @@ function ($exception) { /** * Create request for operation 'getCurrentUser' * - * @param string $x_accept_version API Version (optional) + * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCurrentUserRequest($x_accept_version = null) + protected function getCurrentUserRequest($xAcceptVersion = null) { $resourcePath = '/users/current'; @@ -541,8 +540,8 @@ protected function getCurrentUserRequest($x_accept_version = null) $multipart = false; // header params - if ($x_accept_version !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($x_accept_version); + if ($xAcceptVersion !== null) { + $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); } @@ -550,7 +549,7 @@ protected function getCurrentUserRequest($x_accept_version = null) $_tempBody = null; if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -589,11 +588,6 @@ protected function getCurrentUserRequest($x_accept_version = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/lib/ApiException.php b/lib/ApiException.php index 8d6c450..a2e4816 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,8 +35,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ApiException extends Exception diff --git a/lib/Configuration.php b/lib/Configuration.php index c61439a..3c8e38a 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -34,8 +34,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class Configuration diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index f15e6a2..467df41 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -17,6 +17,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** diff --git a/lib/Model/AccessID.php b/lib/Model/AccessID.php index 3e0130a..1b022a2 100644 --- a/lib/Model/AccessID.php +++ b/lib/Model/AccessID.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * AccessID Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class AccessID implements ModelInterface, ArrayAccess { @@ -59,10 +60,10 @@ class AccessID implements ModelInterface, ArrayAccess 'id' => 'int', 'caption' => 'string', 'enabled' => 'bool', - 'locations_ids' => 'int[]', - 'client_apps_ids' => 'int[]', + 'locationsIds' => 'int[]', + 'clientAppsIds' => 'int[]', 'locations' => '\Swagger\Client\Model\Location[]', - 'client_apps' => '\Swagger\Client\Model\ClientApp[]' + 'clientApps' => '\Swagger\Client\Model\ClientApp[]' ]; /** @@ -74,10 +75,10 @@ class AccessID implements ModelInterface, ArrayAccess 'id' => null, 'caption' => null, 'enabled' => null, - 'locations_ids' => null, - 'client_apps_ids' => null, + 'locationsIds' => null, + 'clientAppsIds' => null, 'locations' => null, - 'client_apps' => null + 'clientApps' => null ]; /** @@ -110,10 +111,10 @@ public static function swaggerFormats() 'id' => 'id', 'caption' => 'caption', 'enabled' => 'enabled', - 'locations_ids' => 'locationsIds', - 'client_apps_ids' => 'clientAppsIds', + 'locationsIds' => 'locationsIds', + 'clientAppsIds' => 'clientAppsIds', 'locations' => 'locations', - 'client_apps' => 'clientApps' + 'clientApps' => 'clientApps' ]; /** @@ -125,10 +126,10 @@ public static function swaggerFormats() 'id' => 'setId', 'caption' => 'setCaption', 'enabled' => 'setEnabled', - 'locations_ids' => 'setLocationsIds', - 'client_apps_ids' => 'setClientAppsIds', + 'locationsIds' => 'setLocationsIds', + 'clientAppsIds' => 'setClientAppsIds', 'locations' => 'setLocations', - 'client_apps' => 'setClientApps' + 'clientApps' => 'setClientApps' ]; /** @@ -140,10 +141,10 @@ public static function swaggerFormats() 'id' => 'getId', 'caption' => 'getCaption', 'enabled' => 'getEnabled', - 'locations_ids' => 'getLocationsIds', - 'client_apps_ids' => 'getClientAppsIds', + 'locationsIds' => 'getLocationsIds', + 'clientAppsIds' => 'getClientAppsIds', 'locations' => 'getLocations', - 'client_apps' => 'getClientApps' + 'clientApps' => 'getClientApps' ]; /** @@ -209,10 +210,10 @@ public function __construct(array $data = null) $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['locations_ids'] = isset($data['locations_ids']) ? $data['locations_ids'] : null; - $this->container['client_apps_ids'] = isset($data['client_apps_ids']) ? $data['client_apps_ids'] : null; + $this->container['locationsIds'] = isset($data['locationsIds']) ? $data['locationsIds'] : null; + $this->container['clientAppsIds'] = isset($data['clientAppsIds']) ? $data['clientAppsIds'] : null; $this->container['locations'] = isset($data['locations']) ? $data['locations'] : null; - $this->container['client_apps'] = isset($data['client_apps']) ? $data['client_apps'] : null; + $this->container['clientApps'] = isset($data['clientApps']) ? $data['clientApps'] : null; } /** @@ -235,8 +236,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -313,49 +313,49 @@ public function setEnabled($enabled) } /** - * Gets locations_ids + * Gets locationsIds * * @return int[] */ public function getLocationsIds() { - return $this->container['locations_ids']; + return $this->container['locationsIds']; } /** - * Sets locations_ids + * Sets locationsIds * - * @param int[] $locations_ids array containing the location idenfifiers assigned to this access ID + * @param int[] $locationsIds array containing the location idenfifiers assigned to this access ID * * @return $this */ - public function setLocationsIds($locations_ids) + public function setLocationsIds($locationsIds) { - $this->container['locations_ids'] = $locations_ids; + $this->container['locationsIds'] = $locationsIds; return $this; } /** - * Gets client_apps_ids + * Gets clientAppsIds * * @return int[] */ public function getClientAppsIds() { - return $this->container['client_apps_ids']; + return $this->container['clientAppsIds']; } /** - * Sets client_apps_ids + * Sets clientAppsIds * - * @param int[] $client_apps_ids array containing the client apps idenfifiers assigned to this access ID + * @param int[] $clientAppsIds array containing the client apps idenfifiers assigned to this access ID * * @return $this */ - public function setClientAppsIds($client_apps_ids) + public function setClientAppsIds($clientAppsIds) { - $this->container['client_apps_ids'] = $client_apps_ids; + $this->container['clientAppsIds'] = $clientAppsIds; return $this; } @@ -385,32 +385,32 @@ public function setLocations($locations) } /** - * Gets client_apps + * Gets clientApps * * @return \Swagger\Client\Model\ClientApp[] */ public function getClientApps() { - return $this->container['client_apps']; + return $this->container['clientApps']; } /** - * Sets client_apps + * Sets clientApps * - * @param \Swagger\Client\Model\ClientApp[] $client_apps Returned only if requested by the `include` parameter. + * @param \Swagger\Client\Model\ClientApp[] $clientApps Returned only if requested by the `include` parameter. * * @return $this */ - public function setClientApps($client_apps) + public function setClientApps($clientApps) { - $this->container['client_apps'] = $client_apps; + $this->container['clientApps'] = $clientApps; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -422,7 +422,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -434,8 +434,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,7 +451,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -478,3 +478,4 @@ public function __toString() } } + diff --git a/lib/Model/Body.php b/lib/Model/Body.php index 4c796c5..e479a3a 100644 --- a/lib/Model/Body.php +++ b/lib/Model/Body.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body implements ModelInterface, ArrayAccess { @@ -212,7 +213,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getActionAllowableValues(); - if (!in_array($this->container['action'], $allowedValues)) { + if (!is_null($this->container['action']) && !in_array($this->container['action'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'action', must be one of '%s'", implode("', '", $allowedValues) @@ -230,12 +231,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getActionAllowableValues(); - if (!in_array($this->container['action'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -259,7 +255,7 @@ public function getAction() public function setAction($action) { $allowedValues = $this->getActionAllowableValues(); - if (!is_null($action) && !in_array($action, $allowedValues)) { + if (!is_null($action) && !in_array($action, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'action', must be one of '%s'", @@ -274,7 +270,7 @@ public function setAction($action) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -286,7 +282,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -298,8 +294,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -315,7 +311,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -342,3 +338,4 @@ public function __toString() } } + diff --git a/lib/Model/Body1.php b/lib/Model/Body1.php index 62ae787..ab05bc8 100644 --- a/lib/Model/Body1.php +++ b/lib/Model/Body1.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body1 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body1 implements ModelInterface, ArrayAccess { @@ -59,7 +60,7 @@ class Body1 implements ModelInterface, ArrayAccess 'enabled' => 'bool', 'caption' => 'string', 'password' => 'string', - 'access_ids_ids' => 'int[]' + 'accessIdsIds' => 'int[]' ]; /** @@ -71,7 +72,7 @@ class Body1 implements ModelInterface, ArrayAccess 'enabled' => null, 'caption' => null, 'password' => null, - 'access_ids_ids' => null + 'accessIdsIds' => null ]; /** @@ -104,7 +105,7 @@ public static function swaggerFormats() 'enabled' => 'enabled', 'caption' => 'caption', 'password' => 'password', - 'access_ids_ids' => 'accessIdsIds' + 'accessIdsIds' => 'accessIdsIds' ]; /** @@ -116,7 +117,7 @@ public static function swaggerFormats() 'enabled' => 'setEnabled', 'caption' => 'setCaption', 'password' => 'setPassword', - 'access_ids_ids' => 'setAccessIdsIds' + 'accessIdsIds' => 'setAccessIdsIds' ]; /** @@ -128,7 +129,7 @@ public static function swaggerFormats() 'enabled' => 'getEnabled', 'caption' => 'getCaption', 'password' => 'getPassword', - 'access_ids_ids' => 'getAccessIdsIds' + 'accessIdsIds' => 'getAccessIdsIds' ]; /** @@ -194,7 +195,7 @@ public function __construct(array $data = null) $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['access_ids_ids'] = isset($data['access_ids_ids']) ? $data['access_ids_ids'] : null; + $this->container['accessIdsIds'] = isset($data['accessIdsIds']) ? $data['accessIdsIds'] : null; } /** @@ -217,8 +218,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -295,32 +295,32 @@ public function setPassword($password) } /** - * Gets access_ids_ids + * Gets accessIdsIds * * @return int[] */ public function getAccessIdsIds() { - return $this->container['access_ids_ids']; + return $this->container['accessIdsIds']; } /** - * Sets access_ids_ids + * Sets accessIdsIds * - * @param int[] $access_ids_ids Access Identifiers identifiers to assign to this location. + * @param int[] $accessIdsIds Access Identifiers identifiers to assign to this location. * * @return $this */ - public function setAccessIdsIds($access_ids_ids) + public function setAccessIdsIds($accessIdsIds) { - $this->container['access_ids_ids'] = $access_ids_ids; + $this->container['accessIdsIds'] = $accessIdsIds; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -332,7 +332,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -344,8 +344,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -361,7 +361,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -388,3 +388,4 @@ public function __toString() } } + diff --git a/lib/Model/Body10.php b/lib/Model/Body10.php index b46e9a3..d578fbd 100644 --- a/lib/Model/Body10.php +++ b/lib/Model/Body10.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body10 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body10 implements ModelInterface, ArrayAccess { @@ -59,8 +60,8 @@ class Body10 implements ModelInterface, ArrayAccess 'enabled' => 'bool', 'caption' => 'string', 'password' => 'string', - 'locations_ids' => 'int[]', - 'client_apps_ids' => 'int[]' + 'locationsIds' => 'int[]', + 'clientAppsIds' => 'int[]' ]; /** @@ -72,8 +73,8 @@ class Body10 implements ModelInterface, ArrayAccess 'enabled' => null, 'caption' => null, 'password' => null, - 'locations_ids' => null, - 'client_apps_ids' => null + 'locationsIds' => null, + 'clientAppsIds' => null ]; /** @@ -106,8 +107,8 @@ public static function swaggerFormats() 'enabled' => 'enabled', 'caption' => 'caption', 'password' => 'password', - 'locations_ids' => 'locationsIds', - 'client_apps_ids' => 'clientAppsIds' + 'locationsIds' => 'locationsIds', + 'clientAppsIds' => 'clientAppsIds' ]; /** @@ -119,8 +120,8 @@ public static function swaggerFormats() 'enabled' => 'setEnabled', 'caption' => 'setCaption', 'password' => 'setPassword', - 'locations_ids' => 'setLocationsIds', - 'client_apps_ids' => 'setClientAppsIds' + 'locationsIds' => 'setLocationsIds', + 'clientAppsIds' => 'setClientAppsIds' ]; /** @@ -132,8 +133,8 @@ public static function swaggerFormats() 'enabled' => 'getEnabled', 'caption' => 'getCaption', 'password' => 'getPassword', - 'locations_ids' => 'getLocationsIds', - 'client_apps_ids' => 'getClientAppsIds' + 'locationsIds' => 'getLocationsIds', + 'clientAppsIds' => 'getClientAppsIds' ]; /** @@ -199,8 +200,8 @@ public function __construct(array $data = null) $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['locations_ids'] = isset($data['locations_ids']) ? $data['locations_ids'] : null; - $this->container['client_apps_ids'] = isset($data['client_apps_ids']) ? $data['client_apps_ids'] : null; + $this->container['locationsIds'] = isset($data['locationsIds']) ? $data['locationsIds'] : null; + $this->container['clientAppsIds'] = isset($data['clientAppsIds']) ? $data['clientAppsIds'] : null; } /** @@ -223,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -301,56 +301,56 @@ public function setPassword($password) } /** - * Gets locations_ids + * Gets locationsIds * * @return int[] */ public function getLocationsIds() { - return $this->container['locations_ids']; + return $this->container['locationsIds']; } /** - * Sets locations_ids + * Sets locationsIds * - * @param int[] $locations_ids Locations identifiers to assign to this Access ID. + * @param int[] $locationsIds Locations identifiers to assign to this Access ID. * * @return $this */ - public function setLocationsIds($locations_ids) + public function setLocationsIds($locationsIds) { - $this->container['locations_ids'] = $locations_ids; + $this->container['locationsIds'] = $locationsIds; return $this; } /** - * Gets client_apps_ids + * Gets clientAppsIds * * @return int[] */ public function getClientAppsIds() { - return $this->container['client_apps_ids']; + return $this->container['clientAppsIds']; } /** - * Sets client_apps_ids + * Sets clientAppsIds * - * @param int[] $client_apps_ids Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. + * @param int[] $clientAppsIds Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. * * @return $this */ - public function setClientAppsIds($client_apps_ids) + public function setClientAppsIds($clientAppsIds) { - $this->container['client_apps_ids'] = $client_apps_ids; + $this->container['clientAppsIds'] = $clientAppsIds; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -362,7 +362,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -374,8 +374,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -391,7 +391,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -418,3 +418,4 @@ public function __toString() } } + diff --git a/lib/Model/Body2.php b/lib/Model/Body2.php index 87a72d2..2826441 100644 --- a/lib/Model/Body2.php +++ b/lib/Model/Body2.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body2 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body2 implements ModelInterface, ArrayAccess { @@ -56,15 +57,15 @@ class Body2 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'function_id' => 'int', + 'functionId' => 'int', 'param1' => 'int', 'param2' => 'int', 'param3' => 'int', 'caption' => 'string', - 'alt_icon' => 'int', + 'altIcon' => 'int', 'hidden' => 'bool', - 'location_id' => 'int', - 'inherited_location' => 'bool' + 'locationId' => 'int', + 'inheritedLocation' => 'bool' ]; /** @@ -73,15 +74,15 @@ class Body2 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'function_id' => null, + 'functionId' => null, 'param1' => null, 'param2' => null, 'param3' => null, 'caption' => null, - 'alt_icon' => null, + 'altIcon' => null, 'hidden' => null, - 'location_id' => null, - 'inherited_location' => null + 'locationId' => null, + 'inheritedLocation' => null ]; /** @@ -111,15 +112,15 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'function_id' => 'functionId', + 'functionId' => 'functionId', 'param1' => 'param1', 'param2' => 'param2', 'param3' => 'param3', 'caption' => 'caption', - 'alt_icon' => 'altIcon', + 'altIcon' => 'altIcon', 'hidden' => 'hidden', - 'location_id' => 'locationId', - 'inherited_location' => 'inheritedLocation' + 'locationId' => 'locationId', + 'inheritedLocation' => 'inheritedLocation' ]; /** @@ -128,15 +129,15 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'function_id' => 'setFunctionId', + 'functionId' => 'setFunctionId', 'param1' => 'setParam1', 'param2' => 'setParam2', 'param3' => 'setParam3', 'caption' => 'setCaption', - 'alt_icon' => 'setAltIcon', + 'altIcon' => 'setAltIcon', 'hidden' => 'setHidden', - 'location_id' => 'setLocationId', - 'inherited_location' => 'setInheritedLocation' + 'locationId' => 'setLocationId', + 'inheritedLocation' => 'setInheritedLocation' ]; /** @@ -145,15 +146,15 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'function_id' => 'getFunctionId', + 'functionId' => 'getFunctionId', 'param1' => 'getParam1', 'param2' => 'getParam2', 'param3' => 'getParam3', 'caption' => 'getCaption', - 'alt_icon' => 'getAltIcon', + 'altIcon' => 'getAltIcon', 'hidden' => 'getHidden', - 'location_id' => 'getLocationId', - 'inherited_location' => 'getInheritedLocation' + 'locationId' => 'getLocationId', + 'inheritedLocation' => 'getInheritedLocation' ]; /** @@ -216,15 +217,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['function_id'] = isset($data['function_id']) ? $data['function_id'] : null; + $this->container['functionId'] = isset($data['functionId']) ? $data['functionId'] : null; $this->container['param1'] = isset($data['param1']) ? $data['param1'] : null; $this->container['param2'] = isset($data['param2']) ? $data['param2'] : null; $this->container['param3'] = isset($data['param3']) ? $data['param3'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['altIcon'] = isset($data['altIcon']) ? $data['altIcon'] : null; $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; - $this->container['inherited_location'] = isset($data['inherited_location']) ? $data['inherited_location'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; + $this->container['inheritedLocation'] = isset($data['inheritedLocation']) ? $data['inheritedLocation'] : null; } /** @@ -247,31 +248,30 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets function_id + * Gets functionId * * @return int */ public function getFunctionId() { - return $this->container['function_id']; + return $this->container['functionId']; } /** - * Sets function_id + * Sets functionId * - * @param int $function_id function_id + * @param int $functionId functionId * * @return $this */ - public function setFunctionId($function_id) + public function setFunctionId($functionId) { - $this->container['function_id'] = $function_id; + $this->container['functionId'] = $functionId; return $this; } @@ -373,25 +373,25 @@ public function setCaption($caption) } /** - * Gets alt_icon + * Gets altIcon * * @return int */ public function getAltIcon() { - return $this->container['alt_icon']; + return $this->container['altIcon']; } /** - * Sets alt_icon + * Sets altIcon * - * @param int $alt_icon alt_icon + * @param int $altIcon altIcon * * @return $this */ - public function setAltIcon($alt_icon) + public function setAltIcon($altIcon) { - $this->container['alt_icon'] = $alt_icon; + $this->container['altIcon'] = $altIcon; return $this; } @@ -421,56 +421,56 @@ public function setHidden($hidden) } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } /** - * Gets inherited_location + * Gets inheritedLocation * * @return bool */ public function getInheritedLocation() { - return $this->container['inherited_location']; + return $this->container['inheritedLocation']; } /** - * Sets inherited_location + * Sets inheritedLocation * - * @param bool $inherited_location inherited_location + * @param bool $inheritedLocation inheritedLocation * * @return $this */ - public function setInheritedLocation($inherited_location) + public function setInheritedLocation($inheritedLocation) { - $this->container['inherited_location'] = $inherited_location; + $this->container['inheritedLocation'] = $inheritedLocation; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -482,7 +482,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -494,8 +494,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -511,7 +511,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -538,3 +538,4 @@ public function __toString() } } + diff --git a/lib/Model/Body3.php b/lib/Model/Body3.php index da6a61c..1b3314c 100644 --- a/lib/Model/Body3.php +++ b/lib/Model/Body3.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body3 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body3 implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setPercentage($percentage) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/Body4.php b/lib/Model/Body4.php index 47921c4..5887880 100644 --- a/lib/Model/Body4.php +++ b/lib/Model/Body4.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body4 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body4 implements ModelInterface, ArrayAccess { @@ -57,10 +58,10 @@ class Body4 implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'caption' => 'string', - 'alt_icon' => 'int', + 'altIcon' => 'int', 'hidden' => 'bool', - 'location_id' => 'int', - 'channel_ids' => 'int[]' + 'locationId' => 'int', + 'channelIds' => 'int[]' ]; /** @@ -70,10 +71,10 @@ class Body4 implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'caption' => null, - 'alt_icon' => null, + 'altIcon' => null, 'hidden' => null, - 'location_id' => null, - 'channel_ids' => null + 'locationId' => null, + 'channelIds' => null ]; /** @@ -104,10 +105,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'caption' => 'caption', - 'alt_icon' => 'altIcon', + 'altIcon' => 'altIcon', 'hidden' => 'hidden', - 'location_id' => 'locationId', - 'channel_ids' => 'channelIds' + 'locationId' => 'locationId', + 'channelIds' => 'channelIds' ]; /** @@ -117,10 +118,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'caption' => 'setCaption', - 'alt_icon' => 'setAltIcon', + 'altIcon' => 'setAltIcon', 'hidden' => 'setHidden', - 'location_id' => 'setLocationId', - 'channel_ids' => 'setChannelIds' + 'locationId' => 'setLocationId', + 'channelIds' => 'setChannelIds' ]; /** @@ -130,10 +131,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'caption' => 'getCaption', - 'alt_icon' => 'getAltIcon', + 'altIcon' => 'getAltIcon', 'hidden' => 'getHidden', - 'location_id' => 'getLocationId', - 'channel_ids' => 'getChannelIds' + 'locationId' => 'getLocationId', + 'channelIds' => 'getChannelIds' ]; /** @@ -197,10 +198,10 @@ public function getModelName() public function __construct(array $data = null) { $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['altIcon'] = isset($data['altIcon']) ? $data['altIcon'] : null; $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; - $this->container['channel_ids'] = isset($data['channel_ids']) ? $data['channel_ids'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; + $this->container['channelIds'] = isset($data['channelIds']) ? $data['channelIds'] : null; } /** @@ -223,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -253,25 +253,25 @@ public function setCaption($caption) } /** - * Gets alt_icon + * Gets altIcon * * @return int */ public function getAltIcon() { - return $this->container['alt_icon']; + return $this->container['altIcon']; } /** - * Sets alt_icon + * Sets altIcon * - * @param int $alt_icon alt_icon + * @param int $altIcon altIcon * * @return $this */ - public function setAltIcon($alt_icon) + public function setAltIcon($altIcon) { - $this->container['alt_icon'] = $alt_icon; + $this->container['altIcon'] = $altIcon; return $this; } @@ -301,56 +301,56 @@ public function setHidden($hidden) } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } /** - * Gets channel_ids + * Gets channelIds * * @return int[] */ public function getChannelIds() { - return $this->container['channel_ids']; + return $this->container['channelIds']; } /** - * Sets channel_ids + * Sets channelIds * - * @param int[] $channel_ids channel_ids + * @param int[] $channelIds channelIds * * @return $this */ - public function setChannelIds($channel_ids) + public function setChannelIds($channelIds) { - $this->container['channel_ids'] = $channel_ids; + $this->container['channelIds'] = $channelIds; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -362,7 +362,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -374,8 +374,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -391,7 +391,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -418,3 +418,4 @@ public function __toString() } } + diff --git a/lib/Model/Body5.php b/lib/Model/Body5.php index dae2567..bdfa735 100644 --- a/lib/Model/Body5.php +++ b/lib/Model/Body5.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body5 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body5 implements ModelInterface, ArrayAccess { @@ -57,10 +58,10 @@ class Body5 implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'caption' => 'string', - 'alt_icon' => 'int', + 'altIcon' => 'int', 'hidden' => 'bool', - 'location_id' => 'int', - 'channel_ids' => 'int[]' + 'locationId' => 'int', + 'channelIds' => 'int[]' ]; /** @@ -70,10 +71,10 @@ class Body5 implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'caption' => null, - 'alt_icon' => null, + 'altIcon' => null, 'hidden' => null, - 'location_id' => null, - 'channel_ids' => null + 'locationId' => null, + 'channelIds' => null ]; /** @@ -104,10 +105,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'caption' => 'caption', - 'alt_icon' => 'altIcon', + 'altIcon' => 'altIcon', 'hidden' => 'hidden', - 'location_id' => 'locationId', - 'channel_ids' => 'channelIds' + 'locationId' => 'locationId', + 'channelIds' => 'channelIds' ]; /** @@ -117,10 +118,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'caption' => 'setCaption', - 'alt_icon' => 'setAltIcon', + 'altIcon' => 'setAltIcon', 'hidden' => 'setHidden', - 'location_id' => 'setLocationId', - 'channel_ids' => 'setChannelIds' + 'locationId' => 'setLocationId', + 'channelIds' => 'setChannelIds' ]; /** @@ -130,10 +131,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'caption' => 'getCaption', - 'alt_icon' => 'getAltIcon', + 'altIcon' => 'getAltIcon', 'hidden' => 'getHidden', - 'location_id' => 'getLocationId', - 'channel_ids' => 'getChannelIds' + 'locationId' => 'getLocationId', + 'channelIds' => 'getChannelIds' ]; /** @@ -197,10 +198,10 @@ public function getModelName() public function __construct(array $data = null) { $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['altIcon'] = isset($data['altIcon']) ? $data['altIcon'] : null; $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; - $this->container['channel_ids'] = isset($data['channel_ids']) ? $data['channel_ids'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; + $this->container['channelIds'] = isset($data['channelIds']) ? $data['channelIds'] : null; } /** @@ -223,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -253,25 +253,25 @@ public function setCaption($caption) } /** - * Gets alt_icon + * Gets altIcon * * @return int */ public function getAltIcon() { - return $this->container['alt_icon']; + return $this->container['altIcon']; } /** - * Sets alt_icon + * Sets altIcon * - * @param int $alt_icon alt_icon + * @param int $altIcon altIcon * * @return $this */ - public function setAltIcon($alt_icon) + public function setAltIcon($altIcon) { - $this->container['alt_icon'] = $alt_icon; + $this->container['altIcon'] = $altIcon; return $this; } @@ -301,56 +301,56 @@ public function setHidden($hidden) } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } /** - * Gets channel_ids + * Gets channelIds * * @return int[] */ public function getChannelIds() { - return $this->container['channel_ids']; + return $this->container['channelIds']; } /** - * Sets channel_ids + * Sets channelIds * - * @param int[] $channel_ids channel_ids + * @param int[] $channelIds channelIds * * @return $this */ - public function setChannelIds($channel_ids) + public function setChannelIds($channelIds) { - $this->container['channel_ids'] = $channel_ids; + $this->container['channelIds'] = $channelIds; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -362,7 +362,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -374,8 +374,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -391,7 +391,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -418,3 +418,4 @@ public function __toString() } } + diff --git a/lib/Model/Body6.php b/lib/Model/Body6.php index 177ad67..742c162 100644 --- a/lib/Model/Body6.php +++ b/lib/Model/Body6.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body6 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body6 implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setPercentage($percentage) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/Body7.php b/lib/Model/Body7.php index dd0d118..5e118dc 100644 --- a/lib/Model/Body7.php +++ b/lib/Model/Body7.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body7 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body7 implements ModelInterface, ArrayAccess { @@ -58,7 +59,7 @@ class Body7 implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'caption' => 'string', 'enabled' => 'bool', - 'access_id_id' => 'int' + 'accessIdId' => 'int' ]; /** @@ -69,7 +70,7 @@ class Body7 implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'caption' => null, 'enabled' => null, - 'access_id_id' => null + 'accessIdId' => null ]; /** @@ -101,7 +102,7 @@ public static function swaggerFormats() protected static $attributeMap = [ 'caption' => 'caption', 'enabled' => 'enabled', - 'access_id_id' => 'accessIdId' + 'accessIdId' => 'accessIdId' ]; /** @@ -112,7 +113,7 @@ public static function swaggerFormats() protected static $setters = [ 'caption' => 'setCaption', 'enabled' => 'setEnabled', - 'access_id_id' => 'setAccessIdId' + 'accessIdId' => 'setAccessIdId' ]; /** @@ -123,7 +124,7 @@ public static function swaggerFormats() protected static $getters = [ 'caption' => 'getCaption', 'enabled' => 'getEnabled', - 'access_id_id' => 'getAccessIdId' + 'accessIdId' => 'getAccessIdId' ]; /** @@ -188,7 +189,7 @@ public function __construct(array $data = null) { $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['access_id_id'] = isset($data['access_id_id']) ? $data['access_id_id'] : null; + $this->container['accessIdId'] = isset($data['accessIdId']) ? $data['accessIdId'] : null; } /** @@ -211,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -265,32 +265,32 @@ public function setEnabled($enabled) } /** - * Gets access_id_id + * Gets accessIdId * * @return int */ public function getAccessIdId() { - return $this->container['access_id_id']; + return $this->container['accessIdId']; } /** - * Sets access_id_id + * Sets accessIdId * - * @param int $access_id_id access_id_id + * @param int $accessIdId accessIdId * * @return $this */ - public function setAccessIdId($access_id_id) + public function setAccessIdId($accessIdId) { - $this->container['access_id_id'] = $access_id_id; + $this->container['accessIdId'] = $accessIdId; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -302,7 +302,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -314,8 +314,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -331,7 +331,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -358,3 +358,4 @@ public function __toString() } } + diff --git a/lib/Model/Body8.php b/lib/Model/Body8.php index 6c27577..7d3687d 100644 --- a/lib/Model/Body8.php +++ b/lib/Model/Body8.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body8 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body8 implements ModelInterface, ArrayAccess { @@ -58,7 +59,7 @@ class Body8 implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'comment' => 'string', 'enabled' => 'bool', - 'location_id' => 'int' + 'locationId' => 'int' ]; /** @@ -69,7 +70,7 @@ class Body8 implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'comment' => null, 'enabled' => null, - 'location_id' => null + 'locationId' => null ]; /** @@ -101,7 +102,7 @@ public static function swaggerFormats() protected static $attributeMap = [ 'comment' => 'comment', 'enabled' => 'enabled', - 'location_id' => 'locationId' + 'locationId' => 'locationId' ]; /** @@ -112,7 +113,7 @@ public static function swaggerFormats() protected static $setters = [ 'comment' => 'setComment', 'enabled' => 'setEnabled', - 'location_id' => 'setLocationId' + 'locationId' => 'setLocationId' ]; /** @@ -123,7 +124,7 @@ public static function swaggerFormats() protected static $getters = [ 'comment' => 'getComment', 'enabled' => 'getEnabled', - 'location_id' => 'getLocationId' + 'locationId' => 'getLocationId' ]; /** @@ -188,7 +189,7 @@ public function __construct(array $data = null) { $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; } /** @@ -211,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -265,32 +265,32 @@ public function setEnabled($enabled) } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -302,7 +302,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -314,8 +314,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -331,7 +331,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -358,3 +358,4 @@ public function __toString() } } + diff --git a/lib/Model/Body9.php b/lib/Model/Body9.php index 937729c..0438cab 100644 --- a/lib/Model/Body9.php +++ b/lib/Model/Body9.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Body9 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Body9 implements ModelInterface, ArrayAccess { @@ -199,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -230,7 +230,7 @@ public function setEnable($enable) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -242,7 +242,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -254,8 +254,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -271,7 +271,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -298,3 +298,4 @@ public function __toString() } } + diff --git a/lib/Model/Channel.php b/lib/Model/Channel.php index 8c87785..2b28740 100644 --- a/lib/Model/Channel.php +++ b/lib/Model/Channel.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Channel Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Channel implements ModelInterface, ArrayAccess { @@ -57,24 +58,24 @@ class Channel implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'channel_number' => 'int', + 'channelNumber' => 'int', 'caption' => 'string', 'type' => '\Swagger\Client\Model\ChannelType', 'function' => '\Swagger\Client\Model\ChannelFunction', 'param1' => '\Swagger\Client\Model\ChannelParam', 'param2' => '\Swagger\Client\Model\ChannelParam', 'param3' => '\Swagger\Client\Model\ChannelParam', - 'alt_icon' => 'int', + 'altIcon' => 'int', 'hidden' => 'bool', - 'inherited_location' => 'bool', - 'iodevice_id' => 'int', - 'location_id' => 'int', - 'function_id' => 'int', - 'type_id' => 'int', + 'inheritedLocation' => 'bool', + 'iodeviceId' => 'int', + 'locationId' => 'int', + 'functionId' => 'int', + 'typeId' => 'int', 'iodevice' => '\Swagger\Client\Model\Device', 'location' => '\Swagger\Client\Model\Location', 'connected' => 'bool', - 'supported_functions' => '\Swagger\Client\Model\ChannelFunction[]' + 'supportedFunctions' => '\Swagger\Client\Model\ChannelFunction[]' ]; /** @@ -84,24 +85,24 @@ class Channel implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'channel_number' => null, + 'channelNumber' => null, 'caption' => null, 'type' => null, 'function' => null, 'param1' => null, 'param2' => null, 'param3' => null, - 'alt_icon' => null, + 'altIcon' => null, 'hidden' => null, - 'inherited_location' => null, - 'iodevice_id' => null, - 'location_id' => null, - 'function_id' => null, - 'type_id' => null, + 'inheritedLocation' => null, + 'iodeviceId' => null, + 'locationId' => null, + 'functionId' => null, + 'typeId' => null, 'iodevice' => null, 'location' => null, 'connected' => null, - 'supported_functions' => null + 'supportedFunctions' => null ]; /** @@ -132,24 +133,24 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'channel_number' => 'channelNumber', + 'channelNumber' => 'channelNumber', 'caption' => 'caption', 'type' => 'type', 'function' => 'function', 'param1' => 'param1', 'param2' => 'param2', 'param3' => 'param3', - 'alt_icon' => 'altIcon', + 'altIcon' => 'altIcon', 'hidden' => 'hidden', - 'inherited_location' => 'inheritedLocation', - 'iodevice_id' => 'iodeviceId', - 'location_id' => 'locationId', - 'function_id' => 'functionId', - 'type_id' => 'typeId', + 'inheritedLocation' => 'inheritedLocation', + 'iodeviceId' => 'iodeviceId', + 'locationId' => 'locationId', + 'functionId' => 'functionId', + 'typeId' => 'typeId', 'iodevice' => 'iodevice', 'location' => 'location', 'connected' => 'connected', - 'supported_functions' => 'supportedFunctions' + 'supportedFunctions' => 'supportedFunctions' ]; /** @@ -159,24 +160,24 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'channel_number' => 'setChannelNumber', + 'channelNumber' => 'setChannelNumber', 'caption' => 'setCaption', 'type' => 'setType', 'function' => 'setFunction', 'param1' => 'setParam1', 'param2' => 'setParam2', 'param3' => 'setParam3', - 'alt_icon' => 'setAltIcon', + 'altIcon' => 'setAltIcon', 'hidden' => 'setHidden', - 'inherited_location' => 'setInheritedLocation', - 'iodevice_id' => 'setIodeviceId', - 'location_id' => 'setLocationId', - 'function_id' => 'setFunctionId', - 'type_id' => 'setTypeId', + 'inheritedLocation' => 'setInheritedLocation', + 'iodeviceId' => 'setIodeviceId', + 'locationId' => 'setLocationId', + 'functionId' => 'setFunctionId', + 'typeId' => 'setTypeId', 'iodevice' => 'setIodevice', 'location' => 'setLocation', 'connected' => 'setConnected', - 'supported_functions' => 'setSupportedFunctions' + 'supportedFunctions' => 'setSupportedFunctions' ]; /** @@ -186,24 +187,24 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'channel_number' => 'getChannelNumber', + 'channelNumber' => 'getChannelNumber', 'caption' => 'getCaption', 'type' => 'getType', 'function' => 'getFunction', 'param1' => 'getParam1', 'param2' => 'getParam2', 'param3' => 'getParam3', - 'alt_icon' => 'getAltIcon', + 'altIcon' => 'getAltIcon', 'hidden' => 'getHidden', - 'inherited_location' => 'getInheritedLocation', - 'iodevice_id' => 'getIodeviceId', - 'location_id' => 'getLocationId', - 'function_id' => 'getFunctionId', - 'type_id' => 'getTypeId', + 'inheritedLocation' => 'getInheritedLocation', + 'iodeviceId' => 'getIodeviceId', + 'locationId' => 'getLocationId', + 'functionId' => 'getFunctionId', + 'typeId' => 'getTypeId', 'iodevice' => 'getIodevice', 'location' => 'getLocation', 'connected' => 'getConnected', - 'supported_functions' => 'getSupportedFunctions' + 'supportedFunctions' => 'getSupportedFunctions' ]; /** @@ -267,24 +268,24 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['channel_number'] = isset($data['channel_number']) ? $data['channel_number'] : null; + $this->container['channelNumber'] = isset($data['channelNumber']) ? $data['channelNumber'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['type'] = isset($data['type']) ? $data['type'] : null; $this->container['function'] = isset($data['function']) ? $data['function'] : null; $this->container['param1'] = isset($data['param1']) ? $data['param1'] : null; $this->container['param2'] = isset($data['param2']) ? $data['param2'] : null; $this->container['param3'] = isset($data['param3']) ? $data['param3'] : null; - $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['altIcon'] = isset($data['altIcon']) ? $data['altIcon'] : null; $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; - $this->container['inherited_location'] = isset($data['inherited_location']) ? $data['inherited_location'] : null; - $this->container['iodevice_id'] = isset($data['iodevice_id']) ? $data['iodevice_id'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; - $this->container['function_id'] = isset($data['function_id']) ? $data['function_id'] : null; - $this->container['type_id'] = isset($data['type_id']) ? $data['type_id'] : null; + $this->container['inheritedLocation'] = isset($data['inheritedLocation']) ? $data['inheritedLocation'] : null; + $this->container['iodeviceId'] = isset($data['iodeviceId']) ? $data['iodeviceId'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; + $this->container['functionId'] = isset($data['functionId']) ? $data['functionId'] : null; + $this->container['typeId'] = isset($data['typeId']) ? $data['typeId'] : null; $this->container['iodevice'] = isset($data['iodevice']) ? $data['iodevice'] : null; $this->container['location'] = isset($data['location']) ? $data['location'] : null; $this->container['connected'] = isset($data['connected']) ? $data['connected'] : null; - $this->container['supported_functions'] = isset($data['supported_functions']) ? $data['supported_functions'] : null; + $this->container['supportedFunctions'] = isset($data['supportedFunctions']) ? $data['supportedFunctions'] : null; } /** @@ -307,8 +308,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -337,25 +337,25 @@ public function setId($id) } /** - * Gets channel_number + * Gets channelNumber * * @return int */ public function getChannelNumber() { - return $this->container['channel_number']; + return $this->container['channelNumber']; } /** - * Sets channel_number + * Sets channelNumber * - * @param int $channel_number Channel ordinal number in its IO Device + * @param int $channelNumber Channel ordinal number in its IO Device * * @return $this */ - public function setChannelNumber($channel_number) + public function setChannelNumber($channelNumber) { - $this->container['channel_number'] = $channel_number; + $this->container['channelNumber'] = $channelNumber; return $this; } @@ -505,25 +505,25 @@ public function setParam3($param3) } /** - * Gets alt_icon + * Gets altIcon * * @return int */ public function getAltIcon() { - return $this->container['alt_icon']; + return $this->container['altIcon']; } /** - * Sets alt_icon + * Sets altIcon * - * @param int $alt_icon Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` + * @param int $altIcon Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` * * @return $this */ - public function setAltIcon($alt_icon) + public function setAltIcon($altIcon) { - $this->container['alt_icon'] = $alt_icon; + $this->container['altIcon'] = $altIcon; return $this; } @@ -553,121 +553,121 @@ public function setHidden($hidden) } /** - * Gets inherited_location + * Gets inheritedLocation * * @return bool */ public function getInheritedLocation() { - return $this->container['inherited_location']; + return $this->container['inheritedLocation']; } /** - * Sets inherited_location + * Sets inheritedLocation * - * @param bool $inherited_location Whether this channel inherits its IODevice's location (`true`) or not (`false`) + * @param bool $inheritedLocation Whether this channel inherits its IODevice's location (`true`) or not (`false`) * * @return $this */ - public function setInheritedLocation($inherited_location) + public function setInheritedLocation($inheritedLocation) { - $this->container['inherited_location'] = $inherited_location; + $this->container['inheritedLocation'] = $inheritedLocation; return $this; } /** - * Gets iodevice_id + * Gets iodeviceId * * @return int */ public function getIodeviceId() { - return $this->container['iodevice_id']; + return $this->container['iodeviceId']; } /** - * Sets iodevice_id + * Sets iodeviceId * - * @param int $iodevice_id iodevice_id + * @param int $iodeviceId iodeviceId * * @return $this */ - public function setIodeviceId($iodevice_id) + public function setIodeviceId($iodeviceId) { - $this->container['iodevice_id'] = $iodevice_id; + $this->container['iodeviceId'] = $iodeviceId; return $this; } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } /** - * Gets function_id + * Gets functionId * * @return int */ public function getFunctionId() { - return $this->container['function_id']; + return $this->container['functionId']; } /** - * Sets function_id + * Sets functionId * - * @param int $function_id function_id + * @param int $functionId functionId * * @return $this */ - public function setFunctionId($function_id) + public function setFunctionId($functionId) { - $this->container['function_id'] = $function_id; + $this->container['functionId'] = $functionId; return $this; } /** - * Gets type_id + * Gets typeId * * @return int */ public function getTypeId() { - return $this->container['type_id']; + return $this->container['typeId']; } /** - * Sets type_id + * Sets typeId * - * @param int $type_id type_id + * @param int $typeId typeId * * @return $this */ - public function setTypeId($type_id) + public function setTypeId($typeId) { - $this->container['type_id'] = $type_id; + $this->container['typeId'] = $typeId; return $this; } @@ -745,32 +745,32 @@ public function setConnected($connected) } /** - * Gets supported_functions + * Gets supportedFunctions * * @return \Swagger\Client\Model\ChannelFunction[] */ public function getSupportedFunctions() { - return $this->container['supported_functions']; + return $this->container['supportedFunctions']; } /** - * Sets supported_functions + * Sets supportedFunctions * - * @param \Swagger\Client\Model\ChannelFunction[] $supported_functions supported_functions + * @param \Swagger\Client\Model\ChannelFunction[] $supportedFunctions supportedFunctions * * @return $this */ - public function setSupportedFunctions($supported_functions) + public function setSupportedFunctions($supportedFunctions) { - $this->container['supported_functions'] = $supported_functions; + $this->container['supportedFunctions'] = $supportedFunctions; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -782,7 +782,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -794,8 +794,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -811,7 +811,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -838,3 +838,4 @@ public function __toString() } } + diff --git a/lib/Model/ChannelFunction.php b/lib/Model/ChannelFunction.php index d288bd7..8a7f0f6 100644 --- a/lib/Model/ChannelFunction.php +++ b/lib/Model/ChannelFunction.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ChannelFunction Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelFunction implements ModelInterface, ArrayAccess { @@ -59,8 +60,8 @@ class ChannelFunction implements ModelInterface, ArrayAccess 'id' => 'int', 'name' => '\Swagger\Client\Model\ChannelFunctionEnumNames', 'caption' => 'string', - 'max_alternative_icon_index' => 'int', - 'possible_actions' => '\Swagger\Client\Model\ChannelFunctionAction[]' + 'maxAlternativeIconIndex' => 'int', + 'possibleActions' => '\Swagger\Client\Model\ChannelFunctionAction[]' ]; /** @@ -72,8 +73,8 @@ class ChannelFunction implements ModelInterface, ArrayAccess 'id' => null, 'name' => null, 'caption' => null, - 'max_alternative_icon_index' => null, - 'possible_actions' => null + 'maxAlternativeIconIndex' => null, + 'possibleActions' => null ]; /** @@ -106,8 +107,8 @@ public static function swaggerFormats() 'id' => 'id', 'name' => 'name', 'caption' => 'caption', - 'max_alternative_icon_index' => 'maxAlternativeIconIndex', - 'possible_actions' => 'possibleActions' + 'maxAlternativeIconIndex' => 'maxAlternativeIconIndex', + 'possibleActions' => 'possibleActions' ]; /** @@ -119,8 +120,8 @@ public static function swaggerFormats() 'id' => 'setId', 'name' => 'setName', 'caption' => 'setCaption', - 'max_alternative_icon_index' => 'setMaxAlternativeIconIndex', - 'possible_actions' => 'setPossibleActions' + 'maxAlternativeIconIndex' => 'setMaxAlternativeIconIndex', + 'possibleActions' => 'setPossibleActions' ]; /** @@ -132,8 +133,8 @@ public static function swaggerFormats() 'id' => 'getId', 'name' => 'getName', 'caption' => 'getCaption', - 'max_alternative_icon_index' => 'getMaxAlternativeIconIndex', - 'possible_actions' => 'getPossibleActions' + 'maxAlternativeIconIndex' => 'getMaxAlternativeIconIndex', + 'possibleActions' => 'getPossibleActions' ]; /** @@ -199,8 +200,8 @@ public function __construct(array $data = null) $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['max_alternative_icon_index'] = isset($data['max_alternative_icon_index']) ? $data['max_alternative_icon_index'] : null; - $this->container['possible_actions'] = isset($data['possible_actions']) ? $data['possible_actions'] : null; + $this->container['maxAlternativeIconIndex'] = isset($data['maxAlternativeIconIndex']) ? $data['maxAlternativeIconIndex'] : null; + $this->container['possibleActions'] = isset($data['possibleActions']) ? $data['possibleActions'] : null; } /** @@ -223,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -301,56 +301,56 @@ public function setCaption($caption) } /** - * Gets max_alternative_icon_index + * Gets maxAlternativeIconIndex * * @return int */ public function getMaxAlternativeIconIndex() { - return $this->container['max_alternative_icon_index']; + return $this->container['maxAlternativeIconIndex']; } /** - * Sets max_alternative_icon_index + * Sets maxAlternativeIconIndex * - * @param int $max_alternative_icon_index max_alternative_icon_index + * @param int $maxAlternativeIconIndex maxAlternativeIconIndex * * @return $this */ - public function setMaxAlternativeIconIndex($max_alternative_icon_index) + public function setMaxAlternativeIconIndex($maxAlternativeIconIndex) { - $this->container['max_alternative_icon_index'] = $max_alternative_icon_index; + $this->container['maxAlternativeIconIndex'] = $maxAlternativeIconIndex; return $this; } /** - * Gets possible_actions + * Gets possibleActions * * @return \Swagger\Client\Model\ChannelFunctionAction[] */ public function getPossibleActions() { - return $this->container['possible_actions']; + return $this->container['possibleActions']; } /** - * Sets possible_actions + * Sets possibleActions * - * @param \Swagger\Client\Model\ChannelFunctionAction[] $possible_actions What can you with with this channel? + * @param \Swagger\Client\Model\ChannelFunctionAction[] $possibleActions What can you with with this channel? * * @return $this */ - public function setPossibleActions($possible_actions) + public function setPossibleActions($possibleActions) { - $this->container['possible_actions'] = $possible_actions; + $this->container['possibleActions'] = $possibleActions; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -362,7 +362,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -374,8 +374,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -391,7 +391,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -418,3 +418,4 @@ public function __toString() } } + diff --git a/lib/Model/ChannelFunctionAction.php b/lib/Model/ChannelFunctionAction.php index b5bad19..5ebeef7 100644 --- a/lib/Model/ChannelFunctionAction.php +++ b/lib/Model/ChannelFunctionAction.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ChannelFunctionAction Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelFunctionAction implements ModelInterface, ArrayAccess { @@ -211,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -290,7 +290,7 @@ public function setCaption($caption) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -302,7 +302,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -314,8 +314,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -331,7 +331,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -358,3 +358,4 @@ public function __toString() } } + diff --git a/lib/Model/ChannelFunctionActionEnum.php b/lib/Model/ChannelFunctionActionEnum.php index 335c86c..ad1a377 100644 --- a/lib/Model/ChannelFunctionActionEnum.php +++ b/lib/Model/ChannelFunctionActionEnum.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -33,9 +34,9 @@ * ChannelFunctionActionEnum Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelFunctionActionEnum { diff --git a/lib/Model/ChannelFunctionEnumNames.php b/lib/Model/ChannelFunctionEnumNames.php index a3e5b40..7298839 100644 --- a/lib/Model/ChannelFunctionEnumNames.php +++ b/lib/Model/ChannelFunctionEnumNames.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -33,9 +34,9 @@ * ChannelFunctionEnumNames Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelFunctionEnumNames { diff --git a/lib/Model/ChannelGroup.php b/lib/Model/ChannelGroup.php index 5fbe022..95cd69c 100644 --- a/lib/Model/ChannelGroup.php +++ b/lib/Model/ChannelGroup.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ChannelGroup Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelGroup implements ModelInterface, ArrayAccess { @@ -60,12 +61,12 @@ class ChannelGroup implements ModelInterface, ArrayAccess 'hidden' => 'bool', 'caption' => 'string', 'function' => '\Swagger\Client\Model\ChannelFunction', - 'function_id' => 'int', - 'location_id' => 'int', + 'functionId' => 'int', + 'locationId' => 'int', 'location' => '\Swagger\Client\Model\Location', - 'channel_ids' => 'int[]', + 'channelIds' => 'int[]', 'channels' => '\Swagger\Client\Model\Channel[]', - 'alt_icon' => 'int' + 'altIcon' => 'int' ]; /** @@ -78,12 +79,12 @@ class ChannelGroup implements ModelInterface, ArrayAccess 'hidden' => null, 'caption' => null, 'function' => null, - 'function_id' => null, - 'location_id' => null, + 'functionId' => null, + 'locationId' => null, 'location' => null, - 'channel_ids' => null, + 'channelIds' => null, 'channels' => null, - 'alt_icon' => null + 'altIcon' => null ]; /** @@ -117,12 +118,12 @@ public static function swaggerFormats() 'hidden' => 'hidden', 'caption' => 'caption', 'function' => 'function', - 'function_id' => 'functionId', - 'location_id' => 'locationId', + 'functionId' => 'functionId', + 'locationId' => 'locationId', 'location' => 'location', - 'channel_ids' => 'channelIds', + 'channelIds' => 'channelIds', 'channels' => 'channels', - 'alt_icon' => 'altIcon' + 'altIcon' => 'altIcon' ]; /** @@ -135,12 +136,12 @@ public static function swaggerFormats() 'hidden' => 'setHidden', 'caption' => 'setCaption', 'function' => 'setFunction', - 'function_id' => 'setFunctionId', - 'location_id' => 'setLocationId', + 'functionId' => 'setFunctionId', + 'locationId' => 'setLocationId', 'location' => 'setLocation', - 'channel_ids' => 'setChannelIds', + 'channelIds' => 'setChannelIds', 'channels' => 'setChannels', - 'alt_icon' => 'setAltIcon' + 'altIcon' => 'setAltIcon' ]; /** @@ -153,12 +154,12 @@ public static function swaggerFormats() 'hidden' => 'getHidden', 'caption' => 'getCaption', 'function' => 'getFunction', - 'function_id' => 'getFunctionId', - 'location_id' => 'getLocationId', + 'functionId' => 'getFunctionId', + 'locationId' => 'getLocationId', 'location' => 'getLocation', - 'channel_ids' => 'getChannelIds', + 'channelIds' => 'getChannelIds', 'channels' => 'getChannels', - 'alt_icon' => 'getAltIcon' + 'altIcon' => 'getAltIcon' ]; /** @@ -225,12 +226,12 @@ public function __construct(array $data = null) $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['function'] = isset($data['function']) ? $data['function'] : null; - $this->container['function_id'] = isset($data['function_id']) ? $data['function_id'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; + $this->container['functionId'] = isset($data['functionId']) ? $data['functionId'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; $this->container['location'] = isset($data['location']) ? $data['location'] : null; - $this->container['channel_ids'] = isset($data['channel_ids']) ? $data['channel_ids'] : null; + $this->container['channelIds'] = isset($data['channelIds']) ? $data['channelIds'] : null; $this->container['channels'] = isset($data['channels']) ? $data['channels'] : null; - $this->container['alt_icon'] = isset($data['alt_icon']) ? $data['alt_icon'] : null; + $this->container['altIcon'] = isset($data['altIcon']) ? $data['altIcon'] : null; } /** @@ -253,8 +254,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -355,49 +355,49 @@ public function setFunction($function) } /** - * Gets function_id + * Gets functionId * * @return int */ public function getFunctionId() { - return $this->container['function_id']; + return $this->container['functionId']; } /** - * Sets function_id + * Sets functionId * - * @param int $function_id function_id + * @param int $functionId functionId * * @return $this */ - public function setFunctionId($function_id) + public function setFunctionId($functionId) { - $this->container['function_id'] = $function_id; + $this->container['functionId'] = $functionId; return $this; } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } @@ -427,25 +427,25 @@ public function setLocation($location) } /** - * Gets channel_ids + * Gets channelIds * * @return int[] */ public function getChannelIds() { - return $this->container['channel_ids']; + return $this->container['channelIds']; } /** - * Sets channel_ids + * Sets channelIds * - * @param int[] $channel_ids channel_ids + * @param int[] $channelIds channelIds * * @return $this */ - public function setChannelIds($channel_ids) + public function setChannelIds($channelIds) { - $this->container['channel_ids'] = $channel_ids; + $this->container['channelIds'] = $channelIds; return $this; } @@ -475,32 +475,32 @@ public function setChannels($channels) } /** - * Gets alt_icon + * Gets altIcon * * @return int */ public function getAltIcon() { - return $this->container['alt_icon']; + return $this->container['altIcon']; } /** - * Sets alt_icon + * Sets altIcon * - * @param int $alt_icon Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` + * @param int $altIcon Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` * * @return $this */ - public function setAltIcon($alt_icon) + public function setAltIcon($altIcon) { - $this->container['alt_icon'] = $alt_icon; + $this->container['altIcon'] = $altIcon; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -512,7 +512,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -524,8 +524,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -541,7 +541,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -568,3 +568,4 @@ public function __toString() } } + diff --git a/lib/Model/ChannelParam.php b/lib/Model/ChannelParam.php index edce629..6ac1701 100644 --- a/lib/Model/ChannelParam.php +++ b/lib/Model/ChannelParam.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -36,9 +37,9 @@ * * @category Class * @description Configuration of the channel behavior. Value meaning depends on the chosen channel function. See more details on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Functions-parameters). - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelParam implements ModelInterface, ArrayAccess { @@ -199,14 +200,13 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -218,7 +218,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -230,8 +230,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -247,7 +247,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -274,3 +274,4 @@ public function __toString() } } + diff --git a/lib/Model/ChannelType.php b/lib/Model/ChannelType.php index 306f81d..a50d047 100644 --- a/lib/Model/ChannelType.php +++ b/lib/Model/ChannelType.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ChannelType Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ChannelType implements ModelInterface, ArrayAccess { @@ -268,7 +269,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getNameAllowableValues(); - if (!in_array($this->container['name'], $allowedValues)) { + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'name', must be one of '%s'", implode("', '", $allowedValues) @@ -286,12 +287,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getNameAllowableValues(); - if (!in_array($this->container['name'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -339,7 +335,7 @@ public function getName() public function setName($name) { $allowedValues = $this->getNameAllowableValues(); - if (!is_null($name) && !in_array($name, $allowedValues)) { + if (!is_null($name) && !in_array($name, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'name', must be one of '%s'", @@ -402,7 +398,7 @@ public function setOutput($output) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -414,7 +410,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -426,8 +422,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -443,7 +439,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -470,3 +466,4 @@ public function __toString() } } + diff --git a/lib/Model/ClientApp.php b/lib/Model/ClientApp.php index 1e8b484..d24f34c 100644 --- a/lib/Model/ClientApp.php +++ b/lib/Model/ClientApp.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ClientApp Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ClientApp implements ModelInterface, ArrayAccess { @@ -60,15 +61,15 @@ class ClientApp implements ModelInterface, ArrayAccess 'name' => 'string', 'caption' => 'string', 'enabled' => 'bool', - 'reg_ipv4' => 'int', - 'reg_date' => '\DateTime', - 'last_access_ipv4' => 'int', - 'last_access_date' => '\DateTime', - 'software_version' => 'string', - 'protocol_version' => 'int', - 'access_id_id' => 'int', + 'regIpv4' => 'int', + 'regDate' => '\DateTime', + 'lastAccessIpv4' => 'int', + 'lastAccessDate' => '\DateTime', + 'softwareVersion' => 'string', + 'protocolVersion' => 'int', + 'accessIdId' => 'int', 'connected' => 'bool', - 'access_id' => '\Swagger\Client\Model\AccessID' + 'accessId' => '\Swagger\Client\Model\AccessID' ]; /** @@ -81,15 +82,15 @@ class ClientApp implements ModelInterface, ArrayAccess 'name' => null, 'caption' => null, 'enabled' => null, - 'reg_ipv4' => null, - 'reg_date' => 'date-time', - 'last_access_ipv4' => null, - 'last_access_date' => 'date-time', - 'software_version' => null, - 'protocol_version' => null, - 'access_id_id' => null, + 'regIpv4' => null, + 'regDate' => 'date-time', + 'lastAccessIpv4' => null, + 'lastAccessDate' => 'date-time', + 'softwareVersion' => null, + 'protocolVersion' => null, + 'accessIdId' => null, 'connected' => null, - 'access_id' => null + 'accessId' => null ]; /** @@ -123,15 +124,15 @@ public static function swaggerFormats() 'name' => 'name', 'caption' => 'caption', 'enabled' => 'enabled', - 'reg_ipv4' => 'regIpv4', - 'reg_date' => 'regDate', - 'last_access_ipv4' => 'lastAccessIpv4', - 'last_access_date' => 'lastAccessDate', - 'software_version' => 'softwareVersion', - 'protocol_version' => 'protocolVersion', - 'access_id_id' => 'accessIdId', + 'regIpv4' => 'regIpv4', + 'regDate' => 'regDate', + 'lastAccessIpv4' => 'lastAccessIpv4', + 'lastAccessDate' => 'lastAccessDate', + 'softwareVersion' => 'softwareVersion', + 'protocolVersion' => 'protocolVersion', + 'accessIdId' => 'accessIdId', 'connected' => 'connected', - 'access_id' => 'accessId' + 'accessId' => 'accessId' ]; /** @@ -144,15 +145,15 @@ public static function swaggerFormats() 'name' => 'setName', 'caption' => 'setCaption', 'enabled' => 'setEnabled', - 'reg_ipv4' => 'setRegIpv4', - 'reg_date' => 'setRegDate', - 'last_access_ipv4' => 'setLastAccessIpv4', - 'last_access_date' => 'setLastAccessDate', - 'software_version' => 'setSoftwareVersion', - 'protocol_version' => 'setProtocolVersion', - 'access_id_id' => 'setAccessIdId', + 'regIpv4' => 'setRegIpv4', + 'regDate' => 'setRegDate', + 'lastAccessIpv4' => 'setLastAccessIpv4', + 'lastAccessDate' => 'setLastAccessDate', + 'softwareVersion' => 'setSoftwareVersion', + 'protocolVersion' => 'setProtocolVersion', + 'accessIdId' => 'setAccessIdId', 'connected' => 'setConnected', - 'access_id' => 'setAccessId' + 'accessId' => 'setAccessId' ]; /** @@ -165,15 +166,15 @@ public static function swaggerFormats() 'name' => 'getName', 'caption' => 'getCaption', 'enabled' => 'getEnabled', - 'reg_ipv4' => 'getRegIpv4', - 'reg_date' => 'getRegDate', - 'last_access_ipv4' => 'getLastAccessIpv4', - 'last_access_date' => 'getLastAccessDate', - 'software_version' => 'getSoftwareVersion', - 'protocol_version' => 'getProtocolVersion', - 'access_id_id' => 'getAccessIdId', + 'regIpv4' => 'getRegIpv4', + 'regDate' => 'getRegDate', + 'lastAccessIpv4' => 'getLastAccessIpv4', + 'lastAccessDate' => 'getLastAccessDate', + 'softwareVersion' => 'getSoftwareVersion', + 'protocolVersion' => 'getProtocolVersion', + 'accessIdId' => 'getAccessIdId', 'connected' => 'getConnected', - 'access_id' => 'getAccessId' + 'accessId' => 'getAccessId' ]; /** @@ -240,15 +241,15 @@ public function __construct(array $data = null) $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['reg_ipv4'] = isset($data['reg_ipv4']) ? $data['reg_ipv4'] : null; - $this->container['reg_date'] = isset($data['reg_date']) ? $data['reg_date'] : null; - $this->container['last_access_ipv4'] = isset($data['last_access_ipv4']) ? $data['last_access_ipv4'] : null; - $this->container['last_access_date'] = isset($data['last_access_date']) ? $data['last_access_date'] : null; - $this->container['software_version'] = isset($data['software_version']) ? $data['software_version'] : null; - $this->container['protocol_version'] = isset($data['protocol_version']) ? $data['protocol_version'] : null; - $this->container['access_id_id'] = isset($data['access_id_id']) ? $data['access_id_id'] : null; + $this->container['regIpv4'] = isset($data['regIpv4']) ? $data['regIpv4'] : null; + $this->container['regDate'] = isset($data['regDate']) ? $data['regDate'] : null; + $this->container['lastAccessIpv4'] = isset($data['lastAccessIpv4']) ? $data['lastAccessIpv4'] : null; + $this->container['lastAccessDate'] = isset($data['lastAccessDate']) ? $data['lastAccessDate'] : null; + $this->container['softwareVersion'] = isset($data['softwareVersion']) ? $data['softwareVersion'] : null; + $this->container['protocolVersion'] = isset($data['protocolVersion']) ? $data['protocolVersion'] : null; + $this->container['accessIdId'] = isset($data['accessIdId']) ? $data['accessIdId'] : null; $this->container['connected'] = isset($data['connected']) ? $data['connected'] : null; - $this->container['access_id'] = isset($data['access_id']) ? $data['access_id'] : null; + $this->container['accessId'] = isset($data['accessId']) ? $data['accessId'] : null; } /** @@ -271,8 +272,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -373,169 +373,169 @@ public function setEnabled($enabled) } /** - * Gets reg_ipv4 + * Gets regIpv4 * * @return int */ public function getRegIpv4() { - return $this->container['reg_ipv4']; + return $this->container['regIpv4']; } /** - * Sets reg_ipv4 + * Sets regIpv4 * - * @param int $reg_ipv4 reg_ipv4 + * @param int $regIpv4 regIpv4 * * @return $this */ - public function setRegIpv4($reg_ipv4) + public function setRegIpv4($regIpv4) { - $this->container['reg_ipv4'] = $reg_ipv4; + $this->container['regIpv4'] = $regIpv4; return $this; } /** - * Gets reg_date + * Gets regDate * * @return \DateTime */ public function getRegDate() { - return $this->container['reg_date']; + return $this->container['regDate']; } /** - * Sets reg_date + * Sets regDate * - * @param \DateTime $reg_date reg_date + * @param \DateTime $regDate regDate * * @return $this */ - public function setRegDate($reg_date) + public function setRegDate($regDate) { - $this->container['reg_date'] = $reg_date; + $this->container['regDate'] = $regDate; return $this; } /** - * Gets last_access_ipv4 + * Gets lastAccessIpv4 * * @return int */ public function getLastAccessIpv4() { - return $this->container['last_access_ipv4']; + return $this->container['lastAccessIpv4']; } /** - * Sets last_access_ipv4 + * Sets lastAccessIpv4 * - * @param int $last_access_ipv4 last_access_ipv4 + * @param int $lastAccessIpv4 lastAccessIpv4 * * @return $this */ - public function setLastAccessIpv4($last_access_ipv4) + public function setLastAccessIpv4($lastAccessIpv4) { - $this->container['last_access_ipv4'] = $last_access_ipv4; + $this->container['lastAccessIpv4'] = $lastAccessIpv4; return $this; } /** - * Gets last_access_date + * Gets lastAccessDate * * @return \DateTime */ public function getLastAccessDate() { - return $this->container['last_access_date']; + return $this->container['lastAccessDate']; } /** - * Sets last_access_date + * Sets lastAccessDate * - * @param \DateTime $last_access_date last_access_date + * @param \DateTime $lastAccessDate lastAccessDate * * @return $this */ - public function setLastAccessDate($last_access_date) + public function setLastAccessDate($lastAccessDate) { - $this->container['last_access_date'] = $last_access_date; + $this->container['lastAccessDate'] = $lastAccessDate; return $this; } /** - * Gets software_version + * Gets softwareVersion * * @return string */ public function getSoftwareVersion() { - return $this->container['software_version']; + return $this->container['softwareVersion']; } /** - * Sets software_version + * Sets softwareVersion * - * @param string $software_version software_version + * @param string $softwareVersion softwareVersion * * @return $this */ - public function setSoftwareVersion($software_version) + public function setSoftwareVersion($softwareVersion) { - $this->container['software_version'] = $software_version; + $this->container['softwareVersion'] = $softwareVersion; return $this; } /** - * Gets protocol_version + * Gets protocolVersion * * @return int */ public function getProtocolVersion() { - return $this->container['protocol_version']; + return $this->container['protocolVersion']; } /** - * Sets protocol_version + * Sets protocolVersion * - * @param int $protocol_version protocol_version + * @param int $protocolVersion protocolVersion * * @return $this */ - public function setProtocolVersion($protocol_version) + public function setProtocolVersion($protocolVersion) { - $this->container['protocol_version'] = $protocol_version; + $this->container['protocolVersion'] = $protocolVersion; return $this; } /** - * Gets access_id_id + * Gets accessIdId * * @return int */ public function getAccessIdId() { - return $this->container['access_id_id']; + return $this->container['accessIdId']; } /** - * Sets access_id_id + * Sets accessIdId * - * @param int $access_id_id access_id_id + * @param int $accessIdId accessIdId * * @return $this */ - public function setAccessIdId($access_id_id) + public function setAccessIdId($accessIdId) { - $this->container['access_id_id'] = $access_id_id; + $this->container['accessIdId'] = $accessIdId; return $this; } @@ -565,32 +565,32 @@ public function setConnected($connected) } /** - * Gets access_id + * Gets accessId * * @return \Swagger\Client\Model\AccessID */ public function getAccessId() { - return $this->container['access_id']; + return $this->container['accessId']; } /** - * Sets access_id + * Sets accessId * - * @param \Swagger\Client\Model\AccessID $access_id access_id + * @param \Swagger\Client\Model\AccessID $accessId accessId * * @return $this */ - public function setAccessId($access_id) + public function setAccessId($accessId) { - $this->container['access_id'] = $access_id; + $this->container['accessId'] = $accessId; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -602,7 +602,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -614,8 +614,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -631,7 +631,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -658,3 +658,4 @@ public function __toString() } } + diff --git a/lib/Model/Device.php b/lib/Model/Device.php index cb2d948..545a426 100644 --- a/lib/Model/Device.php +++ b/lib/Model/Device.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Device Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Device implements ModelInterface, ArrayAccess { @@ -60,18 +61,18 @@ class Device implements ModelInterface, ArrayAccess 'name' => 'string', 'enabled' => 'bool', 'comment' => 'string', - 'reg_date' => '\DateTime', - 'reg_ipv4' => 'int', - 'last_connected' => '\DateTime', - 'last_ipv4' => 'int', - 'software_version' => 'string', - 'g_uid_string' => 'string', - 'location_id' => 'int', - 'original_location_id' => 'int', - 'channels_ids' => 'int[]', + 'regDate' => '\DateTime', + 'regIpv4' => 'int', + 'lastConnected' => '\DateTime', + 'lastIpv4' => 'int', + 'softwareVersion' => 'string', + 'gUIDString' => 'string', + 'locationId' => 'int', + 'originalLocationId' => 'int', + 'channelsIds' => 'int[]', 'connected' => 'bool', 'location' => '\Swagger\Client\Model\Location', - 'original_location' => '\Swagger\Client\Model\Location', + 'originalLocation' => '\Swagger\Client\Model\Location', 'channels' => '\Swagger\Client\Model\Channel[]', 'schedules' => '\Swagger\Client\Model\Schedule[]' ]; @@ -86,18 +87,18 @@ class Device implements ModelInterface, ArrayAccess 'name' => null, 'enabled' => null, 'comment' => null, - 'reg_date' => 'date-time', - 'reg_ipv4' => null, - 'last_connected' => 'date-time', - 'last_ipv4' => null, - 'software_version' => null, - 'g_uid_string' => null, - 'location_id' => null, - 'original_location_id' => null, - 'channels_ids' => null, + 'regDate' => 'date-time', + 'regIpv4' => null, + 'lastConnected' => 'date-time', + 'lastIpv4' => null, + 'softwareVersion' => null, + 'gUIDString' => null, + 'locationId' => null, + 'originalLocationId' => null, + 'channelsIds' => null, 'connected' => null, 'location' => null, - 'original_location' => null, + 'originalLocation' => null, 'channels' => null, 'schedules' => null ]; @@ -133,18 +134,18 @@ public static function swaggerFormats() 'name' => 'name', 'enabled' => 'enabled', 'comment' => 'comment', - 'reg_date' => 'regDate', - 'reg_ipv4' => 'regIpv4', - 'last_connected' => 'lastConnected', - 'last_ipv4' => 'lastIpv4', - 'software_version' => 'softwareVersion', - 'g_uid_string' => 'gUIDString', - 'location_id' => 'locationId', - 'original_location_id' => 'originalLocationId', - 'channels_ids' => 'channelsIds', + 'regDate' => 'regDate', + 'regIpv4' => 'regIpv4', + 'lastConnected' => 'lastConnected', + 'lastIpv4' => 'lastIpv4', + 'softwareVersion' => 'softwareVersion', + 'gUIDString' => 'gUIDString', + 'locationId' => 'locationId', + 'originalLocationId' => 'originalLocationId', + 'channelsIds' => 'channelsIds', 'connected' => 'connected', 'location' => 'location', - 'original_location' => 'originalLocation', + 'originalLocation' => 'originalLocation', 'channels' => 'channels', 'schedules' => 'schedules' ]; @@ -159,18 +160,18 @@ public static function swaggerFormats() 'name' => 'setName', 'enabled' => 'setEnabled', 'comment' => 'setComment', - 'reg_date' => 'setRegDate', - 'reg_ipv4' => 'setRegIpv4', - 'last_connected' => 'setLastConnected', - 'last_ipv4' => 'setLastIpv4', - 'software_version' => 'setSoftwareVersion', - 'g_uid_string' => 'setGUidString', - 'location_id' => 'setLocationId', - 'original_location_id' => 'setOriginalLocationId', - 'channels_ids' => 'setChannelsIds', + 'regDate' => 'setRegDate', + 'regIpv4' => 'setRegIpv4', + 'lastConnected' => 'setLastConnected', + 'lastIpv4' => 'setLastIpv4', + 'softwareVersion' => 'setSoftwareVersion', + 'gUIDString' => 'setGUIDString', + 'locationId' => 'setLocationId', + 'originalLocationId' => 'setOriginalLocationId', + 'channelsIds' => 'setChannelsIds', 'connected' => 'setConnected', 'location' => 'setLocation', - 'original_location' => 'setOriginalLocation', + 'originalLocation' => 'setOriginalLocation', 'channels' => 'setChannels', 'schedules' => 'setSchedules' ]; @@ -185,18 +186,18 @@ public static function swaggerFormats() 'name' => 'getName', 'enabled' => 'getEnabled', 'comment' => 'getComment', - 'reg_date' => 'getRegDate', - 'reg_ipv4' => 'getRegIpv4', - 'last_connected' => 'getLastConnected', - 'last_ipv4' => 'getLastIpv4', - 'software_version' => 'getSoftwareVersion', - 'g_uid_string' => 'getGUidString', - 'location_id' => 'getLocationId', - 'original_location_id' => 'getOriginalLocationId', - 'channels_ids' => 'getChannelsIds', + 'regDate' => 'getRegDate', + 'regIpv4' => 'getRegIpv4', + 'lastConnected' => 'getLastConnected', + 'lastIpv4' => 'getLastIpv4', + 'softwareVersion' => 'getSoftwareVersion', + 'gUIDString' => 'getGUIDString', + 'locationId' => 'getLocationId', + 'originalLocationId' => 'getOriginalLocationId', + 'channelsIds' => 'getChannelsIds', 'connected' => 'getConnected', 'location' => 'getLocation', - 'original_location' => 'getOriginalLocation', + 'originalLocation' => 'getOriginalLocation', 'channels' => 'getChannels', 'schedules' => 'getSchedules' ]; @@ -265,18 +266,18 @@ public function __construct(array $data = null) $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null; - $this->container['reg_date'] = isset($data['reg_date']) ? $data['reg_date'] : null; - $this->container['reg_ipv4'] = isset($data['reg_ipv4']) ? $data['reg_ipv4'] : null; - $this->container['last_connected'] = isset($data['last_connected']) ? $data['last_connected'] : null; - $this->container['last_ipv4'] = isset($data['last_ipv4']) ? $data['last_ipv4'] : null; - $this->container['software_version'] = isset($data['software_version']) ? $data['software_version'] : null; - $this->container['g_uid_string'] = isset($data['g_uid_string']) ? $data['g_uid_string'] : null; - $this->container['location_id'] = isset($data['location_id']) ? $data['location_id'] : null; - $this->container['original_location_id'] = isset($data['original_location_id']) ? $data['original_location_id'] : null; - $this->container['channels_ids'] = isset($data['channels_ids']) ? $data['channels_ids'] : null; + $this->container['regDate'] = isset($data['regDate']) ? $data['regDate'] : null; + $this->container['regIpv4'] = isset($data['regIpv4']) ? $data['regIpv4'] : null; + $this->container['lastConnected'] = isset($data['lastConnected']) ? $data['lastConnected'] : null; + $this->container['lastIpv4'] = isset($data['lastIpv4']) ? $data['lastIpv4'] : null; + $this->container['softwareVersion'] = isset($data['softwareVersion']) ? $data['softwareVersion'] : null; + $this->container['gUIDString'] = isset($data['gUIDString']) ? $data['gUIDString'] : null; + $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; + $this->container['originalLocationId'] = isset($data['originalLocationId']) ? $data['originalLocationId'] : null; + $this->container['channelsIds'] = isset($data['channelsIds']) ? $data['channelsIds'] : null; $this->container['connected'] = isset($data['connected']) ? $data['connected'] : null; $this->container['location'] = isset($data['location']) ? $data['location'] : null; - $this->container['original_location'] = isset($data['original_location']) ? $data['original_location'] : null; + $this->container['originalLocation'] = isset($data['originalLocation']) ? $data['originalLocation'] : null; $this->container['channels'] = isset($data['channels']) ? $data['channels'] : null; $this->container['schedules'] = isset($data['schedules']) ? $data['schedules'] : null; } @@ -301,8 +302,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -403,217 +403,217 @@ public function setComment($comment) } /** - * Gets reg_date + * Gets regDate * * @return \DateTime */ public function getRegDate() { - return $this->container['reg_date']; + return $this->container['regDate']; } /** - * Sets reg_date + * Sets regDate * - * @param \DateTime $reg_date reg_date + * @param \DateTime $regDate regDate * * @return $this */ - public function setRegDate($reg_date) + public function setRegDate($regDate) { - $this->container['reg_date'] = $reg_date; + $this->container['regDate'] = $regDate; return $this; } /** - * Gets reg_ipv4 + * Gets regIpv4 * * @return int */ public function getRegIpv4() { - return $this->container['reg_ipv4']; + return $this->container['regIpv4']; } /** - * Sets reg_ipv4 + * Sets regIpv4 * - * @param int $reg_ipv4 reg_ipv4 + * @param int $regIpv4 regIpv4 * * @return $this */ - public function setRegIpv4($reg_ipv4) + public function setRegIpv4($regIpv4) { - $this->container['reg_ipv4'] = $reg_ipv4; + $this->container['regIpv4'] = $regIpv4; return $this; } /** - * Gets last_connected + * Gets lastConnected * * @return \DateTime */ public function getLastConnected() { - return $this->container['last_connected']; + return $this->container['lastConnected']; } /** - * Sets last_connected + * Sets lastConnected * - * @param \DateTime $last_connected last_connected + * @param \DateTime $lastConnected lastConnected * * @return $this */ - public function setLastConnected($last_connected) + public function setLastConnected($lastConnected) { - $this->container['last_connected'] = $last_connected; + $this->container['lastConnected'] = $lastConnected; return $this; } /** - * Gets last_ipv4 + * Gets lastIpv4 * * @return int */ public function getLastIpv4() { - return $this->container['last_ipv4']; + return $this->container['lastIpv4']; } /** - * Sets last_ipv4 + * Sets lastIpv4 * - * @param int $last_ipv4 last_ipv4 + * @param int $lastIpv4 lastIpv4 * * @return $this */ - public function setLastIpv4($last_ipv4) + public function setLastIpv4($lastIpv4) { - $this->container['last_ipv4'] = $last_ipv4; + $this->container['lastIpv4'] = $lastIpv4; return $this; } /** - * Gets software_version + * Gets softwareVersion * * @return string */ public function getSoftwareVersion() { - return $this->container['software_version']; + return $this->container['softwareVersion']; } /** - * Sets software_version + * Sets softwareVersion * - * @param string $software_version software_version + * @param string $softwareVersion softwareVersion * * @return $this */ - public function setSoftwareVersion($software_version) + public function setSoftwareVersion($softwareVersion) { - $this->container['software_version'] = $software_version; + $this->container['softwareVersion'] = $softwareVersion; return $this; } /** - * Gets g_uid_string + * Gets gUIDString * * @return string */ - public function getGUidString() + public function getGUIDString() { - return $this->container['g_uid_string']; + return $this->container['gUIDString']; } /** - * Sets g_uid_string + * Sets gUIDString * - * @param string $g_uid_string g_uid_string + * @param string $gUIDString gUIDString * * @return $this */ - public function setGUidString($g_uid_string) + public function setGUIDString($gUIDString) { - $this->container['g_uid_string'] = $g_uid_string; + $this->container['gUIDString'] = $gUIDString; return $this; } /** - * Gets location_id + * Gets locationId * * @return int */ public function getLocationId() { - return $this->container['location_id']; + return $this->container['locationId']; } /** - * Sets location_id + * Sets locationId * - * @param int $location_id location_id + * @param int $locationId locationId * * @return $this */ - public function setLocationId($location_id) + public function setLocationId($locationId) { - $this->container['location_id'] = $location_id; + $this->container['locationId'] = $locationId; return $this; } /** - * Gets original_location_id + * Gets originalLocationId * * @return int */ public function getOriginalLocationId() { - return $this->container['original_location_id']; + return $this->container['originalLocationId']; } /** - * Sets original_location_id + * Sets originalLocationId * - * @param int $original_location_id original_location_id + * @param int $originalLocationId originalLocationId * * @return $this */ - public function setOriginalLocationId($original_location_id) + public function setOriginalLocationId($originalLocationId) { - $this->container['original_location_id'] = $original_location_id; + $this->container['originalLocationId'] = $originalLocationId; return $this; } /** - * Gets channels_ids + * Gets channelsIds * * @return int[] */ public function getChannelsIds() { - return $this->container['channels_ids']; + return $this->container['channelsIds']; } /** - * Sets channels_ids + * Sets channelsIds * - * @param int[] $channels_ids channels_ids + * @param int[] $channelsIds channelsIds * * @return $this */ - public function setChannelsIds($channels_ids) + public function setChannelsIds($channelsIds) { - $this->container['channels_ids'] = $channels_ids; + $this->container['channelsIds'] = $channelsIds; return $this; } @@ -667,25 +667,25 @@ public function setLocation($location) } /** - * Gets original_location + * Gets originalLocation * * @return \Swagger\Client\Model\Location */ public function getOriginalLocation() { - return $this->container['original_location']; + return $this->container['originalLocation']; } /** - * Sets original_location + * Sets originalLocation * - * @param \Swagger\Client\Model\Location $original_location original_location + * @param \Swagger\Client\Model\Location $originalLocation originalLocation * * @return $this */ - public function setOriginalLocation($original_location) + public function setOriginalLocation($originalLocation) { - $this->container['original_location'] = $original_location; + $this->container['originalLocation'] = $originalLocation; return $this; } @@ -740,7 +740,7 @@ public function setSchedules($schedules) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -752,7 +752,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -764,8 +764,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -781,7 +781,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -808,3 +808,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse200.php b/lib/Model/InlineResponse200.php index 5cfac3d..c9fdc90 100644 --- a/lib/Model/InlineResponse200.php +++ b/lib/Model/InlineResponse200.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse200 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse200 implements ModelInterface, ArrayAccess { @@ -61,9 +62,9 @@ class InlineResponse200 implements ModelInterface, ArrayAccess 'timezone' => '\Swagger\Client\Model\InlineResponse200Timezone', 'authenticated' => 'bool', 'username' => 'string', - 'cloud_version' => 'string', - 'api_version' => 'string', - 'supported_api_versions' => 'string[]' + 'cloudVersion' => 'string', + 'apiVersion' => 'string', + 'supportedApiVersions' => 'string[]' ]; /** @@ -77,9 +78,9 @@ class InlineResponse200 implements ModelInterface, ArrayAccess 'timezone' => null, 'authenticated' => null, 'username' => null, - 'cloud_version' => null, - 'api_version' => null, - 'supported_api_versions' => null + 'cloudVersion' => null, + 'apiVersion' => null, + 'supportedApiVersions' => null ]; /** @@ -114,9 +115,9 @@ public static function swaggerFormats() 'timezone' => 'timezone', 'authenticated' => 'authenticated', 'username' => 'username', - 'cloud_version' => 'cloudVersion', - 'api_version' => 'apiVersion', - 'supported_api_versions' => 'supportedApiVersions' + 'cloudVersion' => 'cloudVersion', + 'apiVersion' => 'apiVersion', + 'supportedApiVersions' => 'supportedApiVersions' ]; /** @@ -130,9 +131,9 @@ public static function swaggerFormats() 'timezone' => 'setTimezone', 'authenticated' => 'setAuthenticated', 'username' => 'setUsername', - 'cloud_version' => 'setCloudVersion', - 'api_version' => 'setApiVersion', - 'supported_api_versions' => 'setSupportedApiVersions' + 'cloudVersion' => 'setCloudVersion', + 'apiVersion' => 'setApiVersion', + 'supportedApiVersions' => 'setSupportedApiVersions' ]; /** @@ -146,9 +147,9 @@ public static function swaggerFormats() 'timezone' => 'getTimezone', 'authenticated' => 'getAuthenticated', 'username' => 'getUsername', - 'cloud_version' => 'getCloudVersion', - 'api_version' => 'getApiVersion', - 'supported_api_versions' => 'getSupportedApiVersions' + 'cloudVersion' => 'getCloudVersion', + 'apiVersion' => 'getApiVersion', + 'supportedApiVersions' => 'getSupportedApiVersions' ]; /** @@ -216,9 +217,9 @@ public function __construct(array $data = null) $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; $this->container['authenticated'] = isset($data['authenticated']) ? $data['authenticated'] : null; $this->container['username'] = isset($data['username']) ? $data['username'] : null; - $this->container['cloud_version'] = isset($data['cloud_version']) ? $data['cloud_version'] : null; - $this->container['api_version'] = isset($data['api_version']) ? $data['api_version'] : null; - $this->container['supported_api_versions'] = isset($data['supported_api_versions']) ? $data['supported_api_versions'] : null; + $this->container['cloudVersion'] = isset($data['cloudVersion']) ? $data['cloudVersion'] : null; + $this->container['apiVersion'] = isset($data['apiVersion']) ? $data['apiVersion'] : null; + $this->container['supportedApiVersions'] = isset($data['supportedApiVersions']) ? $data['supportedApiVersions'] : null; } /** @@ -241,8 +242,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -367,80 +367,80 @@ public function setUsername($username) } /** - * Gets cloud_version + * Gets cloudVersion * * @return string */ public function getCloudVersion() { - return $this->container['cloud_version']; + return $this->container['cloudVersion']; } /** - * Sets cloud_version + * Sets cloudVersion * - * @param string $cloud_version cloud_version + * @param string $cloudVersion cloudVersion * * @return $this */ - public function setCloudVersion($cloud_version) + public function setCloudVersion($cloudVersion) { - $this->container['cloud_version'] = $cloud_version; + $this->container['cloudVersion'] = $cloudVersion; return $this; } /** - * Gets api_version + * Gets apiVersion * * @return string */ public function getApiVersion() { - return $this->container['api_version']; + return $this->container['apiVersion']; } /** - * Sets api_version + * Sets apiVersion * - * @param string $api_version api_version + * @param string $apiVersion apiVersion * * @return $this */ - public function setApiVersion($api_version) + public function setApiVersion($apiVersion) { - $this->container['api_version'] = $api_version; + $this->container['apiVersion'] = $apiVersion; return $this; } /** - * Gets supported_api_versions + * Gets supportedApiVersions * * @return string[] */ public function getSupportedApiVersions() { - return $this->container['supported_api_versions']; + return $this->container['supportedApiVersions']; } /** - * Sets supported_api_versions + * Sets supportedApiVersions * - * @param string[] $supported_api_versions supported_api_versions + * @param string[] $supportedApiVersions supportedApiVersions * * @return $this */ - public function setSupportedApiVersions($supported_api_versions) + public function setSupportedApiVersions($supportedApiVersions) { - $this->container['supported_api_versions'] = $supported_api_versions; + $this->container['supportedApiVersions'] = $supportedApiVersions; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -452,7 +452,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -464,8 +464,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -481,7 +481,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -508,3 +508,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse2001.php b/lib/Model/InlineResponse2001.php index 390e646..7d52158 100644 --- a/lib/Model/InlineResponse2001.php +++ b/lib/Model/InlineResponse2001.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse2001 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse2001 implements ModelInterface, ArrayAccess { @@ -199,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -230,7 +230,7 @@ public function setStatus($status) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -242,7 +242,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -254,8 +254,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -271,7 +271,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -298,3 +298,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse2002.php b/lib/Model/InlineResponse2002.php index 9a51cea..2c82cb7 100644 --- a/lib/Model/InlineResponse2002.php +++ b/lib/Model/InlineResponse2002.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse2002 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse2002 implements ModelInterface, ArrayAccess { @@ -56,11 +57,7 @@ class InlineResponse2002 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'int', - 'email' => 'string', - 'timezone' => 'string', - 'clients_registration_enabled' => '\DateTime', - 'io_devices_registration_enabled' => '\DateTime' + 'id' => 'int' ]; /** @@ -69,11 +66,7 @@ class InlineResponse2002 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, - 'email' => 'email', - 'timezone' => null, - 'clients_registration_enabled' => 'date-time', - 'io_devices_registration_enabled' => 'date-time' + 'id' => null ]; /** @@ -103,11 +96,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'id' => 'id', - 'email' => 'email', - 'timezone' => 'timezone', - 'clients_registration_enabled' => 'clientsRegistrationEnabled', - 'io_devices_registration_enabled' => 'ioDevicesRegistrationEnabled' + 'id' => 'id' ]; /** @@ -116,11 +105,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'id' => 'setId', - 'email' => 'setEmail', - 'timezone' => 'setTimezone', - 'clients_registration_enabled' => 'setClientsRegistrationEnabled', - 'io_devices_registration_enabled' => 'setIoDevicesRegistrationEnabled' + 'id' => 'setId' ]; /** @@ -129,11 +114,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'id' => 'getId', - 'email' => 'getEmail', - 'timezone' => 'getTimezone', - 'clients_registration_enabled' => 'getClientsRegistrationEnabled', - 'io_devices_registration_enabled' => 'getIoDevicesRegistrationEnabled' + 'id' => 'getId' ]; /** @@ -197,10 +178,6 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; - $this->container['clients_registration_enabled'] = isset($data['clients_registration_enabled']) ? $data['clients_registration_enabled'] : null; - $this->container['io_devices_registration_enabled'] = isset($data['io_devices_registration_enabled']) ? $data['io_devices_registration_enabled'] : null; } /** @@ -223,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -251,106 +227,10 @@ public function setId($id) return $this; } - - /** - * Gets email - * - * @return string - */ - public function getEmail() - { - return $this->container['email']; - } - - /** - * Sets email - * - * @param string $email email - * - * @return $this - */ - public function setEmail($email) - { - $this->container['email'] = $email; - - return $this; - } - - /** - * Gets timezone - * - * @return string - */ - public function getTimezone() - { - return $this->container['timezone']; - } - - /** - * Sets timezone - * - * @param string $timezone timezone - * - * @return $this - */ - public function setTimezone($timezone) - { - $this->container['timezone'] = $timezone; - - return $this; - } - - /** - * Gets clients_registration_enabled - * - * @return \DateTime - */ - public function getClientsRegistrationEnabled() - { - return $this->container['clients_registration_enabled']; - } - - /** - * Sets clients_registration_enabled - * - * @param \DateTime $clients_registration_enabled clients_registration_enabled - * - * @return $this - */ - public function setClientsRegistrationEnabled($clients_registration_enabled) - { - $this->container['clients_registration_enabled'] = $clients_registration_enabled; - - return $this; - } - - /** - * Gets io_devices_registration_enabled - * - * @return \DateTime - */ - public function getIoDevicesRegistrationEnabled() - { - return $this->container['io_devices_registration_enabled']; - } - - /** - * Sets io_devices_registration_enabled - * - * @param \DateTime $io_devices_registration_enabled io_devices_registration_enabled - * - * @return $this - */ - public function setIoDevicesRegistrationEnabled($io_devices_registration_enabled) - { - $this->container['io_devices_registration_enabled'] = $io_devices_registration_enabled; - - return $this; - } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -362,7 +242,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -374,8 +254,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -391,7 +271,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -418,3 +298,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse2003.php b/lib/Model/InlineResponse2003.php index 322c2d9..60d9776 100644 --- a/lib/Model/InlineResponse2003.php +++ b/lib/Model/InlineResponse2003.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse2003 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse2003 implements ModelInterface, ArrayAccess { @@ -56,7 +57,9 @@ class InlineResponse2003 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'int' + 'dateTimestamp' => 'int', + 'temperature' => 'float', + 'humidity' => 'float' ]; /** @@ -65,7 +68,9 @@ class InlineResponse2003 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null + 'dateTimestamp' => null, + 'temperature' => 'float', + 'humidity' => 'float' ]; /** @@ -95,7 +100,9 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'id' => 'id' + 'dateTimestamp' => 'date_timestamp', + 'temperature' => 'temperature', + 'humidity' => 'humidity' ]; /** @@ -104,7 +111,9 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'id' => 'setId' + 'dateTimestamp' => 'setDateTimestamp', + 'temperature' => 'setTemperature', + 'humidity' => 'setHumidity' ]; /** @@ -113,7 +122,9 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'id' => 'getId' + 'dateTimestamp' => 'getDateTimestamp', + 'temperature' => 'getTemperature', + 'humidity' => 'getHumidity' ]; /** @@ -176,7 +187,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['dateTimestamp'] = isset($data['dateTimestamp']) ? $data['dateTimestamp'] : null; + $this->container['temperature'] = isset($data['temperature']) ? $data['temperature'] : null; + $this->container['humidity'] = isset($data['humidity']) ? $data['humidity'] : null; } /** @@ -199,38 +212,85 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets id + * Gets dateTimestamp * * @return int */ - public function getId() + public function getDateTimestamp() { - return $this->container['id']; + return $this->container['dateTimestamp']; } /** - * Sets id + * Sets dateTimestamp * - * @param int $id id + * @param int $dateTimestamp dateTimestamp * * @return $this */ - public function setId($id) + public function setDateTimestamp($dateTimestamp) { - $this->container['id'] = $id; + $this->container['dateTimestamp'] = $dateTimestamp; + + return $this; + } + + /** + * Gets temperature + * + * @return float + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float $temperature Temperature in Celsius + * + * @return $this + */ + public function setTemperature($temperature) + { + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets humidity + * + * @return float + */ + public function getHumidity() + { + return $this->container['humidity']; + } + + /** + * Sets humidity + * + * @param float $humidity Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`. + * + * @return $this + */ + public function setHumidity($humidity) + { + $this->container['humidity'] = $humidity; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -242,7 +302,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -254,8 +314,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -271,7 +331,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -298,3 +358,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse200Timezone.php b/lib/Model/InlineResponse200Timezone.php index 6d1594b..e04e6d0 100644 --- a/lib/Model/InlineResponse200Timezone.php +++ b/lib/Model/InlineResponse200Timezone.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse200Timezone Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse200Timezone implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setOffset($offset) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse400.php b/lib/Model/InlineResponse400.php index 13c09c2..1cd1005 100644 --- a/lib/Model/InlineResponse400.php +++ b/lib/Model/InlineResponse400.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse400 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse400 implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setMessage($message) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse4001.php b/lib/Model/InlineResponse4001.php index 80ac022..a492042 100644 --- a/lib/Model/InlineResponse4001.php +++ b/lib/Model/InlineResponse4001.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse4001 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse4001 implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setMessage($message) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse409.php b/lib/Model/InlineResponse409.php index 2317c2c..56a4b90 100644 --- a/lib/Model/InlineResponse409.php +++ b/lib/Model/InlineResponse409.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse409 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse409 implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setGroups($groups) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse503.php b/lib/Model/InlineResponse503.php index 22092b0..682b105 100644 --- a/lib/Model/InlineResponse503.php +++ b/lib/Model/InlineResponse503.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * InlineResponse503 Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class InlineResponse503 implements ModelInterface, ArrayAccess { @@ -199,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -230,7 +230,7 @@ public function setStatus($status) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -242,7 +242,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -254,8 +254,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -271,7 +271,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -298,3 +298,4 @@ public function __toString() } } + diff --git a/lib/Model/Location.php b/lib/Model/Location.php index 7d30635..7065153 100644 --- a/lib/Model/Location.php +++ b/lib/Model/Location.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Location Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Location implements ModelInterface, ArrayAccess { @@ -59,14 +60,14 @@ class Location implements ModelInterface, ArrayAccess 'id' => 'int', 'caption' => 'string', 'enabled' => 'bool', - 'iodevices_ids' => 'int[]', - 'channel_groups_ids' => 'int[]', - 'channels_ids' => 'int[]', - 'access_ids_ids' => 'int[]', + 'iodevicesIds' => 'int[]', + 'channelGroupsIds' => 'int[]', + 'channelsIds' => 'int[]', + 'accessIdsIds' => 'int[]', 'password' => 'string', 'iodevices' => '\Swagger\Client\Model\Device[]', - 'channel_groups' => '\Swagger\Client\Model\ChannelGroup[]', - 'access_ids' => '\Swagger\Client\Model\AccessID[]', + 'channelGroups' => '\Swagger\Client\Model\ChannelGroup[]', + 'accessIds' => '\Swagger\Client\Model\AccessID[]', 'channels' => '\Swagger\Client\Model\Channel[]' ]; @@ -79,14 +80,14 @@ class Location implements ModelInterface, ArrayAccess 'id' => null, 'caption' => null, 'enabled' => null, - 'iodevices_ids' => null, - 'channel_groups_ids' => null, - 'channels_ids' => null, - 'access_ids_ids' => null, + 'iodevicesIds' => null, + 'channelGroupsIds' => null, + 'channelsIds' => null, + 'accessIdsIds' => null, 'password' => null, 'iodevices' => null, - 'channel_groups' => null, - 'access_ids' => null, + 'channelGroups' => null, + 'accessIds' => null, 'channels' => null ]; @@ -120,14 +121,14 @@ public static function swaggerFormats() 'id' => 'id', 'caption' => 'caption', 'enabled' => 'enabled', - 'iodevices_ids' => 'iodevicesIds', - 'channel_groups_ids' => 'channelGroupsIds', - 'channels_ids' => 'channelsIds', - 'access_ids_ids' => 'accessIdsIds', + 'iodevicesIds' => 'iodevicesIds', + 'channelGroupsIds' => 'channelGroupsIds', + 'channelsIds' => 'channelsIds', + 'accessIdsIds' => 'accessIdsIds', 'password' => 'password', 'iodevices' => 'iodevices', - 'channel_groups' => 'channelGroups', - 'access_ids' => 'accessIds', + 'channelGroups' => 'channelGroups', + 'accessIds' => 'accessIds', 'channels' => 'channels' ]; @@ -140,14 +141,14 @@ public static function swaggerFormats() 'id' => 'setId', 'caption' => 'setCaption', 'enabled' => 'setEnabled', - 'iodevices_ids' => 'setIodevicesIds', - 'channel_groups_ids' => 'setChannelGroupsIds', - 'channels_ids' => 'setChannelsIds', - 'access_ids_ids' => 'setAccessIdsIds', + 'iodevicesIds' => 'setIodevicesIds', + 'channelGroupsIds' => 'setChannelGroupsIds', + 'channelsIds' => 'setChannelsIds', + 'accessIdsIds' => 'setAccessIdsIds', 'password' => 'setPassword', 'iodevices' => 'setIodevices', - 'channel_groups' => 'setChannelGroups', - 'access_ids' => 'setAccessIds', + 'channelGroups' => 'setChannelGroups', + 'accessIds' => 'setAccessIds', 'channels' => 'setChannels' ]; @@ -160,14 +161,14 @@ public static function swaggerFormats() 'id' => 'getId', 'caption' => 'getCaption', 'enabled' => 'getEnabled', - 'iodevices_ids' => 'getIodevicesIds', - 'channel_groups_ids' => 'getChannelGroupsIds', - 'channels_ids' => 'getChannelsIds', - 'access_ids_ids' => 'getAccessIdsIds', + 'iodevicesIds' => 'getIodevicesIds', + 'channelGroupsIds' => 'getChannelGroupsIds', + 'channelsIds' => 'getChannelsIds', + 'accessIdsIds' => 'getAccessIdsIds', 'password' => 'getPassword', 'iodevices' => 'getIodevices', - 'channel_groups' => 'getChannelGroups', - 'access_ids' => 'getAccessIds', + 'channelGroups' => 'getChannelGroups', + 'accessIds' => 'getAccessIds', 'channels' => 'getChannels' ]; @@ -234,14 +235,14 @@ public function __construct(array $data = null) $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['iodevices_ids'] = isset($data['iodevices_ids']) ? $data['iodevices_ids'] : null; - $this->container['channel_groups_ids'] = isset($data['channel_groups_ids']) ? $data['channel_groups_ids'] : null; - $this->container['channels_ids'] = isset($data['channels_ids']) ? $data['channels_ids'] : null; - $this->container['access_ids_ids'] = isset($data['access_ids_ids']) ? $data['access_ids_ids'] : null; + $this->container['iodevicesIds'] = isset($data['iodevicesIds']) ? $data['iodevicesIds'] : null; + $this->container['channelGroupsIds'] = isset($data['channelGroupsIds']) ? $data['channelGroupsIds'] : null; + $this->container['channelsIds'] = isset($data['channelsIds']) ? $data['channelsIds'] : null; + $this->container['accessIdsIds'] = isset($data['accessIdsIds']) ? $data['accessIdsIds'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; $this->container['iodevices'] = isset($data['iodevices']) ? $data['iodevices'] : null; - $this->container['channel_groups'] = isset($data['channel_groups']) ? $data['channel_groups'] : null; - $this->container['access_ids'] = isset($data['access_ids']) ? $data['access_ids'] : null; + $this->container['channelGroups'] = isset($data['channelGroups']) ? $data['channelGroups'] : null; + $this->container['accessIds'] = isset($data['accessIds']) ? $data['accessIds'] : null; $this->container['channels'] = isset($data['channels']) ? $data['channels'] : null; } @@ -265,8 +266,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -343,97 +343,97 @@ public function setEnabled($enabled) } /** - * Gets iodevices_ids + * Gets iodevicesIds * * @return int[] */ public function getIodevicesIds() { - return $this->container['iodevices_ids']; + return $this->container['iodevicesIds']; } /** - * Sets iodevices_ids + * Sets iodevicesIds * - * @param int[] $iodevices_ids array containing the IO Devices identifiers assigned to this location + * @param int[] $iodevicesIds array containing the IO Devices identifiers assigned to this location * * @return $this */ - public function setIodevicesIds($iodevices_ids) + public function setIodevicesIds($iodevicesIds) { - $this->container['iodevices_ids'] = $iodevices_ids; + $this->container['iodevicesIds'] = $iodevicesIds; return $this; } /** - * Gets channel_groups_ids + * Gets channelGroupsIds * * @return int[] */ public function getChannelGroupsIds() { - return $this->container['channel_groups_ids']; + return $this->container['channelGroupsIds']; } /** - * Sets channel_groups_ids + * Sets channelGroupsIds * - * @param int[] $channel_groups_ids array containing the Channel groups identifiers assigned to this location + * @param int[] $channelGroupsIds array containing the Channel groups identifiers assigned to this location * * @return $this */ - public function setChannelGroupsIds($channel_groups_ids) + public function setChannelGroupsIds($channelGroupsIds) { - $this->container['channel_groups_ids'] = $channel_groups_ids; + $this->container['channelGroupsIds'] = $channelGroupsIds; return $this; } /** - * Gets channels_ids + * Gets channelsIds * * @return int[] */ public function getChannelsIds() { - return $this->container['channels_ids']; + return $this->container['channelsIds']; } /** - * Sets channels_ids + * Sets channelsIds * - * @param int[] $channels_ids array containing the Channels identifiers expicitely assigned to this location + * @param int[] $channelsIds array containing the Channels identifiers expicitely assigned to this location * * @return $this */ - public function setChannelsIds($channels_ids) + public function setChannelsIds($channelsIds) { - $this->container['channels_ids'] = $channels_ids; + $this->container['channelsIds'] = $channelsIds; return $this; } /** - * Gets access_ids_ids + * Gets accessIdsIds * * @return int[] */ public function getAccessIdsIds() { - return $this->container['access_ids_ids']; + return $this->container['accessIdsIds']; } /** - * Sets access_ids_ids + * Sets accessIdsIds * - * @param int[] $access_ids_ids array containing the Access Identifiers identifiers assigned to this location + * @param int[] $accessIdsIds array containing the Access Identifiers identifiers assigned to this location * * @return $this */ - public function setAccessIdsIds($access_ids_ids) + public function setAccessIdsIds($accessIdsIds) { - $this->container['access_ids_ids'] = $access_ids_ids; + $this->container['accessIdsIds'] = $accessIdsIds; return $this; } @@ -487,49 +487,49 @@ public function setIodevices($iodevices) } /** - * Gets channel_groups + * Gets channelGroups * * @return \Swagger\Client\Model\ChannelGroup[] */ public function getChannelGroups() { - return $this->container['channel_groups']; + return $this->container['channelGroups']; } /** - * Sets channel_groups + * Sets channelGroups * - * @param \Swagger\Client\Model\ChannelGroup[] $channel_groups Returned only if requested by the `include` parameter. + * @param \Swagger\Client\Model\ChannelGroup[] $channelGroups Returned only if requested by the `include` parameter. * * @return $this */ - public function setChannelGroups($channel_groups) + public function setChannelGroups($channelGroups) { - $this->container['channel_groups'] = $channel_groups; + $this->container['channelGroups'] = $channelGroups; return $this; } /** - * Gets access_ids + * Gets accessIds * * @return \Swagger\Client\Model\AccessID[] */ public function getAccessIds() { - return $this->container['access_ids']; + return $this->container['accessIds']; } /** - * Sets access_ids + * Sets accessIds * - * @param \Swagger\Client\Model\AccessID[] $access_ids Returned only if requested by the `include` parameter. + * @param \Swagger\Client\Model\AccessID[] $accessIds Returned only if requested by the `include` parameter. * * @return $this */ - public function setAccessIds($access_ids) + public function setAccessIds($accessIds) { - $this->container['access_ids'] = $access_ids; + $this->container['accessIds'] = $accessIds; return $this; } @@ -560,7 +560,7 @@ public function setChannels($channels) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -572,7 +572,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -584,8 +584,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -601,7 +601,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -628,3 +628,4 @@ public function __toString() } } + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 1411e27..5d4641b 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** diff --git a/lib/Model/Schedule.php b/lib/Model/Schedule.php index be68280..7449a7b 100644 --- a/lib/Model/Schedule.php +++ b/lib/Model/Schedule.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * Schedule Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Schedule implements ModelInterface, ArrayAccess { @@ -57,18 +58,18 @@ class Schedule implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'time_expression' => 'string', + 'timeExpression' => 'string', 'action' => '\Swagger\Client\Model\ChannelFunctionAction', 'mode' => 'string', - 'date_start' => '\DateTime', - 'date_end' => '\DateTime', + 'dateStart' => '\DateTime', + 'dateEnd' => '\DateTime', 'enabled' => 'bool', 'caption' => 'string', 'retry' => 'bool', - 'channel_id' => 'int', - 'action_id' => 'int', + 'channelId' => 'int', + 'actionId' => 'int', 'channel' => '\Swagger\Client\Model\Channel', - 'closest_executions' => '\Swagger\Client\Model\ScheduleClosestExecutions[]' + 'closestExecutions' => '\Swagger\Client\Model\ScheduleClosestExecutions[]' ]; /** @@ -78,18 +79,18 @@ class Schedule implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'time_expression' => null, + 'timeExpression' => null, 'action' => null, 'mode' => null, - 'date_start' => 'date-time', - 'date_end' => 'date-time', + 'dateStart' => 'date-time', + 'dateEnd' => 'date-time', 'enabled' => null, 'caption' => null, 'retry' => null, - 'channel_id' => null, - 'action_id' => null, + 'channelId' => null, + 'actionId' => null, 'channel' => null, - 'closest_executions' => null + 'closestExecutions' => null ]; /** @@ -120,18 +121,18 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'time_expression' => 'timeExpression', + 'timeExpression' => 'timeExpression', 'action' => 'action', 'mode' => 'mode', - 'date_start' => 'dateStart', - 'date_end' => 'dateEnd', + 'dateStart' => 'dateStart', + 'dateEnd' => 'dateEnd', 'enabled' => 'enabled', 'caption' => 'caption', 'retry' => 'retry', - 'channel_id' => 'channelId', - 'action_id' => 'actionId', + 'channelId' => 'channelId', + 'actionId' => 'actionId', 'channel' => 'channel', - 'closest_executions' => 'closestExecutions' + 'closestExecutions' => 'closestExecutions' ]; /** @@ -141,18 +142,18 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'time_expression' => 'setTimeExpression', + 'timeExpression' => 'setTimeExpression', 'action' => 'setAction', 'mode' => 'setMode', - 'date_start' => 'setDateStart', - 'date_end' => 'setDateEnd', + 'dateStart' => 'setDateStart', + 'dateEnd' => 'setDateEnd', 'enabled' => 'setEnabled', 'caption' => 'setCaption', 'retry' => 'setRetry', - 'channel_id' => 'setChannelId', - 'action_id' => 'setActionId', + 'channelId' => 'setChannelId', + 'actionId' => 'setActionId', 'channel' => 'setChannel', - 'closest_executions' => 'setClosestExecutions' + 'closestExecutions' => 'setClosestExecutions' ]; /** @@ -162,18 +163,18 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'time_expression' => 'getTimeExpression', + 'timeExpression' => 'getTimeExpression', 'action' => 'getAction', 'mode' => 'getMode', - 'date_start' => 'getDateStart', - 'date_end' => 'getDateEnd', + 'dateStart' => 'getDateStart', + 'dateEnd' => 'getDateEnd', 'enabled' => 'getEnabled', 'caption' => 'getCaption', 'retry' => 'getRetry', - 'channel_id' => 'getChannelId', - 'action_id' => 'getActionId', + 'channelId' => 'getChannelId', + 'actionId' => 'getActionId', 'channel' => 'getChannel', - 'closest_executions' => 'getClosestExecutions' + 'closestExecutions' => 'getClosestExecutions' ]; /** @@ -256,18 +257,18 @@ public function getModeAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['time_expression'] = isset($data['time_expression']) ? $data['time_expression'] : null; + $this->container['timeExpression'] = isset($data['timeExpression']) ? $data['timeExpression'] : null; $this->container['action'] = isset($data['action']) ? $data['action'] : null; $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; - $this->container['date_start'] = isset($data['date_start']) ? $data['date_start'] : null; - $this->container['date_end'] = isset($data['date_end']) ? $data['date_end'] : null; + $this->container['dateStart'] = isset($data['dateStart']) ? $data['dateStart'] : null; + $this->container['dateEnd'] = isset($data['dateEnd']) ? $data['dateEnd'] : null; $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['retry'] = isset($data['retry']) ? $data['retry'] : null; - $this->container['channel_id'] = isset($data['channel_id']) ? $data['channel_id'] : null; - $this->container['action_id'] = isset($data['action_id']) ? $data['action_id'] : null; + $this->container['channelId'] = isset($data['channelId']) ? $data['channelId'] : null; + $this->container['actionId'] = isset($data['actionId']) ? $data['actionId'] : null; $this->container['channel'] = isset($data['channel']) ? $data['channel'] : null; - $this->container['closest_executions'] = isset($data['closest_executions']) ? $data['closest_executions'] : null; + $this->container['closestExecutions'] = isset($data['closestExecutions']) ? $data['closestExecutions'] : null; } /** @@ -280,7 +281,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getModeAllowableValues(); - if (!in_array($this->container['mode'], $allowedValues)) { + if (!is_null($this->container['mode']) && !in_array($this->container['mode'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'mode', must be one of '%s'", implode("', '", $allowedValues) @@ -298,12 +299,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getModeAllowableValues(); - if (!in_array($this->container['mode'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -332,25 +328,25 @@ public function setId($id) } /** - * Gets time_expression + * Gets timeExpression * * @return string */ public function getTimeExpression() { - return $this->container['time_expression']; + return $this->container['timeExpression']; } /** - * Sets time_expression + * Sets timeExpression * - * @param string $time_expression Schedule time expression in crontab notation (with some custom additions). + * @param string $timeExpression Schedule time expression in crontab notation (with some custom additions). * * @return $this */ - public function setTimeExpression($time_expression) + public function setTimeExpression($timeExpression) { - $this->container['time_expression'] = $time_expression; + $this->container['timeExpression'] = $timeExpression; return $this; } @@ -399,7 +395,7 @@ public function getMode() public function setMode($mode) { $allowedValues = $this->getModeAllowableValues(); - if (!is_null($mode) && !in_array($mode, $allowedValues)) { + if (!is_null($mode) && !in_array($mode, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'mode', must be one of '%s'", @@ -413,49 +409,49 @@ public function setMode($mode) } /** - * Gets date_start + * Gets dateStart * * @return \DateTime */ public function getDateStart() { - return $this->container['date_start']; + return $this->container['dateStart']; } /** - * Sets date_start + * Sets dateStart * - * @param \DateTime $date_start date_start + * @param \DateTime $dateStart dateStart * * @return $this */ - public function setDateStart($date_start) + public function setDateStart($dateStart) { - $this->container['date_start'] = $date_start; + $this->container['dateStart'] = $dateStart; return $this; } /** - * Gets date_end + * Gets dateEnd * * @return \DateTime */ public function getDateEnd() { - return $this->container['date_end']; + return $this->container['dateEnd']; } /** - * Sets date_end + * Sets dateEnd * - * @param \DateTime $date_end date_end + * @param \DateTime $dateEnd dateEnd * * @return $this */ - public function setDateEnd($date_end) + public function setDateEnd($dateEnd) { - $this->container['date_end'] = $date_end; + $this->container['dateEnd'] = $dateEnd; return $this; } @@ -533,49 +529,49 @@ public function setRetry($retry) } /** - * Gets channel_id + * Gets channelId * * @return int */ public function getChannelId() { - return $this->container['channel_id']; + return $this->container['channelId']; } /** - * Sets channel_id + * Sets channelId * - * @param int $channel_id channel_id + * @param int $channelId channelId * * @return $this */ - public function setChannelId($channel_id) + public function setChannelId($channelId) { - $this->container['channel_id'] = $channel_id; + $this->container['channelId'] = $channelId; return $this; } /** - * Gets action_id + * Gets actionId * * @return int */ public function getActionId() { - return $this->container['action_id']; + return $this->container['actionId']; } /** - * Sets action_id + * Sets actionId * - * @param int $action_id action_id + * @param int $actionId actionId * * @return $this */ - public function setActionId($action_id) + public function setActionId($actionId) { - $this->container['action_id'] = $action_id; + $this->container['actionId'] = $actionId; return $this; } @@ -605,32 +601,32 @@ public function setChannel($channel) } /** - * Gets closest_executions + * Gets closestExecutions * * @return \Swagger\Client\Model\ScheduleClosestExecutions[] */ public function getClosestExecutions() { - return $this->container['closest_executions']; + return $this->container['closestExecutions']; } /** - * Sets closest_executions + * Sets closestExecutions * - * @param \Swagger\Client\Model\ScheduleClosestExecutions[] $closest_executions Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions. + * @param \Swagger\Client\Model\ScheduleClosestExecutions[] $closestExecutions Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions. * * @return $this */ - public function setClosestExecutions($closest_executions) + public function setClosestExecutions($closestExecutions) { - $this->container['closest_executions'] = $closest_executions; + $this->container['closestExecutions'] = $closestExecutions; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -642,7 +638,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -654,8 +650,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -671,7 +667,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -698,3 +694,4 @@ public function __toString() } } + diff --git a/lib/Model/ScheduleClosestExecutions.php b/lib/Model/ScheduleClosestExecutions.php index 05563f1..d30cba5 100644 --- a/lib/Model/ScheduleClosestExecutions.php +++ b/lib/Model/ScheduleClosestExecutions.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ScheduleClosestExecutions Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ScheduleClosestExecutions implements ModelInterface, ArrayAccess { @@ -205,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +260,7 @@ public function setFuture($future) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -272,7 +272,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -284,8 +284,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,7 +301,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -328,3 +328,4 @@ public function __toString() } } + diff --git a/lib/Model/ScheduleFuture.php b/lib/Model/ScheduleFuture.php index 172cb49..63f1e3a 100644 --- a/lib/Model/ScheduleFuture.php +++ b/lib/Model/ScheduleFuture.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ScheduleFuture Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ScheduleFuture implements ModelInterface, ArrayAccess { @@ -56,7 +57,7 @@ class ScheduleFuture implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'planned_timestamp' => '\DateTime' + 'plannedTimestamp' => '\DateTime' ]; /** @@ -65,7 +66,7 @@ class ScheduleFuture implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'planned_timestamp' => 'date-time' + 'plannedTimestamp' => 'date-time' ]; /** @@ -95,7 +96,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'planned_timestamp' => 'plannedTimestamp' + 'plannedTimestamp' => 'plannedTimestamp' ]; /** @@ -104,7 +105,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'planned_timestamp' => 'setPlannedTimestamp' + 'plannedTimestamp' => 'setPlannedTimestamp' ]; /** @@ -113,7 +114,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'planned_timestamp' => 'getPlannedTimestamp' + 'plannedTimestamp' => 'getPlannedTimestamp' ]; /** @@ -176,7 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['planned_timestamp'] = isset($data['planned_timestamp']) ? $data['planned_timestamp'] : null; + $this->container['plannedTimestamp'] = isset($data['plannedTimestamp']) ? $data['plannedTimestamp'] : null; } /** @@ -199,38 +200,37 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets planned_timestamp + * Gets plannedTimestamp * * @return \DateTime */ public function getPlannedTimestamp() { - return $this->container['planned_timestamp']; + return $this->container['plannedTimestamp']; } /** - * Sets planned_timestamp + * Sets plannedTimestamp * - * @param \DateTime $planned_timestamp planned_timestamp + * @param \DateTime $plannedTimestamp plannedTimestamp * * @return $this */ - public function setPlannedTimestamp($planned_timestamp) + public function setPlannedTimestamp($plannedTimestamp) { - $this->container['planned_timestamp'] = $planned_timestamp; + $this->container['plannedTimestamp'] = $plannedTimestamp; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -242,7 +242,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -254,8 +254,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -271,7 +271,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -298,3 +298,4 @@ public function __toString() } } + diff --git a/lib/Model/SchedulePast.php b/lib/Model/SchedulePast.php index e11afe7..990a31a 100644 --- a/lib/Model/SchedulePast.php +++ b/lib/Model/SchedulePast.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * SchedulePast Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class SchedulePast implements ModelInterface, ArrayAccess { @@ -56,8 +57,8 @@ class SchedulePast implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'planned_timestamp' => '\DateTime', - 'result_timestamp' => '\DateTime', + 'plannedTimestamp' => '\DateTime', + 'resultTimestamp' => '\DateTime', 'failed' => 'bool', 'result' => '\Swagger\Client\Model\ScheduleResult' ]; @@ -68,8 +69,8 @@ class SchedulePast implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'planned_timestamp' => 'date-time', - 'result_timestamp' => 'date-time', + 'plannedTimestamp' => 'date-time', + 'resultTimestamp' => 'date-time', 'failed' => null, 'result' => null ]; @@ -101,8 +102,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'planned_timestamp' => 'plannedTimestamp', - 'result_timestamp' => 'resultTimestamp', + 'plannedTimestamp' => 'plannedTimestamp', + 'resultTimestamp' => 'resultTimestamp', 'failed' => 'failed', 'result' => 'result' ]; @@ -113,8 +114,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'planned_timestamp' => 'setPlannedTimestamp', - 'result_timestamp' => 'setResultTimestamp', + 'plannedTimestamp' => 'setPlannedTimestamp', + 'resultTimestamp' => 'setResultTimestamp', 'failed' => 'setFailed', 'result' => 'setResult' ]; @@ -125,8 +126,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'planned_timestamp' => 'getPlannedTimestamp', - 'result_timestamp' => 'getResultTimestamp', + 'plannedTimestamp' => 'getPlannedTimestamp', + 'resultTimestamp' => 'getResultTimestamp', 'failed' => 'getFailed', 'result' => 'getResult' ]; @@ -191,8 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['planned_timestamp'] = isset($data['planned_timestamp']) ? $data['planned_timestamp'] : null; - $this->container['result_timestamp'] = isset($data['result_timestamp']) ? $data['result_timestamp'] : null; + $this->container['plannedTimestamp'] = isset($data['plannedTimestamp']) ? $data['plannedTimestamp'] : null; + $this->container['resultTimestamp'] = isset($data['resultTimestamp']) ? $data['resultTimestamp'] : null; $this->container['failed'] = isset($data['failed']) ? $data['failed'] : null; $this->container['result'] = isset($data['result']) ? $data['result'] : null; } @@ -217,55 +218,54 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets planned_timestamp + * Gets plannedTimestamp * * @return \DateTime */ public function getPlannedTimestamp() { - return $this->container['planned_timestamp']; + return $this->container['plannedTimestamp']; } /** - * Sets planned_timestamp + * Sets plannedTimestamp * - * @param \DateTime $planned_timestamp planned_timestamp + * @param \DateTime $plannedTimestamp plannedTimestamp * * @return $this */ - public function setPlannedTimestamp($planned_timestamp) + public function setPlannedTimestamp($plannedTimestamp) { - $this->container['planned_timestamp'] = $planned_timestamp; + $this->container['plannedTimestamp'] = $plannedTimestamp; return $this; } /** - * Gets result_timestamp + * Gets resultTimestamp * * @return \DateTime */ public function getResultTimestamp() { - return $this->container['result_timestamp']; + return $this->container['resultTimestamp']; } /** - * Sets result_timestamp + * Sets resultTimestamp * - * @param \DateTime $result_timestamp result_timestamp + * @param \DateTime $resultTimestamp resultTimestamp * * @return $this */ - public function setResultTimestamp($result_timestamp) + public function setResultTimestamp($resultTimestamp) { - $this->container['result_timestamp'] = $result_timestamp; + $this->container['resultTimestamp'] = $resultTimestamp; return $this; } @@ -320,7 +320,7 @@ public function setResult($result) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -332,7 +332,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -344,8 +344,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -361,7 +361,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -388,3 +388,4 @@ public function __toString() } } + diff --git a/lib/Model/ScheduleRequest.php b/lib/Model/ScheduleRequest.php index 1d24e93..6f66254 100644 --- a/lib/Model/ScheduleRequest.php +++ b/lib/Model/ScheduleRequest.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ScheduleRequest Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ScheduleRequest implements ModelInterface, ArrayAccess { @@ -56,12 +57,12 @@ class ScheduleRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'channel_id' => 'int', - 'action_id' => 'int', + 'channelId' => 'int', + 'actionId' => 'int', 'mode' => 'string', - 'time_expression' => 'string', - 'date_start' => '\DateTime', - 'date_end' => '\DateTime', + 'timeExpression' => 'string', + 'dateStart' => '\DateTime', + 'dateEnd' => '\DateTime', 'caption' => 'string', 'retry' => 'bool' ]; @@ -72,12 +73,12 @@ class ScheduleRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'channel_id' => null, - 'action_id' => null, + 'channelId' => null, + 'actionId' => null, 'mode' => null, - 'time_expression' => null, - 'date_start' => 'date-time', - 'date_end' => 'date-time', + 'timeExpression' => null, + 'dateStart' => 'date-time', + 'dateEnd' => 'date-time', 'caption' => null, 'retry' => null ]; @@ -109,12 +110,12 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'channel_id' => 'channelId', - 'action_id' => 'actionId', + 'channelId' => 'channelId', + 'actionId' => 'actionId', 'mode' => 'mode', - 'time_expression' => 'timeExpression', - 'date_start' => 'dateStart', - 'date_end' => 'dateEnd', + 'timeExpression' => 'timeExpression', + 'dateStart' => 'dateStart', + 'dateEnd' => 'dateEnd', 'caption' => 'caption', 'retry' => 'retry' ]; @@ -125,12 +126,12 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'channel_id' => 'setChannelId', - 'action_id' => 'setActionId', + 'channelId' => 'setChannelId', + 'actionId' => 'setActionId', 'mode' => 'setMode', - 'time_expression' => 'setTimeExpression', - 'date_start' => 'setDateStart', - 'date_end' => 'setDateEnd', + 'timeExpression' => 'setTimeExpression', + 'dateStart' => 'setDateStart', + 'dateEnd' => 'setDateEnd', 'caption' => 'setCaption', 'retry' => 'setRetry' ]; @@ -141,12 +142,12 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'channel_id' => 'getChannelId', - 'action_id' => 'getActionId', + 'channelId' => 'getChannelId', + 'actionId' => 'getActionId', 'mode' => 'getMode', - 'time_expression' => 'getTimeExpression', - 'date_start' => 'getDateStart', - 'date_end' => 'getDateEnd', + 'timeExpression' => 'getTimeExpression', + 'dateStart' => 'getDateStart', + 'dateEnd' => 'getDateEnd', 'caption' => 'getCaption', 'retry' => 'getRetry' ]; @@ -230,12 +231,12 @@ public function getModeAllowableValues() */ public function __construct(array $data = null) { - $this->container['channel_id'] = isset($data['channel_id']) ? $data['channel_id'] : null; - $this->container['action_id'] = isset($data['action_id']) ? $data['action_id'] : null; + $this->container['channelId'] = isset($data['channelId']) ? $data['channelId'] : null; + $this->container['actionId'] = isset($data['actionId']) ? $data['actionId'] : null; $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; - $this->container['time_expression'] = isset($data['time_expression']) ? $data['time_expression'] : null; - $this->container['date_start'] = isset($data['date_start']) ? $data['date_start'] : null; - $this->container['date_end'] = isset($data['date_end']) ? $data['date_end'] : null; + $this->container['timeExpression'] = isset($data['timeExpression']) ? $data['timeExpression'] : null; + $this->container['dateStart'] = isset($data['dateStart']) ? $data['dateStart'] : null; + $this->container['dateEnd'] = isset($data['dateEnd']) ? $data['dateEnd'] : null; $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; $this->container['retry'] = isset($data['retry']) ? $data['retry'] : null; } @@ -250,7 +251,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getModeAllowableValues(); - if (!in_array($this->container['mode'], $allowedValues)) { + if (!is_null($this->container['mode']) && !in_array($this->container['mode'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'mode', must be one of '%s'", implode("', '", $allowedValues) @@ -268,59 +269,54 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getModeAllowableValues(); - if (!in_array($this->container['mode'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets channel_id + * Gets channelId * * @return int */ public function getChannelId() { - return $this->container['channel_id']; + return $this->container['channelId']; } /** - * Sets channel_id + * Sets channelId * - * @param int $channel_id channel_id + * @param int $channelId channelId * * @return $this */ - public function setChannelId($channel_id) + public function setChannelId($channelId) { - $this->container['channel_id'] = $channel_id; + $this->container['channelId'] = $channelId; return $this; } /** - * Gets action_id + * Gets actionId * * @return int */ public function getActionId() { - return $this->container['action_id']; + return $this->container['actionId']; } /** - * Sets action_id + * Sets actionId * - * @param int $action_id action_id + * @param int $actionId actionId * * @return $this */ - public function setActionId($action_id) + public function setActionId($actionId) { - $this->container['action_id'] = $action_id; + $this->container['actionId'] = $actionId; return $this; } @@ -345,7 +341,7 @@ public function getMode() public function setMode($mode) { $allowedValues = $this->getModeAllowableValues(); - if (!is_null($mode) && !in_array($mode, $allowedValues)) { + if (!is_null($mode) && !in_array($mode, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'mode', must be one of '%s'", @@ -359,73 +355,73 @@ public function setMode($mode) } /** - * Gets time_expression + * Gets timeExpression * * @return string */ public function getTimeExpression() { - return $this->container['time_expression']; + return $this->container['timeExpression']; } /** - * Sets time_expression + * Sets timeExpression * - * @param string $time_expression Schedule time expression in crontab notation (with some custom additions). + * @param string $timeExpression Schedule time expression in crontab notation (with some custom additions). * * @return $this */ - public function setTimeExpression($time_expression) + public function setTimeExpression($timeExpression) { - $this->container['time_expression'] = $time_expression; + $this->container['timeExpression'] = $timeExpression; return $this; } /** - * Gets date_start + * Gets dateStart * * @return \DateTime */ public function getDateStart() { - return $this->container['date_start']; + return $this->container['dateStart']; } /** - * Sets date_start + * Sets dateStart * - * @param \DateTime $date_start date_start + * @param \DateTime $dateStart dateStart * * @return $this */ - public function setDateStart($date_start) + public function setDateStart($dateStart) { - $this->container['date_start'] = $date_start; + $this->container['dateStart'] = $dateStart; return $this; } /** - * Gets date_end + * Gets dateEnd * * @return \DateTime */ public function getDateEnd() { - return $this->container['date_end']; + return $this->container['dateEnd']; } /** - * Sets date_end + * Sets dateEnd * - * @param \DateTime $date_end date_end + * @param \DateTime $dateEnd dateEnd * * @return $this */ - public function setDateEnd($date_end) + public function setDateEnd($dateEnd) { - $this->container['date_end'] = $date_end; + $this->container['dateEnd'] = $dateEnd; return $this; } @@ -480,7 +476,7 @@ public function setRetry($retry) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -492,7 +488,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -504,8 +500,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -521,7 +517,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -548,3 +544,4 @@ public function __toString() } } + diff --git a/lib/Model/ScheduleResult.php b/lib/Model/ScheduleResult.php index 41129d9..337f7af 100644 --- a/lib/Model/ScheduleResult.php +++ b/lib/Model/ScheduleResult.php @@ -18,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -35,9 +36,9 @@ * ScheduleResult Class Doc Comment * * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ScheduleResult implements ModelInterface, ArrayAccess { @@ -199,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -230,7 +230,7 @@ public function setCaption($caption) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -242,7 +242,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -254,8 +254,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -271,7 +271,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -298,3 +298,4 @@ public function __toString() } } + diff --git a/lib/Model/InlineResponse2004.php b/lib/Model/UserRequest.php similarity index 57% rename from lib/Model/InlineResponse2004.php rename to lib/Model/UserRequest.php index 7d8df81..ffbb4c7 100644 --- a/lib/Model/InlineResponse2004.php +++ b/lib/Model/UserRequest.php @@ -1,6 +1,6 @@ 'int', - 'temperature' => 'float', - 'humidity' => 'float' + 'id' => 'int', + 'email' => 'string', + 'timezone' => 'string', + 'clientsRegistrationEnabled' => '\DateTime', + 'ioDevicesRegistrationEnabled' => '\DateTime' ]; /** @@ -67,9 +70,11 @@ class InlineResponse2004 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'date_timestamp' => null, - 'temperature' => 'float', - 'humidity' => 'float' + 'id' => null, + 'email' => 'email', + 'timezone' => null, + 'clientsRegistrationEnabled' => 'date-time', + 'ioDevicesRegistrationEnabled' => 'date-time' ]; /** @@ -99,9 +104,11 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'date_timestamp' => 'date_timestamp', - 'temperature' => 'temperature', - 'humidity' => 'humidity' + 'id' => 'id', + 'email' => 'email', + 'timezone' => 'timezone', + 'clientsRegistrationEnabled' => 'clientsRegistrationEnabled', + 'ioDevicesRegistrationEnabled' => 'ioDevicesRegistrationEnabled' ]; /** @@ -110,9 +117,11 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'date_timestamp' => 'setDateTimestamp', - 'temperature' => 'setTemperature', - 'humidity' => 'setHumidity' + 'id' => 'setId', + 'email' => 'setEmail', + 'timezone' => 'setTimezone', + 'clientsRegistrationEnabled' => 'setClientsRegistrationEnabled', + 'ioDevicesRegistrationEnabled' => 'setIoDevicesRegistrationEnabled' ]; /** @@ -121,9 +130,11 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'date_timestamp' => 'getDateTimestamp', - 'temperature' => 'getTemperature', - 'humidity' => 'getHumidity' + 'id' => 'getId', + 'email' => 'getEmail', + 'timezone' => 'getTimezone', + 'clientsRegistrationEnabled' => 'getClientsRegistrationEnabled', + 'ioDevicesRegistrationEnabled' => 'getIoDevicesRegistrationEnabled' ]; /** @@ -186,9 +197,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date_timestamp'] = isset($data['date_timestamp']) ? $data['date_timestamp'] : null; - $this->container['temperature'] = isset($data['temperature']) ? $data['temperature'] : null; - $this->container['humidity'] = isset($data['humidity']) ? $data['humidity'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; + $this->container['clientsRegistrationEnabled'] = isset($data['clientsRegistrationEnabled']) ? $data['clientsRegistrationEnabled'] : null; + $this->container['ioDevicesRegistrationEnabled'] = isset($data['ioDevicesRegistrationEnabled']) ? $data['ioDevicesRegistrationEnabled'] : null; } /** @@ -211,86 +224,133 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets date_timestamp + * Gets id * * @return int */ - public function getDateTimestamp() + public function getId() { - return $this->container['date_timestamp']; + return $this->container['id']; } /** - * Sets date_timestamp + * Sets id * - * @param int $date_timestamp date_timestamp + * @param int $id id * * @return $this */ - public function setDateTimestamp($date_timestamp) + public function setId($id) { - $this->container['date_timestamp'] = $date_timestamp; + $this->container['id'] = $id; return $this; } /** - * Gets temperature + * Gets email * - * @return float + * @return string */ - public function getTemperature() + public function getEmail() { - return $this->container['temperature']; + return $this->container['email']; } /** - * Sets temperature + * Sets email * - * @param float $temperature Temperature in Celsius + * @param string $email email * * @return $this */ - public function setTemperature($temperature) + public function setEmail($email) { - $this->container['temperature'] = $temperature; + $this->container['email'] = $email; return $this; } /** - * Gets humidity + * Gets timezone * - * @return float + * @return string */ - public function getHumidity() + public function getTimezone() { - return $this->container['humidity']; + return $this->container['timezone']; } /** - * Sets humidity + * Sets timezone * - * @param float $humidity Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`. + * @param string $timezone timezone * * @return $this */ - public function setHumidity($humidity) + public function setTimezone($timezone) { - $this->container['humidity'] = $humidity; + $this->container['timezone'] = $timezone; + + return $this; + } + + /** + * Gets clientsRegistrationEnabled + * + * @return \DateTime + */ + public function getClientsRegistrationEnabled() + { + return $this->container['clientsRegistrationEnabled']; + } + + /** + * Sets clientsRegistrationEnabled + * + * @param \DateTime $clientsRegistrationEnabled clientsRegistrationEnabled + * + * @return $this + */ + public function setClientsRegistrationEnabled($clientsRegistrationEnabled) + { + $this->container['clientsRegistrationEnabled'] = $clientsRegistrationEnabled; + + return $this; + } + + /** + * Gets ioDevicesRegistrationEnabled + * + * @return \DateTime + */ + public function getIoDevicesRegistrationEnabled() + { + return $this->container['ioDevicesRegistrationEnabled']; + } + + /** + * Sets ioDevicesRegistrationEnabled + * + * @param \DateTime $ioDevicesRegistrationEnabled ioDevicesRegistrationEnabled + * + * @return $this + */ + public function setIoDevicesRegistrationEnabled($ioDevicesRegistrationEnabled) + { + $this->container['ioDevicesRegistrationEnabled'] = $ioDevicesRegistrationEnabled; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return boolean */ @@ -302,7 +362,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return mixed */ @@ -314,8 +374,8 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -331,7 +391,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param integer $offset Offset * * @return void */ @@ -358,3 +418,4 @@ public function __toString() } } + diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 2514bc4..37e0fdb 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -6,8 +6,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -19,6 +18,7 @@ * OpenAPI spec version: 2.2.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.1 */ /** @@ -34,8 +34,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ObjectSerializer @@ -272,7 +271,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // determine file name if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } diff --git a/swagger.json b/swagger.json new file mode 100644 index 0000000..656d5ce --- /dev/null +++ b/swagger.json @@ -0,0 +1,5394 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "2.2.0", + "title" : "SUPLA Cloud API" + }, + "host" : "cloud.supla.org", + "basePath" : "/api", + "schemes" : [ "https", "http" ], + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "security" : [ { + "password" : [ ] + } ], + "paths" : { + "/server-info" : { + "get" : { + "tags" : [ "Server" ], + "summary" : "Get server status", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + } ], + "responses" : { + "200" : { + "description" : "Server status", + "schema" : { + "$ref" : "#/definitions/inline_response_200" + } + } + }, + "security" : [ ] + } + }, + "/server-status" : { + "get" : { + "tags" : [ "Server" ], + "summary" : "Get the SUPLA Server status", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + } ], + "responses" : { + "200" : { + "description" : "SUPLA Server is alive", + "schema" : { + "$ref" : "#/definitions/inline_response_200_1" + } + }, + "503" : { + "description" : "SUPLA Server is down", + "schema" : { + "$ref" : "#/definitions/inline_response_503" + } + } + }, + "security" : [ ] + } + }, + "/users/current" : { + "get" : { + "tags" : [ "Users" ], + "summary" : "Get current user", + "operationId" : "getCurrentUser", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/User request" + } + } + } + }, + "patch" : { + "tags" : [ "Users" ], + "summary" : "Edit current user", + "operationId" : "editCurrentUser", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body" + } + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/inline_response_200_2" + } + } + } + } + }, + "/locations" : { + "get" : { + "tags" : [ "Locations" ], + "summary" : "Get locations list", + "operationId" : "getLocations", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "iodevices", "accessids", "channelGroups", "password" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "List of locations owned by the current user.", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Location" + } + } + } + } + }, + "post" : { + "tags" : [ "Locations" ], + "summary" : "Create a new location", + "operationId" : "createLocation", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + } ], + "responses" : { + "201" : { + "description" : "Newely created location with automatic name", + "schema" : { + "$ref" : "#/definitions/Location" + } + } + } + } + }, + "/locations/{id}" : { + "get" : { + "tags" : [ "Locations" ], + "summary" : "Get location by ID", + "operationId" : "getLocation", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "iodevices", "accessids", "channelGroups", "password" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Get location", + "schema" : { + "$ref" : "#/definitions/Location" + } + } + } + }, + "put" : { + "tags" : [ "Locations" ], + "summary" : "Edit location", + "operationId" : "updateLocation", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "iodevices", "accessids", "channelGroups", "password" ] + }, + "collectionFormat" : "csv" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_1" + } + } ], + "responses" : { + "200" : { + "description" : "Definition generated from Swagger Inspector", + "schema" : { + "$ref" : "#/definitions/Location" + } + } + } + }, + "delete" : { + "tags" : [ "Locations" ], + "summary" : "Delete location", + "operationId" : "deleteLocation", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "iodevices", "accessids", "channelGroups", "password" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "204" : { + "description" : "Location has been successfully deleted" + } + } + } + }, + "/channels" : { + "get" : { + "tags" : [ "Channels" ], + "summary" : "Get channels list", + "operationId" : "getChannels", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "iodevice", "location" ] + }, + "collectionFormat" : "csv" + }, { + "name" : "function", + "in" : "query", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "NONE", "CONTROLLINGTHEGATEWAYLOCK", "CONTROLLINGTHEGATE", "CONTROLLINGTHEGARAGEDOOR", "THERMOMETER", "HUMIDITY", "HUMIDITYANDTEMPERATURE", "OPENINGSENSOR_GATEWAY", "OPENINGSENSOR_GATE", "OPENINGSENSOR_GARAGEDOOR", "NOLIQUIDSENSOR", "CONTROLLINGTHEDOORLOCK", "OPENINGSENSOR_DOOR", "CONTROLLINGTHEROLLERSHUTTER", "OPENINGSENSOR_ROLLERSHUTTER", "POWERSWITCH", "LIGHTSWITCH", "DIMMER", "RGBLIGHTING", "DIMMERANDRGBLIGHTING", "DEPTHSENSOR", "DISTANCESENSOR", "OPENINGSENSOR_WINDOW", "MAILSENSOR", "WINDSENSOR", "PRESSURESENSOR", "RAINSENSOR", "WEIGHTSENSOR", "WEATHER_STATION", "STAIRCASETIMER" ] + }, + "collectionFormat" : "csv" + }, { + "name" : "io", + "in" : "query", + "description" : "Return only `input` or `output` channels.", + "required" : false, + "type" : "string", + "enum" : [ "input", "output" ] + }, { + "name" : "hasFunction", + "in" : "query", + "description" : "Return only channels with (`true`) or without (`false`) chosen functions.", + "required" : false, + "type" : "boolean" + } ], + "responses" : { + "200" : { + "description" : "List of channels owned by the current user.", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Channel" + } + } + } + } + } + }, + "/channels/{id}" : { + "get" : { + "tags" : [ "Channels" ], + "summary" : "Get channel by ID", + "operationId" : "getChannel", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "iodevice", "location", "connected", "state", "supportedFunctions" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Get channel", + "schema" : { + "$ref" : "#/definitions/Channel" + } + } + } + }, + "put" : { + "tags" : [ "Channels" ], + "summary" : "Update channel", + "operationId" : "updateChannel", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_2" + } + } ], + "responses" : { + "200" : { + "description" : "Updated channel", + "schema" : { + "$ref" : "#/definitions/Channel" + } + }, + "409" : { + "description" : "Channel update will result in data loss. Please confirm the request with `confirm=true` GET param to force.", + "schema" : { + "$ref" : "#/definitions/inline_response_409" + } + } + } + }, + "patch" : { + "tags" : [ "Channels" ], + "summary" : "Execute action on the channel", + "operationId" : "executeAction", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "description" : "Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions).", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_3" + } + } ], + "responses" : { + "204" : { + "description" : "Action has been executed." + }, + "400" : { + "description" : "Invalid request.", + "schema" : { + "$ref" : "#/definitions/inline_response_400" + } + } + } + } + }, + "/channels/{id}/schedules" : { + "get" : { + "tags" : [ "Channels" ], + "summary" : "Get schedules list of the channel", + "operationId" : "getChannelSchedules", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channel", "iodevice", "location", "closestExecutions" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Schedule" + } + } + } + } + } + }, + "/channels/{id}/measurement-logs-csv" : { + "get" : { + "tags" : [ "Channels" ], + "summary" : "Get measurement logs as zipped CSV file.", + "description" : "Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs ordered by date, descending.", + "operationId" : "getChannelMeasurementLogsCsvFile", + "produces" : [ "application/zip" ], + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "type" : "file" + } + }, + "400" : { + "description" : "Unsupoorted channel", + "schema" : { + "$ref" : "#/definitions/inline_response_400_1" + } + } + } + } + }, + "/channels/{id}/measurement-logs" : { + "get" : { + "tags" : [ "Channels" ], + "summary" : "Get measurement logs.", + "description" : "Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs ordered by date, descending.", + "operationId" : "getChannelMeasurementLogs", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "limit", + "in" : "query", + "description" : "Maximum items count in response, from 1 to 5000", + "required" : false, + "type" : "integer", + "default" : 5000 + }, { + "name" : "offset", + "in" : "query", + "description" : "Pagination offset", + "required" : false, + "type" : "integer" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/inline_response_200_3" + } + }, + "headers" : { + "X-Total-Count" : { + "type" : "integer", + "description" : "Total count of logs for this channel." + } + } + }, + "400" : { + "description" : "Unsupoorted channel", + "schema" : { + "$ref" : "#/definitions/inline_response_400_1" + } + } + } + } + }, + "/channel-groups" : { + "get" : { + "tags" : [ "Channel Groups" ], + "summary" : "Get channels list", + "operationId" : "getChannelGroups", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "List of channels oroups owned by the current user.", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ChannelGroup" + } + } + } + } + }, + "post" : { + "tags" : [ "Channel Groups" ], + "summary" : "Create a new channel group", + "operationId" : "createChannelGroup", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_4" + } + } ], + "responses" : { + "201" : { + "description" : "Newely created channel group", + "schema" : { + "$ref" : "#/definitions/ChannelGroup" + } + } + } + } + }, + "/channel-groups/{id}" : { + "get" : { + "tags" : [ "Channel Groups" ], + "summary" : "Get channel group by ID", + "operationId" : "getChannelGroup", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "iodevice", "location" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/ChannelGroup" + } + } + } + }, + "put" : { + "tags" : [ "Channel Groups" ], + "summary" : "Update channel group", + "operationId" : "updateChannelGroup", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_5" + } + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/ChannelGroup" + } + } + } + }, + "delete" : { + "tags" : [ "Channel Groups" ], + "summary" : "Delete Channel Group", + "operationId" : "deleteChannelGroup", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + } ], + "responses" : { + "204" : { + "description" : "Channel Group has been successfully deleted" + } + } + }, + "patch" : { + "tags" : [ "Channel Groups" ], + "summary" : "Execute action on the channel group", + "operationId" : "executeChannelGroupAction", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "description" : "Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions).", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_6" + } + } ], + "responses" : { + "204" : { + "description" : "Action has been executed." + }, + "400" : { + "description" : "Invalid request.", + "schema" : { + "$ref" : "#/definitions/inline_response_400" + } + } + } + } + }, + "/client-apps" : { + "get" : { + "tags" : [ "Client Apps" ], + "summary" : "Get client apps", + "operationId" : "getClientApps", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "accessId", "connected" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ClientApp" + } + } + } + } + } + }, + "/client-apps/{id}" : { + "put" : { + "tags" : [ "Client Apps" ], + "summary" : "Update client app", + "operationId" : "updateClientApp", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_7" + } + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/ClientApp" + } + } + } + }, + "delete" : { + "tags" : [ "Client Apps" ], + "summary" : "Delete Client App", + "operationId" : "deleteClientApp", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + } ], + "responses" : { + "204" : { + "description" : "Success" + } + } + } + }, + "/iodevices" : { + "get" : { + "tags" : [ "IO Devices" ], + "summary" : "Get IO Devices", + "operationId" : "getIoDevices", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "location", "originalLocation", "connected", "schedules" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Device" + } + } + } + } + } + }, + "/iodevices/{id}" : { + "get" : { + "tags" : [ "IO Devices" ], + "summary" : "Get IO Device", + "operationId" : "getIoDevice", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channels", "location", "originalLocation", "connected", "schedules", "accessids" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/Device" + } + } + } + }, + "put" : { + "tags" : [ "IO Devices" ], + "summary" : "Update IO Device", + "operationId" : "updateIoDevice", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_8" + } + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/Device" + } + } + } + }, + "delete" : { + "tags" : [ "IO Devices" ], + "summary" : "Delete IO Device", + "operationId" : "deleteIoDevice", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + } ], + "responses" : { + "204" : { + "description" : "Success" + } + } + } + }, + "/iodevices/{id}/channels" : { + "get" : { + "tags" : [ "IO Devices" ], + "summary" : "Get Channels that belong to IO Deice", + "operationId" : "getIoDeviceChannels", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "iodevice", "location" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/Channel" + } + } + } + } + }, + "/schedules" : { + "get" : { + "tags" : [ "Schedules" ], + "summary" : "Get schedules list", + "operationId" : "getSchedules", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channel", "iodevice", "location", "closestExecutions" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Schedule" + } + } + } + } + }, + "post" : { + "tags" : [ "Schedules" ], + "summary" : "Create a new schedule", + "operationId" : "createSchedule", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/ScheduleRequest" + } + } ], + "responses" : { + "201" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/Schedule" + } + } + } + }, + "patch" : { + "tags" : [ "Schedules" ], + "summary" : "Enable schedules", + "operationId" : "enableSchedules", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_9" + } + } ], + "responses" : { + "204" : { + "description" : "Success" + } + } + } + }, + "/schedules/{id}" : { + "get" : { + "tags" : [ "Schedules" ], + "summary" : "Get Schedule", + "operationId" : "getSchedule", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "channel", "iodevice", "location", "closestExecutions" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/Schedule" + } + } + } + }, + "put" : { + "tags" : [ "Schedules" ], + "summary" : "Update schedule", + "operationId" : "updateSchedule", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/ScheduleRequest" + } + }, { + "name" : "enable", + "in" : "query", + "description" : "Set to `true` to enable the schedule after saving.", + "required" : false, + "type" : "boolean", + "enum" : [ "true" ] + } ], + "responses" : { + "200" : { + "description" : "Success", + "schema" : { + "$ref" : "#/definitions/Schedule" + } + } + } + }, + "delete" : { + "tags" : [ "Schedules" ], + "summary" : "Delete Schedule", + "operationId" : "deleteSchedule", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + } ], + "responses" : { + "204" : { + "description" : "Success" + } + } + } + }, + "/accessids" : { + "get" : { + "tags" : [ "Access IDs" ], + "summary" : "Get Access IDs list", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "locations", "clientApps", "password" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "List of Access IDs owned by the current user.", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/AccessID" + } + } + } + } + }, + "post" : { + "tags" : [ "Access IDs" ], + "summary" : "Create a new Access ID", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + } ], + "responses" : { + "201" : { + "description" : "Newely created AccessID with automatic name", + "schema" : { + "$ref" : "#/definitions/AccessID" + } + } + } + } + }, + "/accessids/{id}" : { + "get" : { + "tags" : [ "Access IDs" ], + "summary" : "Get Access ID", + "operationId" : "getAccessID", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "locations", "clientApps", "password" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "Get Access ID", + "schema" : { + "$ref" : "#/definitions/AccessID" + } + } + } + }, + "put" : { + "tags" : [ "Access IDs" ], + "summary" : "Edit Access ID", + "operationId" : "updateAccessID", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + }, { + "in" : "body", + "name" : "body", + "required" : true, + "schema" : { + "$ref" : "#/definitions/body_10" + } + } ], + "responses" : { + "200" : { + "description" : "Definition generated from Swagger Inspector", + "schema" : { + "$ref" : "#/definitions/AccessID" + } + } + } + }, + "delete" : { + "tags" : [ "Access IDs" ], + "summary" : "Delete Access Identifier", + "operationId" : "deleteAccessID", + "parameters" : [ { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, { + "name" : "id", + "in" : "path", + "required" : true, + "type" : "integer" + } ], + "responses" : { + "204" : { + "description" : "Access Identifier has been successfully deleted" + } + } + } + } + }, + "securityDefinitions" : { + "password" : { + "type" : "oauth2", + "tokenUrl" : "https://beta-cloud.supla.org/oauth/v2/token", + "flow" : "password", + "scopes" : { + "restapi" : "full API access" + } + } + }, + "definitions" : { + "AccessID" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Access ID identifier" + }, + "caption" : { + "type" : "string", + "description" : "Location caption" + }, + "enabled" : { + "type" : "boolean", + "description" : "`true` if the location is enabled, `false` otherwise" + }, + "locationsIds" : { + "type" : "array", + "description" : "array containing the location idenfifiers assigned to this access ID", + "items" : { + "type" : "integer" + } + }, + "clientAppsIds" : { + "type" : "array", + "description" : "array containing the client apps idenfifiers assigned to this access ID", + "items" : { + "type" : "integer" + } + }, + "locations" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/Location" + } + }, + "clientApps" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/ClientApp" + } + } + }, + "example" : { + "clientApps" : [ { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + }, { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + } ], + "caption" : "caption", + "locations" : [ null, null ], + "id" : 6, + "clientAppsIds" : [ 9, 9 ], + "enabled" : true, + "locationsIds" : [ 8, 8 ] + } + }, + "ClientApp" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Client application identifier" + }, + "name" : { + "type" : "string" + }, + "caption" : { + "type" : "string" + }, + "enabled" : { + "type" : "boolean" + }, + "regIpv4" : { + "type" : "integer" + }, + "regDate" : { + "type" : "string", + "format" : "date-time" + }, + "lastAccessIpv4" : { + "type" : "integer" + }, + "lastAccessDate" : { + "type" : "string", + "format" : "date-time" + }, + "softwareVersion" : { + "type" : "string" + }, + "protocolVersion" : { + "type" : "integer" + }, + "accessIdId" : { + "type" : "integer" + }, + "connected" : { + "type" : "boolean" + }, + "accessId" : { + "$ref" : "#/definitions/AccessID" + } + }, + "example" : { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + } + }, + "Channel" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Channel identifier" + }, + "channelNumber" : { + "type" : "integer", + "description" : "Channel ordinal number in its IO Device" + }, + "caption" : { + "type" : "string", + "description" : "Channel caption" + }, + "type" : { + "$ref" : "#/definitions/ChannelType" + }, + "function" : { + "$ref" : "#/definitions/ChannelFunction" + }, + "param1" : { + "$ref" : "#/definitions/ChannelParam" + }, + "param2" : { + "$ref" : "#/definitions/ChannelParam" + }, + "param3" : { + "$ref" : "#/definitions/ChannelParam" + }, + "altIcon" : { + "type" : "integer", + "description" : "Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex`" + }, + "hidden" : { + "type" : "boolean", + "description" : "Whether this channel is shown on client apps or not" + }, + "inheritedLocation" : { + "type" : "boolean", + "description" : "Whether this channel inherits its IODevice's location (`true`) or not (`false`)" + }, + "iodeviceId" : { + "type" : "integer" + }, + "locationId" : { + "type" : "integer" + }, + "functionId" : { + "type" : "integer", + "example" : 60 + }, + "typeId" : { + "type" : "integer", + "example" : 1000 + }, + "iodevice" : { + "$ref" : "#/definitions/Device" + }, + "location" : { + "$ref" : "#/definitions/Location" + }, + "connected" : { + "type" : "boolean" + }, + "supportedFunctions" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ChannelFunction" + } + } + }, + "example" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } + }, + "ChannelGroup" : { + "properties" : { + "id" : { + "type" : "integer", + "example" : 1, + "description" : "Channel group identifier" + }, + "hidden" : { + "type" : "boolean", + "description" : "Whether this channel group is shown on client apps or not" + }, + "caption" : { + "type" : "string", + "description" : "Channel caption" + }, + "function" : { + "$ref" : "#/definitions/ChannelFunction" + }, + "functionId" : { + "type" : "integer", + "example" : 60 + }, + "locationId" : { + "type" : "integer" + }, + "location" : { + "$ref" : "#/definitions/Location" + }, + "channelIds" : { + "type" : "array", + "items" : { + "type" : "integer" + } + }, + "channels" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/Channel" + } + }, + "altIcon" : { + "type" : "integer", + "description" : "Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex`" + } + }, + "example" : { + "functionId" : 60, + "hidden" : true, + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "locationId" : 0, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "caption" : "caption", + "location" : { + "iodevicesIds" : [ 6, 6 ], + "password" : "password", + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "accessIdsIds" : [ 5, 5 ], + "channelGroups" : [ ], + "caption" : "caption", + "channelGroupsIds" : [ 1, 1 ], + "accessIds" : [ { + "clientApps" : [ { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + }, { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + } ], + "caption" : "caption", + "locations" : [ null, null ], + "id" : 6, + "clientAppsIds" : [ 9, 9 ], + "enabled" : true, + "locationsIds" : [ 8, 8 ] + }, { + "clientApps" : [ { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + }, { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + } ], + "caption" : "caption", + "locations" : [ null, null ], + "id" : 6, + "clientAppsIds" : [ 9, 9 ], + "enabled" : true, + "locationsIds" : [ 8, 8 ] + } ], + "id" : 0, + "iodevices" : [ { + "originalLocation" : null, + "lastIpv4" : 9, + "gUIDString" : "gUIDString", + "originalLocationId" : 2, + "regDate" : "2000-01-23T04:56:07.000+00:00", + "channelsIds" : [ 4, 4 ], + "enabled" : true, + "connected" : true, + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "lastConnected" : "2000-01-23T04:56:07.000+00:00", + "locationId" : 3, + "regIpv4" : 7, + "schedules" : [ { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + }, { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + } ], + "name" : "name", + "comment" : "comment", + "location" : null, + "id" : 2, + "softwareVersion" : "softwareVersion" + }, { + "originalLocation" : null, + "lastIpv4" : 9, + "gUIDString" : "gUIDString", + "originalLocationId" : 2, + "regDate" : "2000-01-23T04:56:07.000+00:00", + "channelsIds" : [ 4, 4 ], + "enabled" : true, + "connected" : true, + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "lastConnected" : "2000-01-23T04:56:07.000+00:00", + "locationId" : 3, + "regIpv4" : 7, + "schedules" : [ { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + }, { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + } ], + "name" : "name", + "comment" : "comment", + "location" : null, + "id" : 2, + "softwareVersion" : "softwareVersion" + } ], + "channelsIds" : [ 5, 5 ], + "enabled" : true + }, + "id" : 1, + "channelIds" : [ 6, 6 ], + "altIcon" : 1 + } + }, + "ChannelType" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Channel type identifier" + }, + "name" : { + "type" : "string", + "enum" : [ "SENSORNO", "SENSORNC", "DISTANCESENSOR", "CALLBUTTON", "RELAYHFD4", "RELAYG5LA1A", "RELAY2XG5LA1A", "RELAY", "THERMOMETERDS18B20", "DHT11", "DHT21", "DHT22", "AM2301", "AM2302", "THERMOMETER", "HUMIDITYSENSOR", "HUMIDITYANDTEMPSENSOR", "WINDSENSOR", "PRESSURESENSOR", "RAINSENSOR", "WEIGHTSENSOR", "WEATHER_STATION", "DIMMER", "RGBLEDCONTROLLER", "DIMMERANDRGBLED" ] + }, + "caption" : { + "type" : "string", + "example" : "Sensor (normal open)" + }, + "output" : { + "type" : "boolean", + "example" : false, + "description" : "Whether the channel is output type (i.e. can take action) or input (i.e. provide data)" + } + }, + "example" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + } + }, + "ChannelFunction" : { + "properties" : { + "id" : { + "type" : "integer", + "example" : 60 + }, + "name" : { + "$ref" : "#/definitions/ChannelFunctionEnumNames" + }, + "caption" : { + "type" : "string", + "example" : "Gate opening sensor" + }, + "maxAlternativeIconIndex" : { + "type" : "integer" + }, + "possibleActions" : { + "type" : "array", + "description" : "What can you with with this channel?", + "items" : { + "$ref" : "#/definitions/ChannelFunctionAction" + } + } + }, + "example" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } + }, + "ChannelFunctionEnumNames" : { + "type" : "string", + "example" : "OPENINGSENSOR_GATE", + "enum" : [ "NONE", "CONTROLLINGTHEGATEWAYLOCK", "CONTROLLINGTHEGATE", "CONTROLLINGTHEGARAGEDOOR", "THERMOMETER", "HUMIDITY", "HUMIDITYANDTEMPERATURE", "OPENINGSENSOR_GATEWAY", "OPENINGSENSOR_GATE", "OPENINGSENSOR_GARAGEDOOR", "NOLIQUIDSENSOR", "CONTROLLINGTHEDOORLOCK", "OPENINGSENSOR_DOOR", "CONTROLLINGTHEROLLERSHUTTER", "OPENINGSENSOR_ROLLERSHUTTER", "POWERSWITCH", "LIGHTSWITCH", "DIMMER", "RGBLIGHTING", "DIMMERANDRGBLIGHTING", "DEPTHSENSOR", "DISTANCESENSOR", "OPENINGSENSOR_WINDOW", "MAILSENSOR", "WINDSENSOR", "PRESSURESENSOR", "RAINSENSOR", "WEIGHTSENSOR", "WEATHER_STATION", "STAIRCASETIMER" ] + }, + "ChannelFunctionAction" : { + "properties" : { + "id" : { + "type" : "integer" + }, + "name" : { + "$ref" : "#/definitions/ChannelFunctionActionEnum" + }, + "caption" : { + "type" : "string" + } + }, + "example" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + } + }, + "ChannelFunctionActionEnum" : { + "type" : "string", + "enum" : [ "OPEN", "CLOSE", "SHUT", "REVEAL", "REVEAL_PARTIALLY", "TURN_ON", "TURN_OFF", "SET_RGBW_PARAMETERS", "OPEN_CLOSE", "STOP" ] + }, + "ChannelParam" : { + "type" : "integer", + "description" : "Configuration of the channel behavior. Value meaning depends on the chosen channel function. See more details on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Functions-parameters)." + }, + "Device" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Device identifier" + }, + "name" : { + "type" : "string" + }, + "enabled" : { + "type" : "boolean" + }, + "comment" : { + "type" : "string" + }, + "regDate" : { + "type" : "string", + "format" : "date-time" + }, + "regIpv4" : { + "type" : "integer" + }, + "lastConnected" : { + "type" : "string", + "format" : "date-time" + }, + "lastIpv4" : { + "type" : "integer" + }, + "softwareVersion" : { + "type" : "string" + }, + "gUIDString" : { + "type" : "string" + }, + "locationId" : { + "type" : "integer" + }, + "originalLocationId" : { + "type" : "integer" + }, + "channelsIds" : { + "type" : "array", + "items" : { + "type" : "integer" + } + }, + "connected" : { + "type" : "boolean" + }, + "location" : { + "$ref" : "#/definitions/Location" + }, + "originalLocation" : { + "$ref" : "#/definitions/Location" + }, + "channels" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/Channel" + } + }, + "schedules" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/Schedule" + } + } + }, + "example" : { + "originalLocation" : null, + "lastIpv4" : 9, + "gUIDString" : "gUIDString", + "originalLocationId" : 2, + "regDate" : "2000-01-23T04:56:07.000+00:00", + "channelsIds" : [ 4, 4 ], + "enabled" : true, + "connected" : true, + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "lastConnected" : "2000-01-23T04:56:07.000+00:00", + "locationId" : 3, + "regIpv4" : 7, + "schedules" : [ { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + }, { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + } ], + "name" : "name", + "comment" : "comment", + "location" : null, + "id" : 2, + "softwareVersion" : "softwareVersion" + } + }, + "Location" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Location identifier" + }, + "caption" : { + "type" : "string", + "description" : "Location caption" + }, + "enabled" : { + "type" : "boolean", + "description" : "`true` if the location is enabled, `false` otherwise" + }, + "iodevicesIds" : { + "type" : "array", + "description" : "array containing the IO Devices identifiers assigned to this location", + "items" : { + "type" : "integer" + } + }, + "channelGroupsIds" : { + "type" : "array", + "description" : "array containing the Channel groups identifiers assigned to this location", + "items" : { + "type" : "integer" + } + }, + "channelsIds" : { + "type" : "array", + "description" : "array containing the Channels identifiers expicitely assigned to this location", + "items" : { + "type" : "integer" + } + }, + "accessIdsIds" : { + "type" : "array", + "description" : "array containing the Access Identifiers identifiers assigned to this location", + "items" : { + "type" : "integer" + } + }, + "password" : { + "type" : "string", + "description" : "Location password (plain text). Returned only if requested by the `include` parameter." + }, + "iodevices" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/Device" + } + }, + "channelGroups" : { + "type" : "array", + "example" : [ ], + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/ChannelGroup" + } + }, + "accessIds" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/AccessID" + } + }, + "channels" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter.", + "items" : { + "$ref" : "#/definitions/Channel" + } + } + }, + "example" : { + "iodevicesIds" : [ 6, 6 ], + "password" : "password", + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "accessIdsIds" : [ 5, 5 ], + "channelGroups" : [ ], + "caption" : "caption", + "channelGroupsIds" : [ 1, 1 ], + "accessIds" : [ { + "clientApps" : [ { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + }, { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + } ], + "caption" : "caption", + "locations" : [ null, null ], + "id" : 6, + "clientAppsIds" : [ 9, 9 ], + "enabled" : true, + "locationsIds" : [ 8, 8 ] + }, { + "clientApps" : [ { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + }, { + "lastAccessIpv4" : 6, + "caption" : "caption", + "regDate" : "2000-01-23T04:56:07.000+00:00", + "enabled" : true, + "connected" : true, + "accessId" : null, + "accessIdId" : 2, + "lastAccessDate" : "2000-01-23T04:56:07.000+00:00", + "regIpv4" : 3, + "name" : "name", + "protocolVersion" : 1, + "id" : 6, + "softwareVersion" : "softwareVersion" + } ], + "caption" : "caption", + "locations" : [ null, null ], + "id" : 6, + "clientAppsIds" : [ 9, 9 ], + "enabled" : true, + "locationsIds" : [ 8, 8 ] + } ], + "id" : 0, + "iodevices" : [ { + "originalLocation" : null, + "lastIpv4" : 9, + "gUIDString" : "gUIDString", + "originalLocationId" : 2, + "regDate" : "2000-01-23T04:56:07.000+00:00", + "channelsIds" : [ 4, 4 ], + "enabled" : true, + "connected" : true, + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "lastConnected" : "2000-01-23T04:56:07.000+00:00", + "locationId" : 3, + "regIpv4" : 7, + "schedules" : [ { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + }, { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + } ], + "name" : "name", + "comment" : "comment", + "location" : null, + "id" : 2, + "softwareVersion" : "softwareVersion" + }, { + "originalLocation" : null, + "lastIpv4" : 9, + "gUIDString" : "gUIDString", + "originalLocationId" : 2, + "regDate" : "2000-01-23T04:56:07.000+00:00", + "channelsIds" : [ 4, 4 ], + "enabled" : true, + "connected" : true, + "channels" : [ { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + } ], + "lastConnected" : "2000-01-23T04:56:07.000+00:00", + "locationId" : 3, + "regIpv4" : 7, + "schedules" : [ { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + }, { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + } ], + "name" : "name", + "comment" : "comment", + "location" : null, + "id" : 2, + "softwareVersion" : "softwareVersion" + } ], + "channelsIds" : [ 5, 5 ], + "enabled" : true + } + }, + "Schedule" : { + "properties" : { + "id" : { + "type" : "integer", + "description" : "Schedule identifier" + }, + "timeExpression" : { + "type" : "string", + "example" : "*/5 * * * *", + "description" : "Schedule time expression in crontab notation (with some custom additions)." + }, + "action" : { + "$ref" : "#/definitions/ChannelFunctionAction" + }, + "mode" : { + "type" : "string", + "enum" : [ "minutely", "hourly", "daily", "once" ] + }, + "dateStart" : { + "type" : "string", + "format" : "date-time" + }, + "dateEnd" : { + "type" : "string", + "format" : "date-time" + }, + "enabled" : { + "type" : "boolean" + }, + "caption" : { + "type" : "string" + }, + "retry" : { + "type" : "boolean" + }, + "channelId" : { + "type" : "integer" + }, + "actionId" : { + "type" : "integer" + }, + "channel" : { + "$ref" : "#/definitions/Channel" + }, + "closestExecutions" : { + "type" : "array", + "description" : "Returned only if requested by the `include` parameter. Contains two arrays of maximum 3 closest past and future executions.", + "items" : { + "$ref" : "#/definitions/Schedule_closestExecutions" + } + } + }, + "example" : { + "channel" : { + "hidden" : true, + "channelNumber" : 1, + "iodevice" : null, + "caption" : "caption", + "type" : { + "output" : false, + "name" : "SENSORNO", + "caption" : "Sensor (normal open)", + "id" : 1 + }, + "param3" : null, + "param1" : { }, + "param2" : null, + "altIcon" : 7, + "connected" : true, + "functionId" : 60, + "supportedFunctions" : [ { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + } ], + "locationId" : 4, + "function" : { + "maxAlternativeIconIndex" : 1, + "possibleActions" : [ { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, { + "name" : { }, + "caption" : "caption", + "id" : 6 + } ], + "name" : "OPENINGSENSOR_GATE", + "caption" : "Gate opening sensor", + "id" : 60 + }, + "typeId" : 1000, + "location" : null, + "id" : 7, + "inheritedLocation" : true, + "iodeviceId" : 1 + }, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "*/5 * * * *", + "closestExecutions" : [ { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + }, { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } ], + "enabled" : true, + "mode" : "minutely", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "action" : { + "name" : { }, + "caption" : "caption", + "id" : 6 + }, + "actionId" : 9, + "id" : 5, + "retry" : true, + "channelId" : 9 + } + }, + "ScheduleRequest" : { + "properties" : { + "channelId" : { + "type" : "integer" + }, + "actionId" : { + "type" : "integer" + }, + "mode" : { + "type" : "string", + "enum" : [ "once", "minutely", "daily", "hourly" ] + }, + "timeExpression" : { + "type" : "string", + "description" : "Schedule time expression in crontab notation (with some custom additions)." + }, + "dateStart" : { + "type" : "string", + "format" : "date-time" + }, + "dateEnd" : { + "type" : "string", + "format" : "date-time" + }, + "caption" : { + "type" : "string" + }, + "retry" : { + "type" : "boolean" + } + }, + "example" : { + "mode" : "once", + "dateStart" : "2000-01-23T04:56:07.000+00:00", + "actionId" : 6, + "caption" : "caption", + "dateEnd" : "2000-01-23T04:56:07.000+00:00", + "timeExpression" : "timeExpression", + "channelId" : 0, + "retry" : true + } + }, + "inline_response_200_timezone" : { + "properties" : { + "name" : { + "type" : "string", + "example" : "UTC" + }, + "offset" : { + "type" : "integer", + "description" : "Timezone offset in minutes" + } + }, + "example" : { + "offset" : 0, + "name" : "UTC" + } + }, + "inline_response_200" : { + "properties" : { + "address" : { + "type" : "string", + "example" : "svr1.supla.org", + "description" : "SUPLA Server address (to be used in smartphones)" + }, + "time" : { + "type" : "string", + "format" : "date-time", + "description" : "Current server time" + }, + "timezone" : { + "$ref" : "#/definitions/inline_response_200_timezone" + }, + "authenticated" : { + "type" : "boolean" + }, + "username" : { + "type" : "string", + "example" : "supler@supla.org", + "description" : "Present only if `authenticated=true`" + }, + "cloudVersion" : { + "type" : "string", + "example" : "2.2.0" + }, + "apiVersion" : { + "type" : "string", + "example" : "2.2.0" + }, + "supportedApiVersions" : { + "type" : "array", + "example" : [ "2.0.0", "2.1.0", "2.2.0" ], + "items" : { + "type" : "string" + } + } + }, + "example" : { + "authenticated" : true, + "address" : "svr1.supla.org", + "cloudVersion" : "2.2.0", + "apiVersion" : "2.2.0", + "timezone" : { + "offset" : 0, + "name" : "UTC" + }, + "supportedApiVersions" : [ "2.0.0", "2.1.0", "2.2.0" ], + "time" : "2000-01-23T04:56:07.000+00:00", + "username" : "supler@supla.org" + } + }, + "inline_response_200_1" : { + "properties" : { + "status" : { + "type" : "string", + "example" : "OK" + } + }, + "example" : { + "status" : "OK" + } + }, + "inline_response_503" : { + "properties" : { + "status" : { + "type" : "string", + "example" : "DOWN" + } + } + }, + "User request" : { + "properties" : { + "id" : { + "type" : "integer" + }, + "email" : { + "type" : "string", + "format" : "email" + }, + "timezone" : { + "type" : "string", + "example" : "Europe/Warsaw" + }, + "clientsRegistrationEnabled" : { + "type" : "string", + "format" : "date-time" + }, + "ioDevicesRegistrationEnabled" : { + "type" : "string", + "format" : "date-time" + } + }, + "example" : { + "clientsRegistrationEnabled" : "2000-01-23T04:56:07.000+00:00", + "timezone" : "Europe/Warsaw", + "id" : 0, + "ioDevicesRegistrationEnabled" : "2000-01-23T04:56:07.000+00:00", + "email" : "email" + } + }, + "body" : { + "properties" : { + "action" : { + "type" : "string", + "description" : "The `change:userTimezone` requires to provide also a `timezone` value in the request. The `change:password` requires to provide also a `newPassword` and `oldPassword` in the request.", + "enum" : [ "change:clientsRegistrationEnabled", "change:ioDevicesRegistrationEnabled", "change:userTimezone", "change:password", "agree:rules", "agree:cookies" ] + } + } + }, + "inline_response_200_2" : { + "properties" : { + "id" : { + "type" : "integer" + } + }, + "example" : { + "id" : 0 + } + }, + "body_1" : { + "properties" : { + "enabled" : { + "type" : "boolean" + }, + "caption" : { + "type" : "string" + }, + "password" : { + "type" : "string", + "description" : "Provide new password if you want to change it." + }, + "accessIdsIds" : { + "type" : "array", + "description" : "Access Identifiers identifiers to assign to this location.", + "items" : { + "type" : "integer" + } + } + } + }, + "body_2" : { + "properties" : { + "functionId" : { + "type" : "integer" + }, + "param1" : { + "type" : "integer" + }, + "param2" : { + "type" : "integer" + }, + "param3" : { + "type" : "integer" + }, + "caption" : { + "type" : "string" + }, + "altIcon" : { + "type" : "integer" + }, + "hidden" : { + "type" : "boolean" + }, + "locationId" : { + "type" : "integer" + }, + "inheritedLocation" : { + "type" : "boolean" + } + } + }, + "inline_response_409" : { + "properties" : { + "schedules" : { + "type" : "array", + "description" : "Schedules that will be deleted after this request.", + "items" : { + "$ref" : "#/definitions/Schedule" + } + }, + "groups" : { + "type" : "array", + "description" : "Channel groups that this channel will be removed from after this request.", + "items" : { + "$ref" : "#/definitions/ChannelGroup" + } + } + } + }, + "body_3" : { + "properties" : { + "action" : { + "$ref" : "#/definitions/ChannelFunctionActionEnum" + }, + "percentage" : { + "type" : "integer", + "example" : 40 + } + } + }, + "inline_response_400" : { + "properties" : { + "status" : { + "type" : "integer", + "example" : 400 + }, + "message" : { + "type" : "string", + "example" : "Cannot execute requested action on this channel." + } + } + }, + "inline_response_400_1" : { + "properties" : { + "status" : { + "type" : "integer", + "example" : 400 + }, + "message" : { + "type" : "string", + "example" : "The requested function is not available on this channel" + } + } + }, + "inline_response_200_3" : { + "properties" : { + "date_timestamp" : { + "type" : "integer" + }, + "temperature" : { + "type" : "number", + "format" : "float", + "example" : 21.56, + "description" : "Temperature in Celsius" + }, + "humidity" : { + "type" : "number", + "format" : "float", + "example" : 48.8, + "description" : "Humidity percent. Available only if channel function is `HUMIDITYANDTEMPERATURE`." + } + }, + "example" : { + "temperature" : 21.56, + "humidity" : 48.8, + "date_timestamp" : 0 + } + }, + "body_4" : { + "properties" : { + "caption" : { + "type" : "string" + }, + "altIcon" : { + "type" : "integer" + }, + "hidden" : { + "type" : "boolean" + }, + "locationId" : { + "type" : "integer" + }, + "channelIds" : { + "type" : "array", + "items" : { + "type" : "integer" + } + } + } + }, + "body_5" : { + "properties" : { + "caption" : { + "type" : "string" + }, + "altIcon" : { + "type" : "integer" + }, + "hidden" : { + "type" : "boolean" + }, + "locationId" : { + "type" : "integer" + }, + "channelIds" : { + "type" : "array", + "items" : { + "type" : "integer" + } + } + } + }, + "body_6" : { + "properties" : { + "action" : { + "$ref" : "#/definitions/ChannelFunctionActionEnum" + }, + "percentage" : { + "type" : "integer", + "example" : 40 + } + } + }, + "body_7" : { + "properties" : { + "caption" : { + "type" : "string" + }, + "enabled" : { + "type" : "boolean" + }, + "accessIdId" : { + "type" : "integer" + } + } + }, + "body_8" : { + "properties" : { + "comment" : { + "type" : "string" + }, + "enabled" : { + "type" : "boolean" + }, + "locationId" : { + "type" : "integer" + } + } + }, + "body_9" : { + "properties" : { + "enable" : { + "type" : "array", + "description" : "Array of schedule identifiers to enable", + "items" : { + "type" : "integer" + } + } + } + }, + "body_10" : { + "properties" : { + "enabled" : { + "type" : "boolean" + }, + "caption" : { + "type" : "string" + }, + "password" : { + "type" : "string", + "description" : "Provide new password if you want to change it." + }, + "locationsIds" : { + "type" : "array", + "description" : "Locations identifiers to assign to this Access ID.", + "items" : { + "type" : "integer" + } + }, + "clientAppsIds" : { + "type" : "array", + "description" : "Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning.", + "items" : { + "type" : "integer" + } + } + } + }, + "Schedule_result" : { + "properties" : { + "caption" : { + "type" : "string", + "example" : "Successful" + } + }, + "example" : { + "caption" : "Successful" + } + }, + "Schedule_past" : { + "properties" : { + "plannedTimestamp" : { + "type" : "string", + "format" : "date-time" + }, + "resultTimestamp" : { + "type" : "string", + "format" : "date-time" + }, + "failed" : { + "type" : "boolean", + "example" : false + }, + "result" : { + "$ref" : "#/definitions/Schedule_result" + } + }, + "example" : { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } + }, + "Schedule_future" : { + "properties" : { + "plannedTimestamp" : { + "type" : "string", + "format" : "date-time" + } + }, + "example" : { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } + }, + "Schedule_closestExecutions" : { + "properties" : { + "past" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Schedule_past" + } + }, + "future" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Schedule_future" + } + } + }, + "example" : { + "past" : [ { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + }, { + "result" : { + "caption" : "Successful" + }, + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00", + "resultTimestamp" : "2000-01-23T04:56:07.000+00:00", + "failed" : false + } ], + "future" : [ { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + }, { + "plannedTimestamp" : "2000-01-23T04:56:07.000+00:00" + } ] + } + } + }, + "parameters" : { + "version" : { + "name" : "X-Accept-Version", + "in" : "header", + "description" : "API Version", + "required" : false, + "type" : "string", + "x-example" : "2.2.0", + "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] + }, + "AccessIdIncludes" : { + "name" : "include", + "in" : "query", + "description" : "Specify what extra fields to include in the response.", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "locations", "clientApps", "password" ] + }, + "collectionFormat" : "csv" + } + } +} \ No newline at end of file From cdb7739cf9c57a40a421dc5116493ee0d5da4a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 12:48:57 +0200 Subject: [PATCH 05/13] Simplify API docs --- codegen-template/api_doc.mustache | 46 +----- docs/Api/AccessIDsApi.md | 171 ++------------------- docs/Api/ChannelGroupsApi.md | 205 ++----------------------- docs/Api/ChannelsApi.md | 247 ++---------------------------- docs/Api/ClientAppsApi.md | 103 +------------ docs/Api/IODevicesApi.md | 173 ++------------------- docs/Api/LocationsApi.md | 173 ++------------------- docs/Api/SchedulesApi.md | 205 ++----------------------- docs/Api/ServerApi.md | 60 +------- docs/Api/UsersApi.md | 69 +-------- 10 files changed, 75 insertions(+), 1377 deletions(-) diff --git a/codegen-template/api_doc.mustache b/codegen-template/api_doc.mustache index 4118b83..f12880a 100644 --- a/codegen-template/api_doc.mustache +++ b/codegen-template/api_doc.mustache @@ -1,8 +1,6 @@ # {{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}} @@ -11,7 +9,6 @@ Method | HTTP request | Description {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{{summary}}}{{#notes}} @@ -19,38 +16,8 @@ Method | HTTP request | Description ### Example ```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); -{{/isBasic}}{{#isApiKey}} -// Configure API key authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}} -// Configure OAuth2 access token for authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} -{{/hasAuthMethods}} - -$apiInstance = new {{invokerPackage}}\Api\{{classname}}( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(){{#hasAuthMethods}}, - $config{{/hasAuthMethods}} -); -{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} -{{/allParams}} - -try { - {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} - print_r($result);{{/returnType}} -} catch (Exception $e) { - echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->{{classVarName}}()->{{operationId}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} +print_r($result);{{/returnType}} ``` ### Parameters @@ -64,15 +31,6 @@ Name | Type | Description | Notes {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{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 request 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}} diff --git a/docs/Api/AccessIDsApi.md b/docs/Api/AccessIDsApi.md index 2f20cb5..352de96 100644 --- a/docs/Api/AccessIDsApi.md +++ b/docs/Api/AccessIDsApi.md @@ -1,7 +1,5 @@ # Swagger\Client\AccessIDsApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**accessidsGet**](AccessIDsApi.md#accessidsGet) | **GET** /accessids | Get Access IDs list @@ -12,34 +10,13 @@ Method | HTTP request | Description # **accessidsGet** -> \Swagger\Client\Model\AccessID[] accessidsGet($xAcceptVersion, $include) Get Access IDs list ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\AccessIDsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->accessidsGet($xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AccessIDsApi->accessidsGet: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->accessIDs()->accessidsGet($xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -53,45 +30,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\AccessID[]**](../Model/AccessID.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **accessidsPost** -> \Swagger\Client\Model\AccessID accessidsPost($xAcceptVersion) Create a new Access ID ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\AccessIDsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->accessidsPost($xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AccessIDsApi->accessidsPost: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->accessIDs()->accessidsPost($xAcceptVersion); +print_r($result); ``` ### Parameters @@ -104,45 +52,15 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **deleteAccessID** -> deleteAccessID($id, $xAcceptVersion) Delete Access Identifier ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\AccessIDsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->deleteAccessID($id, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling AccessIDsApi->deleteAccessID: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->accessIDs()->deleteAccessID($id, $xAcceptVersion); ``` ### Parameters @@ -156,47 +74,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getAccessID** -> \Swagger\Client\Model\AccessID getAccessID($id, $xAcceptVersion, $include) Get Access ID ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\AccessIDsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getAccessID($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AccessIDsApi->getAccessID: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->accessIDs()->getAccessID($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -211,47 +98,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateAccessID** -> \Swagger\Client\Model\AccessID updateAccessID($id, $body, $xAcceptVersion) Edit Access ID ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\AccessIDsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body10(); // \Swagger\Client\Model\Body10 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->updateAccessID($id, $body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AccessIDsApi->updateAccessID: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->accessIDs()->updateAccessID($id, $body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -266,14 +122,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ChannelGroupsApi.md b/docs/Api/ChannelGroupsApi.md index 7a2b016..950bfc0 100644 --- a/docs/Api/ChannelGroupsApi.md +++ b/docs/Api/ChannelGroupsApi.md @@ -1,7 +1,5 @@ # Swagger\Client\ChannelGroupsApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**createChannelGroup**](ChannelGroupsApi.md#createChannelGroup) | **POST** /channel-groups | Create a new channel group @@ -13,34 +11,13 @@ Method | HTTP request | Description # **createChannelGroup** -> \Swagger\Client\Model\ChannelGroup createChannelGroup($body, $xAcceptVersion) Create a new channel group ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$body = new \Swagger\Client\Model\Body4(); // \Swagger\Client\Model\Body4 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->createChannelGroup($body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelGroupsApi->createChannelGroup: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channelGroups()->createChannelGroup($body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -54,45 +31,15 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\ChannelGroup**](../Model/ChannelGroup.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **deleteChannelGroup** -> deleteChannelGroup($id, $xAcceptVersion) Delete Channel Group ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->deleteChannelGroup($id, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling ChannelGroupsApi->deleteChannelGroup: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channelGroups()->deleteChannelGroup($id, $xAcceptVersion); ``` ### Parameters @@ -106,46 +53,15 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **executeChannelGroupAction** -> executeChannelGroupAction($id, $body, $xAcceptVersion) Execute action on the channel group ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body6(); // \Swagger\Client\Model\Body6 | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->executeChannelGroupAction($id, $body, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling ChannelGroupsApi->executeChannelGroupAction: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channelGroups()->executeChannelGroupAction($id, $body, $xAcceptVersion); ``` ### Parameters @@ -160,47 +76,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getChannelGroup** -> \Swagger\Client\Model\ChannelGroup getChannelGroup($id, $xAcceptVersion, $include) Get channel group by ID ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getChannelGroup($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelGroupsApi->getChannelGroup: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channelGroups()->getChannelGroup($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -215,46 +100,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\ChannelGroup**](../Model/ChannelGroup.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getChannelGroups** -> \Swagger\Client\Model\ChannelGroup[] getChannelGroups($xAcceptVersion, $include) Get channels list ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getChannelGroups($xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelGroupsApi->getChannelGroups: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channelGroups()->getChannelGroups($xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -268,47 +123,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\ChannelGroup[]**](../Model/ChannelGroup.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateChannelGroup** -> \Swagger\Client\Model\ChannelGroup updateChannelGroup($id, $body, $xAcceptVersion) Update channel group ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelGroupsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body5(); // \Swagger\Client\Model\Body5 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->updateChannelGroup($id, $body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelGroupsApi->updateChannelGroup: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channelGroups()->updateChannelGroup($id, $body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -323,14 +147,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\ChannelGroup**](../Model/ChannelGroup.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ChannelsApi.md b/docs/Api/ChannelsApi.md index 3e1621f..a50069d 100644 --- a/docs/Api/ChannelsApi.md +++ b/docs/Api/ChannelsApi.md @@ -1,7 +1,5 @@ # Swagger\Client\ChannelsApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**executeAction**](ChannelsApi.md#executeAction) | **PATCH** /channels/{id} | Execute action on the channel @@ -14,34 +12,12 @@ Method | HTTP request | Description # **executeAction** -> executeAction($id, $body, $xAcceptVersion) Execute action on the channel ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body3(); // \Swagger\Client\Model\Body3 | Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->executeAction($id, $body, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->executeAction: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->executeAction($id, $body, $xAcceptVersion); ``` ### Parameters @@ -56,47 +32,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getChannel** -> \Swagger\Client\Model\Channel getChannel($id, $xAcceptVersion, $include) Get channel by ID ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getChannel($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->getChannel: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->getChannel($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -111,19 +56,9 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Channel**](../Model/Channel.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getChannelMeasurementLogs** -> \Swagger\Client\Model\InlineResponse2003[] getChannelMeasurementLogs($id, $xAcceptVersion, $limit, $offset) Get measurement logs. @@ -131,30 +66,8 @@ Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs or ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$limit = 5000; // int | Maximum items count in response, from 1 to 5000 -$offset = 56; // int | Pagination offset - -try { - $result = $apiInstance->getChannelMeasurementLogs($id, $xAcceptVersion, $limit, $offset); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->getChannelMeasurementLogs: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->getChannelMeasurementLogs($id, $xAcceptVersion, $limit, $offset); +print_r($result); ``` ### Parameters @@ -170,19 +83,9 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\InlineResponse2003[]**](../Model/InlineResponse2003.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getChannelMeasurementLogsCsvFile** -> \SplFileObject getChannelMeasurementLogsCsvFile($id, $xAcceptVersion) Get measurement logs as zipped CSV file. @@ -190,28 +93,8 @@ Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs or ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->getChannelMeasurementLogsCsvFile($id, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->getChannelMeasurementLogsCsvFile: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->getChannelMeasurementLogsCsvFile($id, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -225,47 +108,16 @@ Name | Type | Description | Notes [**\SplFileObject**](../Model/\SplFileObject.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/zip - [[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) # **getChannelSchedules** -> \Swagger\Client\Model\Schedule[] getChannelSchedules($id, $xAcceptVersion, $include) Get schedules list of the channel ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getChannelSchedules($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->getChannelSchedules: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->getChannelSchedules($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -280,49 +132,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Schedule[]**](../Model/Schedule.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getChannels** -> \Swagger\Client\Model\Channel[] getChannels($xAcceptVersion, $include, $function, $io, $hasFunction) Get channels list ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. -$function = array("function_example"); // string[] | -$io = "io_example"; // string | Return only `input` or `output` channels. -$hasFunction = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. - -try { - $result = $apiInstance->getChannels($xAcceptVersion, $include, $function, $io, $hasFunction); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->getChannels: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->getChannels($xAcceptVersion, $include, $function, $io, $hasFunction); +print_r($result); ``` ### Parameters @@ -339,47 +158,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Channel[]**](../Model/Channel.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateChannel** -> \Swagger\Client\Model\Channel updateChannel($id, $body, $xAcceptVersion) Update channel ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ChannelsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body2(); // \Swagger\Client\Model\Body2 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->updateChannel($id, $body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChannelsApi->updateChannel: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->channels()->updateChannel($id, $body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -394,14 +182,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Channel**](../Model/Channel.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ClientAppsApi.md b/docs/Api/ClientAppsApi.md index b79caa3..138275c 100644 --- a/docs/Api/ClientAppsApi.md +++ b/docs/Api/ClientAppsApi.md @@ -1,7 +1,5 @@ # Swagger\Client\ClientAppsApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**deleteClientApp**](ClientAppsApi.md#deleteClientApp) | **DELETE** /client-apps/{id} | Delete Client App @@ -10,33 +8,12 @@ Method | HTTP request | Description # **deleteClientApp** -> deleteClientApp($id, $xAcceptVersion) Delete Client App ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ClientAppsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->deleteClientApp($id, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling ClientAppsApi->deleteClientApp: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->clientApps()->deleteClientApp($id, $xAcceptVersion); ``` ### Parameters @@ -50,46 +27,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getClientApps** -> \Swagger\Client\Model\ClientApp[] getClientApps($xAcceptVersion, $include) Get client apps ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ClientAppsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getClientApps($xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ClientAppsApi->getClientApps: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->clientApps()->getClientApps($xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -103,47 +50,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\ClientApp[]**](../Model/ClientApp.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateClientApp** -> \Swagger\Client\Model\ClientApp updateClientApp($id, $body, $xAcceptVersion) Update client app ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\ClientAppsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body7(); // \Swagger\Client\Model\Body7 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->updateClientApp($id, $body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ClientAppsApi->updateClientApp: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->clientApps()->updateClientApp($id, $body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -158,14 +74,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\ClientApp**](../Model/ClientApp.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/IODevicesApi.md b/docs/Api/IODevicesApi.md index db14a70..93dc068 100644 --- a/docs/Api/IODevicesApi.md +++ b/docs/Api/IODevicesApi.md @@ -1,7 +1,5 @@ # Swagger\Client\IODevicesApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**deleteIoDevice**](IODevicesApi.md#deleteIoDevice) | **DELETE** /iodevices/{id} | Delete IO Device @@ -12,33 +10,12 @@ Method | HTTP request | Description # **deleteIoDevice** -> deleteIoDevice($id, $xAcceptVersion) Delete IO Device ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\IODevicesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->deleteIoDevice($id, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling IODevicesApi->deleteIoDevice: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->iODevices()->deleteIoDevice($id, $xAcceptVersion); ``` ### Parameters @@ -52,47 +29,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getIoDevice** -> \Swagger\Client\Model\Device getIoDevice($id, $xAcceptVersion, $include) Get IO Device ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\IODevicesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getIoDevice($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling IODevicesApi->getIoDevice: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->iODevices()->getIoDevice($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -107,47 +53,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Device**](../Model/Device.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getIoDeviceChannels** -> \Swagger\Client\Model\Channel getIoDeviceChannels($id, $xAcceptVersion, $include) Get Channels that belong to IO Deice ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\IODevicesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getIoDeviceChannels($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling IODevicesApi->getIoDeviceChannels: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->iODevices()->getIoDeviceChannels($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -162,46 +77,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Channel**](../Model/Channel.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getIoDevices** -> \Swagger\Client\Model\Device[] getIoDevices($xAcceptVersion, $include) Get IO Devices ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\IODevicesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getIoDevices($xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling IODevicesApi->getIoDevices: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->iODevices()->getIoDevices($xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -215,47 +100,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Device[]**](../Model/Device.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateIoDevice** -> \Swagger\Client\Model\Device updateIoDevice($id, $body, $xAcceptVersion) Update IO Device ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\IODevicesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body8(); // \Swagger\Client\Model\Body8 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->updateIoDevice($id, $body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling IODevicesApi->updateIoDevice: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->iODevices()->updateIoDevice($id, $body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -270,14 +124,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Device**](../Model/Device.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/LocationsApi.md b/docs/Api/LocationsApi.md index 0df8653..3c09aa6 100644 --- a/docs/Api/LocationsApi.md +++ b/docs/Api/LocationsApi.md @@ -1,7 +1,5 @@ # Swagger\Client\LocationsApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**createLocation**](LocationsApi.md#createLocation) | **POST** /locations | Create a new location @@ -12,33 +10,13 @@ Method | HTTP request | Description # **createLocation** -> \Swagger\Client\Model\Location createLocation($xAcceptVersion) Create a new location ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\LocationsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->createLocation($xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling LocationsApi->createLocation: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->locations()->createLocation($xAcceptVersion); +print_r($result); ``` ### Parameters @@ -51,46 +29,15 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Location**](../Model/Location.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **deleteLocation** -> deleteLocation($id, $xAcceptVersion, $include) Delete location ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\LocationsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $apiInstance->deleteLocation($id, $xAcceptVersion, $include); -} catch (Exception $e) { - echo 'Exception when calling LocationsApi->deleteLocation: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->locations()->deleteLocation($id, $xAcceptVersion, $include); ``` ### Parameters @@ -105,47 +52,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getLocation** -> \Swagger\Client\Model\Location getLocation($id, $xAcceptVersion, $include) Get location by ID ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\LocationsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getLocation($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling LocationsApi->getLocation: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->locations()->getLocation($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -160,46 +76,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Location**](../Model/Location.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getLocations** -> \Swagger\Client\Model\Location[] getLocations($xAcceptVersion, $include) Get locations list ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\LocationsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getLocations($xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling LocationsApi->getLocations: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->locations()->getLocations($xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -213,48 +99,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Location[]**](../Model/Location.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateLocation** -> \Swagger\Client\Model\Location updateLocation($id, $body, $xAcceptVersion, $include) Edit location ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\LocationsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\Body1(); // \Swagger\Client\Model\Body1 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->updateLocation($id, $body, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling LocationsApi->updateLocation: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->locations()->updateLocation($id, $body, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -270,14 +124,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Location**](../Model/Location.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/SchedulesApi.md b/docs/Api/SchedulesApi.md index a6bda54..766cadd 100644 --- a/docs/Api/SchedulesApi.md +++ b/docs/Api/SchedulesApi.md @@ -1,7 +1,5 @@ # Swagger\Client\SchedulesApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**createSchedule**](SchedulesApi.md#createSchedule) | **POST** /schedules | Create a new schedule @@ -13,34 +11,13 @@ Method | HTTP request | Description # **createSchedule** -> \Swagger\Client\Model\Schedule createSchedule($body, $xAcceptVersion) Create a new schedule ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\SchedulesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->createSchedule($body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SchedulesApi->createSchedule: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->schedules()->createSchedule($body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -54,45 +31,15 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Schedule**](../Model/Schedule.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **deleteSchedule** -> deleteSchedule($id, $xAcceptVersion) Delete Schedule ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\SchedulesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->deleteSchedule($id, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling SchedulesApi->deleteSchedule: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->schedules()->deleteSchedule($id, $xAcceptVersion); ``` ### Parameters @@ -106,45 +53,15 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **enableSchedules** -> enableSchedules($body, $xAcceptVersion) Enable schedules ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\SchedulesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$body = new \Swagger\Client\Model\Body9(); // \Swagger\Client\Model\Body9 | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $apiInstance->enableSchedules($body, $xAcceptVersion); -} catch (Exception $e) { - echo 'Exception when calling SchedulesApi->enableSchedules: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->schedules()->enableSchedules($body, $xAcceptVersion); ``` ### Parameters @@ -158,47 +75,16 @@ Name | Type | Description | Notes void (empty response body) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getSchedule** -> \Swagger\Client\Model\Schedule getSchedule($id, $xAcceptVersion, $include) Get Schedule ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\SchedulesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getSchedule($id, $xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SchedulesApi->getSchedule: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->schedules()->getSchedule($id, $xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -213,46 +99,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Schedule**](../Model/Schedule.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getSchedules** -> \Swagger\Client\Model\Schedule[] getSchedules($xAcceptVersion, $include) Get schedules list ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\SchedulesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$include = array("include_example"); // string[] | Specify what extra fields to include in the response. - -try { - $result = $apiInstance->getSchedules($xAcceptVersion, $include); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SchedulesApi->getSchedules: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->schedules()->getSchedules($xAcceptVersion, $include); +print_r($result); ``` ### Parameters @@ -266,48 +122,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Schedule[]**](../Model/Schedule.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **updateSchedule** -> \Swagger\Client\Model\Schedule updateSchedule($id, $body, $xAcceptVersion, $enable) Update schedule ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\SchedulesApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id = 56; // int | -$body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | -$xAcceptVersion = "\"2.2.0\""; // string | API Version -$enable = true; // bool | Set to `true` to enable the schedule after saving. - -try { - $result = $apiInstance->updateSchedule($id, $body, $xAcceptVersion, $enable); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SchedulesApi->updateSchedule: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->schedules()->updateSchedule($id, $body, $xAcceptVersion, $enable); +print_r($result); ``` ### Parameters @@ -323,14 +147,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\Schedule**](../Model/Schedule.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ServerApi.md b/docs/Api/ServerApi.md index 71ea12d..5c6973a 100644 --- a/docs/Api/ServerApi.md +++ b/docs/Api/ServerApi.md @@ -1,7 +1,5 @@ # Swagger\Client\ServerApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**serverInfoGet**](ServerApi.md#serverInfoGet) | **GET** /server-info | Get server status @@ -9,29 +7,13 @@ Method | HTTP request | Description # **serverInfoGet** -> \Swagger\Client\Model\InlineResponse200 serverInfoGet($xAcceptVersion) Get server status ### Example ```php -serverInfoGet($xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ServerApi->serverInfoGet: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->server()->serverInfoGet($xAcceptVersion); +print_r($result); ``` ### Parameters @@ -44,41 +26,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\InlineResponse200**](../Model/InlineResponse200.md) -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **serverStatusGet** -> \Swagger\Client\Model\InlineResponse2001 serverStatusGet($xAcceptVersion) Get the SUPLA Server status ### Example ```php -serverStatusGet($xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ServerApi->serverStatusGet: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->server()->serverStatusGet($xAcceptVersion); +print_r($result); ``` ### Parameters @@ -91,14 +48,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\InlineResponse2001**](../Model/InlineResponse2001.md) -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md index 500cd0a..b2f1c19 100644 --- a/docs/Api/UsersApi.md +++ b/docs/Api/UsersApi.md @@ -1,7 +1,5 @@ # Swagger\Client\UsersApi -All URIs are relative to *https://cloud.supla.org/api* - Method | HTTP request | Description ------------- | ------------- | ------------- [**editCurrentUser**](UsersApi.md#editCurrentUser) | **PATCH** /users/current | Edit current user @@ -9,34 +7,13 @@ Method | HTTP request | Description # **editCurrentUser** -> \Swagger\Client\Model\InlineResponse2002 editCurrentUser($body, $xAcceptVersion) Edit current user ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\UsersApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$body = new \Swagger\Client\Model\Body(); // \Swagger\Client\Model\Body | -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->editCurrentUser($body, $xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling UsersApi->editCurrentUser: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->users()->editCurrentUser($body, $xAcceptVersion); +print_r($result); ``` ### Parameters @@ -50,45 +27,16 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getCurrentUser** -> \Swagger\Client\Model\UserRequest getCurrentUser($xAcceptVersion) Get current user ### Example ```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\UsersApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAcceptVersion = "\"2.2.0\""; // string | API Version - -try { - $result = $apiInstance->getCurrentUser($xAcceptVersion); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling UsersApi->getCurrentUser: ', $e->getMessage(), PHP_EOL; -} -?> +$result = $client->users()->getCurrentUser($xAcceptVersion); +print_r($result); ``` ### Parameters @@ -101,14 +49,5 @@ Name | Type | Description | Notes [**\Swagger\Client\Model\UserRequest**](../Model/UserRequest.md) -### Authorization - -[password](../../README.md#password) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) From b27545270de3d2280b27c1acdc3d5ec4a38a94d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 13:50:20 +0200 Subject: [PATCH 06/13] Docs without version header --- README.md | 8 +- codegen-template/api_doc.mustache | 4 +- docs/Api/AccessIDsApi.md | 64 +++-- docs/Api/ChannelGroupsApi.md | 39 +-- docs/Api/ChannelsApi.md | 51 ++-- docs/Api/ClientAppsApi.md | 19 +- docs/Api/IODevicesApi.md | 33 +-- docs/Api/LocationsApi.md | 34 +-- docs/Api/SchedulesApi.md | 39 +-- docs/Api/ServerApi.md | 12 +- docs/Api/UsersApi.md | 12 +- docs/Model/Channel.md | 2 +- lib/Api/AccessIDsApi.php | 381 +++++++++++++----------------- lib/Api/ChannelGroupsApi.php | 162 +++++-------- lib/Api/ChannelsApi.php | 189 +++++---------- lib/Api/ClientAppsApi.php | 81 +++---- lib/Api/IODevicesApi.php | 135 ++++------- lib/Api/LocationsApi.php | 135 ++++------- lib/Api/SchedulesApi.php | 162 +++++-------- lib/Api/ServerApi.php | 54 ++--- lib/Api/UsersApi.php | 54 ++--- lib/Configuration.php | 2 +- lib/Model/Channel.php | 2 +- swagger.json | 353 +-------------------------- 24 files changed, 665 insertions(+), 1362 deletions(-) diff --git a/README.md b/README.md index c5ea34f..6fa8fa2 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,14 @@ PHP 5.5 and later ## Documentation for API Endpoints -All URIs are relative to *https://cloud.supla.org/api* +All URIs are relative to *https://cloud.supla.org/api/v2.2.0* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AccessIDsApi* | [**accessidsGet**](docs/Api/AccessIDsApi.md#accessidsget) | **GET** /accessids | Get Access IDs list -*AccessIDsApi* | [**accessidsPost**](docs/Api/AccessIDsApi.md#accessidspost) | **POST** /accessids | Create a new Access ID +*AccessIDsApi* | [**createAccessID**](docs/Api/AccessIDsApi.md#createaccessid) | **POST** /accessids | Create a new Access ID *AccessIDsApi* | [**deleteAccessID**](docs/Api/AccessIDsApi.md#deleteaccessid) | **DELETE** /accessids/{id} | Delete Access Identifier -*AccessIDsApi* | [**getAccessID**](docs/Api/AccessIDsApi.md#getaccessid) | **GET** /accessids/{id} | Get Access ID +*AccessIDsApi* | [**getAccessID**](docs/Api/AccessIDsApi.md#getaccessid) | **GET** /accessids | Get Access IDs list +*AccessIDsApi* | [**getAccessID_0**](docs/Api/AccessIDsApi.md#getaccessid_0) | **GET** /accessids/{id} | Get Access ID *AccessIDsApi* | [**updateAccessID**](docs/Api/AccessIDsApi.md#updateaccessid) | **PUT** /accessids/{id} | Edit Access ID *ChannelGroupsApi* | [**createChannelGroup**](docs/Api/ChannelGroupsApi.md#createchannelgroup) | **POST** /channel-groups | Create a new channel group *ChannelGroupsApi* | [**deleteChannelGroup**](docs/Api/ChannelGroupsApi.md#deletechannelgroup) | **DELETE** /channel-groups/{id} | Delete Channel Group diff --git a/codegen-template/api_doc.mustache b/codegen-template/api_doc.mustache index f12880a..722078a 100644 --- a/codegen-template/api_doc.mustache +++ b/codegen-template/api_doc.mustache @@ -16,12 +16,14 @@ Method | HTTP request | Description ### Example ```php +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} $result = $client->{{classVarName}}()->{{operationId}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} print_r($result);{{/returnType}} ``` +{{#allParams}}{{#-last}} ### 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}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} diff --git a/docs/Api/AccessIDsApi.md b/docs/Api/AccessIDsApi.md index 352de96..9bd2f58 100644 --- a/docs/Api/AccessIDsApi.md +++ b/docs/Api/AccessIDsApi.md @@ -2,96 +2,93 @@ Method | HTTP request | Description ------------- | ------------- | ------------- -[**accessidsGet**](AccessIDsApi.md#accessidsGet) | **GET** /accessids | Get Access IDs list -[**accessidsPost**](AccessIDsApi.md#accessidsPost) | **POST** /accessids | Create a new Access ID +[**createAccessID**](AccessIDsApi.md#createAccessID) | **POST** /accessids | Create a new Access ID [**deleteAccessID**](AccessIDsApi.md#deleteAccessID) | **DELETE** /accessids/{id} | Delete Access Identifier -[**getAccessID**](AccessIDsApi.md#getAccessID) | **GET** /accessids/{id} | Get Access ID +[**getAccessID**](AccessIDsApi.md#getAccessID) | **GET** /accessids | Get Access IDs list +[**getAccessID_0**](AccessIDsApi.md#getAccessID_0) | **GET** /accessids/{id} | Get Access ID [**updateAccessID**](AccessIDsApi.md#updateAccessID) | **PUT** /accessids/{id} | Edit Access ID -# **accessidsGet** +# **createAccessID** -Get Access IDs list +Create a new Access ID ### Example ```php -$result = $client->accessIDs()->accessidsGet($xAcceptVersion, $include); +$result = $client->accessIDs()->createAccessID(); print_r($result); ``` -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] - **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type -[**\Swagger\Client\Model\AccessID[]**](../Model/AccessID.md) +[**\Swagger\Client\Model\AccessID**](../Model/AccessID.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) -# **accessidsPost** +# **deleteAccessID** -Create a new Access ID +Delete Access Identifier ### Example ```php -$result = $client->accessIDs()->accessidsPost($xAcceptVersion); -print_r($result); +$id = 56; // int | +$result = $client->accessIDs()->deleteAccessID($id); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] + **id** | **int**| | ### Return type -[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) +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) -# **deleteAccessID** +# **getAccessID** -Delete Access Identifier +Get Access IDs list ### Example ```php -$result = $client->accessIDs()->deleteAccessID($id, $xAcceptVersion); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->accessIDs()->getAccessID($include); +print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] + **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type -void (empty response body) +[**\Swagger\Client\Model\AccessID[]**](../Model/AccessID.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) -# **getAccessID** +# **getAccessID_0** Get Access ID ### Example ```php -$result = $client->accessIDs()->getAccessID($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->accessIDs()->getAccessID_0($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -106,17 +103,18 @@ Edit Access ID ### Example ```php -$result = $client->accessIDs()->updateAccessID($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body10(); // \Swagger\Client\Model\Body10 | +$result = $client->accessIDs()->updateAccessID($id, $body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body10**](../Model/Body10.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/ChannelGroupsApi.md b/docs/Api/ChannelGroupsApi.md index 950bfc0..c076ec8 100644 --- a/docs/Api/ChannelGroupsApi.md +++ b/docs/Api/ChannelGroupsApi.md @@ -16,16 +16,16 @@ Create a new channel group ### Example ```php -$result = $client->channelGroups()->createChannelGroup($body, $xAcceptVersion); +$body = new \Swagger\Client\Model\Body4(); // \Swagger\Client\Model\Body4 | +$result = $client->channelGroups()->createChannelGroup($body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\Body4**](../Model/Body4.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -39,15 +39,15 @@ Delete Channel Group ### Example ```php -$result = $client->channelGroups()->deleteChannelGroup($id, $xAcceptVersion); +$id = 56; // int | +$result = $client->channelGroups()->deleteChannelGroup($id); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -61,16 +61,17 @@ Execute action on the channel group ### Example ```php -$result = $client->channelGroups()->executeChannelGroupAction($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body6(); // \Swagger\Client\Model\Body6 | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$result = $client->channelGroups()->executeChannelGroupAction($id, $body); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body6**](../Model/Body6.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -84,16 +85,17 @@ Get channel group by ID ### Example ```php -$result = $client->channelGroups()->getChannelGroup($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->channelGroups()->getChannelGroup($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -108,15 +110,15 @@ Get channels list ### Example ```php -$result = $client->channelGroups()->getChannelGroups($xAcceptVersion, $include); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->channelGroups()->getChannelGroups($include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -131,17 +133,18 @@ Update channel group ### Example ```php -$result = $client->channelGroups()->updateChannelGroup($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body5(); // \Swagger\Client\Model\Body5 | +$result = $client->channelGroups()->updateChannelGroup($id, $body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body5**](../Model/Body5.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/ChannelsApi.md b/docs/Api/ChannelsApi.md index a50069d..3c74ef6 100644 --- a/docs/Api/ChannelsApi.md +++ b/docs/Api/ChannelsApi.md @@ -17,16 +17,17 @@ Execute action on the channel ### Example ```php -$result = $client->channels()->executeAction($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body3(); // \Swagger\Client\Model\Body3 | Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$result = $client->channels()->executeAction($id, $body); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body3**](../Model/Body3.md)| Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -40,16 +41,17 @@ Get channel by ID ### Example ```php -$result = $client->channels()->getChannel($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->channels()->getChannel($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -66,16 +68,18 @@ Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs or ### Example ```php -$result = $client->channels()->getChannelMeasurementLogs($id, $xAcceptVersion, $limit, $offset); +$id = 56; // int | +$limit = 5000; // int | Maximum items count in response, from 1 to 5000 +$offset = 56; // int | Pagination offset +$result = $client->channels()->getChannelMeasurementLogs($id, $limit, $offset); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **limit** | **int**| Maximum items count in response, from 1 to 5000 | [optional] [default to 5000] **offset** | **int**| Pagination offset | [optional] @@ -93,16 +97,16 @@ Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs or ### Example ```php -$result = $client->channels()->getChannelMeasurementLogsCsvFile($id, $xAcceptVersion); +$id = 56; // int | +$result = $client->channels()->getChannelMeasurementLogsCsvFile($id); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -116,16 +120,17 @@ Get schedules list of the channel ### Example ```php -$result = $client->channels()->getChannelSchedules($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->channels()->getChannelSchedules($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -140,15 +145,18 @@ Get channels list ### Example ```php -$result = $client->channels()->getChannels($xAcceptVersion, $include, $function, $io, $hasFunction); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$function = array("function_example"); // string[] | +$io = "io_example"; // string | Return only `input` or `output` channels. +$hasFunction = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. +$result = $client->channels()->getChannels($include, $function, $io, $hasFunction); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] **function** | [**string[]**](../Model/string.md)| | [optional] **io** | **string**| Return only `input` or `output` channels. | [optional] @@ -166,17 +174,18 @@ Update channel ### Example ```php -$result = $client->channels()->updateChannel($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body2(); // \Swagger\Client\Model\Body2 | +$result = $client->channels()->updateChannel($id, $body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body2**](../Model/Body2.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/ClientAppsApi.md b/docs/Api/ClientAppsApi.md index 138275c..4a5016a 100644 --- a/docs/Api/ClientAppsApi.md +++ b/docs/Api/ClientAppsApi.md @@ -13,15 +13,15 @@ Delete Client App ### Example ```php -$result = $client->clientApps()->deleteClientApp($id, $xAcceptVersion); +$id = 56; // int | +$result = $client->clientApps()->deleteClientApp($id); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -35,15 +35,15 @@ Get client apps ### Example ```php -$result = $client->clientApps()->getClientApps($xAcceptVersion, $include); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->clientApps()->getClientApps($include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -58,17 +58,18 @@ Update client app ### Example ```php -$result = $client->clientApps()->updateClientApp($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body7(); // \Swagger\Client\Model\Body7 | +$result = $client->clientApps()->updateClientApp($id, $body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body7**](../Model/Body7.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/IODevicesApi.md b/docs/Api/IODevicesApi.md index 93dc068..77a538d 100644 --- a/docs/Api/IODevicesApi.md +++ b/docs/Api/IODevicesApi.md @@ -15,15 +15,15 @@ Delete IO Device ### Example ```php -$result = $client->iODevices()->deleteIoDevice($id, $xAcceptVersion); +$id = 56; // int | +$result = $client->iODevices()->deleteIoDevice($id); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -37,16 +37,17 @@ Get IO Device ### Example ```php -$result = $client->iODevices()->getIoDevice($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->iODevices()->getIoDevice($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -61,16 +62,17 @@ Get Channels that belong to IO Deice ### Example ```php -$result = $client->iODevices()->getIoDeviceChannels($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->iODevices()->getIoDeviceChannels($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -85,15 +87,15 @@ Get IO Devices ### Example ```php -$result = $client->iODevices()->getIoDevices($xAcceptVersion, $include); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->iODevices()->getIoDevices($include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -108,17 +110,18 @@ Update IO Device ### Example ```php -$result = $client->iODevices()->updateIoDevice($id, $body, $xAcceptVersion); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body8(); // \Swagger\Client\Model\Body8 | +$result = $client->iODevices()->updateIoDevice($id, $body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body8**](../Model/Body8.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/LocationsApi.md b/docs/Api/LocationsApi.md index 3c09aa6..cb4c19b 100644 --- a/docs/Api/LocationsApi.md +++ b/docs/Api/LocationsApi.md @@ -15,15 +15,11 @@ Create a new location ### Example ```php -$result = $client->locations()->createLocation($xAcceptVersion); +$result = $client->locations()->createLocation(); print_r($result); ``` -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -37,15 +33,16 @@ Delete location ### Example ```php -$result = $client->locations()->deleteLocation($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->locations()->deleteLocation($id, $include); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -60,16 +57,17 @@ Get location by ID ### Example ```php -$result = $client->locations()->getLocation($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->locations()->getLocation($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -84,15 +82,15 @@ Get locations list ### Example ```php -$result = $client->locations()->getLocations($xAcceptVersion, $include); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->locations()->getLocations($include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -107,17 +105,19 @@ Edit location ### Example ```php -$result = $client->locations()->updateLocation($id, $body, $xAcceptVersion, $include); +$id = 56; // int | +$body = new \Swagger\Client\Model\Body1(); // \Swagger\Client\Model\Body1 | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->locations()->updateLocation($id, $body, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\Body1**](../Model/Body1.md)| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type diff --git a/docs/Api/SchedulesApi.md b/docs/Api/SchedulesApi.md index 766cadd..ca92bbb 100644 --- a/docs/Api/SchedulesApi.md +++ b/docs/Api/SchedulesApi.md @@ -16,16 +16,16 @@ Create a new schedule ### Example ```php -$result = $client->schedules()->createSchedule($body, $xAcceptVersion); +$body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | +$result = $client->schedules()->createSchedule($body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\ScheduleRequest**](../Model/ScheduleRequest.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -39,15 +39,15 @@ Delete Schedule ### Example ```php -$result = $client->schedules()->deleteSchedule($id, $xAcceptVersion); +$id = 56; // int | +$result = $client->schedules()->deleteSchedule($id); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -61,15 +61,15 @@ Enable schedules ### Example ```php -$result = $client->schedules()->enableSchedules($body, $xAcceptVersion); +$body = new \Swagger\Client\Model\Body9(); // \Swagger\Client\Model\Body9 | +$result = $client->schedules()->enableSchedules($body); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\Body9**](../Model/Body9.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -83,16 +83,17 @@ Get Schedule ### Example ```php -$result = $client->schedules()->getSchedule($id, $xAcceptVersion, $include); +$id = 56; // int | +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->schedules()->getSchedule($id, $include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -107,15 +108,15 @@ Get schedules list ### Example ```php -$result = $client->schedules()->getSchedules($xAcceptVersion, $include); +$include = array("include_example"); // string[] | Specify what extra fields to include in the response. +$result = $client->schedules()->getSchedules($include); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type @@ -130,17 +131,19 @@ Update schedule ### Example ```php -$result = $client->schedules()->updateSchedule($id, $body, $xAcceptVersion, $enable); +$id = 56; // int | +$body = new \Swagger\Client\Model\ScheduleRequest(); // \Swagger\Client\Model\ScheduleRequest | +$enable = true; // bool | Set to `true` to enable the schedule after saving. +$result = $client->schedules()->updateSchedule($id, $body, $enable); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **body** | [**\Swagger\Client\Model\ScheduleRequest**](../Model/ScheduleRequest.md)| | - **xAcceptVersion** | **string**| API Version | [optional] **enable** | **bool**| Set to `true` to enable the schedule after saving. | [optional] ### Return type diff --git a/docs/Api/ServerApi.md b/docs/Api/ServerApi.md index 5c6973a..5346a9f 100644 --- a/docs/Api/ServerApi.md +++ b/docs/Api/ServerApi.md @@ -12,15 +12,11 @@ Get server status ### Example ```php -$result = $client->server()->serverInfoGet($xAcceptVersion); +$result = $client->server()->serverInfoGet(); print_r($result); ``` -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -34,15 +30,11 @@ Get the SUPLA Server status ### Example ```php -$result = $client->server()->serverStatusGet($xAcceptVersion); +$result = $client->server()->serverStatusGet(); print_r($result); ``` -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md index b2f1c19..b2d6523 100644 --- a/docs/Api/UsersApi.md +++ b/docs/Api/UsersApi.md @@ -12,16 +12,16 @@ Edit current user ### Example ```php -$result = $client->users()->editCurrentUser($body, $xAcceptVersion); +$body = new \Swagger\Client\Model\Body(); // \Swagger\Client\Model\Body | +$result = $client->users()->editCurrentUser($body); print_r($result); ``` -### Parameters +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\Swagger\Client\Model\Body**](../Model/Body.md)| | - **xAcceptVersion** | **string**| API Version | [optional] ### Return type @@ -35,15 +35,11 @@ Get current user ### Example ```php -$result = $client->users()->getCurrentUser($xAcceptVersion); +$result = $client->users()->getCurrentUser(); print_r($result); ``` -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAcceptVersion** | **string**| API Version | [optional] ### Return type diff --git a/docs/Model/Channel.md b/docs/Model/Channel.md index 7d25575..7bd4b88 100644 --- a/docs/Model/Channel.md +++ b/docs/Model/Channel.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **param3** | [**\Swagger\Client\Model\ChannelParam**](ChannelParam.md) | | [optional] **altIcon** | **int** | Chosen alternative icon idenifier. Should not be greater than `funciton.maxAlternativeIconIndex` | [optional] **hidden** | **bool** | Whether this channel is shown on client apps or not | [optional] -**inheritedLocation** | **bool** | Whether this channel inherits its IODevice's location (`true`) or not (`false`) | [optional] +**inheritedLocation** | **bool** | Whether this channel inherits its IO Device's location (`true`) or not (`false`) | [optional] **iodeviceId** | **int** | | [optional] **locationId** | **int** | | [optional] **functionId** | **int** | | [optional] diff --git a/lib/Api/AccessIDsApi.php b/lib/Api/AccessIDsApi.php index aa6f491..39ae9d1 100644 --- a/lib/Api/AccessIDsApi.php +++ b/lib/Api/AccessIDsApi.php @@ -88,39 +88,35 @@ public function getConfig() } /** - * Operation accessidsGet + * Operation createAccessID * - * Get Access IDs list + * Create a new Access ID * - * @param string $xAcceptVersion API Version (optional) - * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AccessID[] + * @return \Swagger\Client\Model\AccessID */ - public function accessidsGet($xAcceptVersion = null, $include = null) + public function createAccessID() { - list($response) = $this->accessidsGetWithHttpInfo($xAcceptVersion, $include); + list($response) = $this->createAccessIDWithHttpInfo(); return $response; } /** - * Operation accessidsGetWithHttpInfo + * Operation createAccessIDWithHttpInfo * - * Get Access IDs list + * Create a new Access ID * - * @param string $xAcceptVersion API Version (optional) - * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AccessID[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) */ - public function accessidsGetWithHttpInfo($xAcceptVersion = null, $include = null) + public function createAccessIDWithHttpInfo() { - $returnType = '\Swagger\Client\Model\AccessID[]'; - $request = $this->accessidsGetRequest($xAcceptVersion, $include); + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->createAccessIDRequest(); try { $options = $this->createHttpClientOption(); @@ -168,10 +164,10 @@ public function accessidsGetWithHttpInfo($xAcceptVersion = null, $include = null } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\AccessID[]', + '\Swagger\Client\Model\AccessID', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -182,19 +178,17 @@ public function accessidsGetWithHttpInfo($xAcceptVersion = null, $include = null } /** - * Operation accessidsGetAsync + * Operation createAccessIDAsync * - * Get Access IDs list + * Create a new Access ID * - * @param string $xAcceptVersion API Version (optional) - * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsGetAsync($xAcceptVersion = null, $include = null) + public function createAccessIDAsync() { - return $this->accessidsGetAsyncWithHttpInfo($xAcceptVersion, $include) + return $this->createAccessIDAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -203,20 +197,18 @@ function ($response) { } /** - * Operation accessidsGetAsyncWithHttpInfo + * Operation createAccessIDAsyncWithHttpInfo * - * Get Access IDs list + * Create a new Access ID * - * @param string $xAcceptVersion API Version (optional) - * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsGetAsyncWithHttpInfo($xAcceptVersion = null, $include = null) + public function createAccessIDAsyncWithHttpInfo() { - $returnType = '\Swagger\Client\Model\AccessID[]'; - $request = $this->accessidsGetRequest($xAcceptVersion, $include); + $returnType = '\Swagger\Client\Model\AccessID'; + $request = $this->createAccessIDRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,15 +248,13 @@ function ($exception) { } /** - * Create request for operation 'accessidsGet' + * Create request for operation 'createAccessID' * - * @param string $xAcceptVersion API Version (optional) - * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function accessidsGetRequest($xAcceptVersion = null, $include = null) + protected function createAccessIDRequest() { $resourcePath = '/accessids'; @@ -274,17 +264,6 @@ protected function accessidsGetRequest($xAcceptVersion = null, $include = null) $httpBody = ''; $multipart = false; - // query params - if (is_array($include)) { - $include = ObjectSerializer::serializeCollection($include, 'csv', true); - } - if ($include !== null) { - $queryParams['include'] = ObjectSerializer::toQueryValue($include); - } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -348,7 +327,7 @@ protected function accessidsGetRequest($xAcceptVersion = null, $include = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -356,37 +335,36 @@ protected function accessidsGetRequest($xAcceptVersion = null, $include = null) } /** - * Operation accessidsPost + * Operation deleteAccessID * - * Create a new Access ID + * Delete Access Identifier * - * @param string $xAcceptVersion API Version (optional) + * @param int $id id (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AccessID + * @return void */ - public function accessidsPost($xAcceptVersion = null) + public function deleteAccessID($id) { - list($response) = $this->accessidsPostWithHttpInfo($xAcceptVersion); - return $response; + $this->deleteAccessIDWithHttpInfo($id); } /** - * Operation accessidsPostWithHttpInfo + * Operation deleteAccessIDWithHttpInfo * - * Create a new Access ID + * Delete Access Identifier * - * @param string $xAcceptVersion API Version (optional) + * @param int $id (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function accessidsPostWithHttpInfo($xAcceptVersion = null) + public function deleteAccessIDWithHttpInfo($id) { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->accessidsPostRequest($xAcceptVersion); + $returnType = ''; + $request = $this->deleteAccessIDRequest($id); try { $options = $this->createHttpClientOption(); @@ -416,50 +394,28 @@ public function accessidsPostWithHttpInfo($xAcceptVersion = null) ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Swagger\Client\Model\AccessID', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation accessidsPostAsync + * Operation deleteAccessIDAsync * - * Create a new Access ID + * Delete Access Identifier * - * @param string $xAcceptVersion API Version (optional) + * @param int $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsPostAsync($xAcceptVersion = null) + public function deleteAccessIDAsync($id) { - return $this->accessidsPostAsyncWithHttpInfo($xAcceptVersion) + return $this->deleteAccessIDAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -468,39 +424,25 @@ function ($response) { } /** - * Operation accessidsPostAsyncWithHttpInfo + * Operation deleteAccessIDAsyncWithHttpInfo * - * Create a new Access ID + * Delete Access Identifier * - * @param string $xAcceptVersion API Version (optional) + * @param int $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function accessidsPostAsyncWithHttpInfo($xAcceptVersion = null) + public function deleteAccessIDAsyncWithHttpInfo($id) { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->accessidsPostRequest($xAcceptVersion); + $returnType = ''; + $request = $this->deleteAccessIDRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -520,28 +462,38 @@ function ($exception) { } /** - * Create request for operation 'accessidsPost' + * Create request for operation 'deleteAccessID' * - * @param string $xAcceptVersion API Version (optional) + * @param int $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function accessidsPostRequest($xAcceptVersion = null) + protected function deleteAccessIDRequest($id) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteAccessID' + ); + } - $resourcePath = '/accessids'; + $resourcePath = '/accessids/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; @@ -604,7 +556,7 @@ protected function accessidsPostRequest($xAcceptVersion = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -612,38 +564,37 @@ protected function accessidsPostRequest($xAcceptVersion = null) } /** - * Operation deleteAccessID + * Operation getAccessID * - * Delete Access Identifier + * Get Access IDs list * - * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Swagger\Client\Model\AccessID[] */ - public function deleteAccessID($id, $xAcceptVersion = null) + public function getAccessID($include = null) { - $this->deleteAccessIDWithHttpInfo($id, $xAcceptVersion); + list($response) = $this->getAccessIDWithHttpInfo($include); + return $response; } /** - * Operation deleteAccessIDWithHttpInfo + * Operation getAccessIDWithHttpInfo * - * Delete Access Identifier + * Get Access IDs list * - * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\AccessID[], HTTP status code, HTTP response headers (array of strings) */ - public function deleteAccessIDWithHttpInfo($id, $xAcceptVersion = null) + public function getAccessIDWithHttpInfo($include = null) { - $returnType = ''; - $request = $this->deleteAccessIDRequest($id, $xAcceptVersion); + $returnType = '\Swagger\Client\Model\AccessID[]'; + $request = $this->getAccessIDRequest($include); try { $options = $this->createHttpClientOption(); @@ -673,29 +624,50 @@ public function deleteAccessIDWithHttpInfo($id, $xAcceptVersion = null) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\AccessID[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteAccessIDAsync + * Operation getAccessIDAsync * - * Delete Access Identifier + * Get Access IDs list * - * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccessIDAsync($id, $xAcceptVersion = null) + public function getAccessIDAsync($include = null) { - return $this->deleteAccessIDAsyncWithHttpInfo($id, $xAcceptVersion) + return $this->getAccessIDAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -704,26 +676,39 @@ function ($response) { } /** - * Operation deleteAccessIDAsyncWithHttpInfo + * Operation getAccessIDAsyncWithHttpInfo * - * Delete Access Identifier + * Get Access IDs list * - * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccessIDAsyncWithHttpInfo($id, $xAcceptVersion = null) + public function getAccessIDAsyncWithHttpInfo($include = null) { - $returnType = ''; - $request = $this->deleteAccessIDRequest($id, $xAcceptVersion); + $returnType = '\Swagger\Client\Model\AccessID[]'; + $request = $this->getAccessIDRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -743,44 +728,32 @@ function ($exception) { } /** - * Create request for operation 'deleteAccessID' + * Create request for operation 'getAccessID' * - * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) + * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAccessIDRequest($id, $xAcceptVersion = null) + protected function getAccessIDRequest($include = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteAccessID' - ); - } - $resourcePath = '/accessids/{id}'; + $resourcePath = '/accessids'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); + // query params + if (is_array($include)) { + $include = ObjectSerializer::serializeCollection($include, 'csv', true); } - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); + if ($include !== null) { + $queryParams['include'] = ObjectSerializer::toQueryValue($include); } + // body params $_tempBody = null; @@ -842,7 +815,7 @@ protected function deleteAccessIDRequest($id, $xAcceptVersion = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -850,41 +823,39 @@ protected function deleteAccessIDRequest($id, $xAcceptVersion = null) } /** - * Operation getAccessID + * Operation getAccessID_0 * * Get Access ID * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\AccessID */ - public function getAccessID($id, $xAcceptVersion = null, $include = null) + public function getAccessID_0($id, $include = null) { - list($response) = $this->getAccessIDWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getAccessID_0WithHttpInfo($id, $include); return $response; } /** - * Operation getAccessIDWithHttpInfo + * Operation getAccessID_0WithHttpInfo * * Get Access ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) */ - public function getAccessIDWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getAccessID_0WithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->getAccessIDRequest($id, $xAcceptVersion, $include); + $request = $this->getAccessID_0Request($id, $include); try { $options = $this->createHttpClientOption(); @@ -946,20 +917,19 @@ public function getAccessIDWithHttpInfo($id, $xAcceptVersion = null, $include = } /** - * Operation getAccessIDAsync + * Operation getAccessID_0Async * * Get Access ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessIDAsync($id, $xAcceptVersion = null, $include = null) + public function getAccessID_0Async($id, $include = null) { - return $this->getAccessIDAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getAccessID_0AsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -968,21 +938,20 @@ function ($response) { } /** - * Operation getAccessIDAsyncWithHttpInfo + * Operation getAccessID_0AsyncWithHttpInfo * * Get Access ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessIDAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getAccessID_0AsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->getAccessIDRequest($id, $xAcceptVersion, $include); + $request = $this->getAccessID_0Request($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1022,21 +991,20 @@ function ($exception) { } /** - * Create request for operation 'getAccessID' + * Create request for operation 'getAccessID_0' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccessIDRequest($id, $xAcceptVersion = null, $include = null) + protected function getAccessID_0Request($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getAccessID' + 'Missing the required parameter $id when calling getAccessID_0' ); } @@ -1054,10 +1022,6 @@ protected function getAccessIDRequest($id, $xAcceptVersion = null, $include = nu if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -1143,15 +1107,14 @@ protected function getAccessIDRequest($id, $xAcceptVersion = null, $include = nu * * @param int $id id (required) * @param \Swagger\Client\Model\Body10 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\AccessID */ - public function updateAccessID($id, $body, $xAcceptVersion = null) + public function updateAccessID($id, $body) { - list($response) = $this->updateAccessIDWithHttpInfo($id, $body, $xAcceptVersion); + list($response) = $this->updateAccessIDWithHttpInfo($id, $body); return $response; } @@ -1162,16 +1125,15 @@ public function updateAccessID($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) */ - public function updateAccessIDWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateAccessIDWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->updateAccessIDRequest($id, $body, $xAcceptVersion); + $request = $this->updateAccessIDRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -1239,14 +1201,13 @@ public function updateAccessIDWithHttpInfo($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccessIDAsync($id, $body, $xAcceptVersion = null) + public function updateAccessIDAsync($id, $body) { - return $this->updateAccessIDAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->updateAccessIDAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -1261,15 +1222,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccessIDAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateAccessIDAsyncWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->updateAccessIDRequest($id, $body, $xAcceptVersion); + $request = $this->updateAccessIDRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1313,12 +1273,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body10 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAccessIDRequest($id, $body, $xAcceptVersion = null) + protected function updateAccessIDRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1340,10 +1299,6 @@ protected function updateAccessIDRequest($id, $body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/ChannelGroupsApi.php b/lib/Api/ChannelGroupsApi.php index 52068a7..af142eb 100644 --- a/lib/Api/ChannelGroupsApi.php +++ b/lib/Api/ChannelGroupsApi.php @@ -93,15 +93,14 @@ public function getConfig() * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup */ - public function createChannelGroup($body, $xAcceptVersion = null) + public function createChannelGroup($body) { - list($response) = $this->createChannelGroupWithHttpInfo($body, $xAcceptVersion); + list($response) = $this->createChannelGroupWithHttpInfo($body); return $response; } @@ -111,16 +110,15 @@ public function createChannelGroup($body, $xAcceptVersion = null) * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) */ - public function createChannelGroupWithHttpInfo($body, $xAcceptVersion = null) + public function createChannelGroupWithHttpInfo($body) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->createChannelGroupRequest($body, $xAcceptVersion); + $request = $this->createChannelGroupRequest($body); try { $options = $this->createHttpClientOption(); @@ -187,14 +185,13 @@ public function createChannelGroupWithHttpInfo($body, $xAcceptVersion = null) * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChannelGroupAsync($body, $xAcceptVersion = null) + public function createChannelGroupAsync($body) { - return $this->createChannelGroupAsyncWithHttpInfo($body, $xAcceptVersion) + return $this->createChannelGroupAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -208,15 +205,14 @@ function ($response) { * Create a new channel group * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChannelGroupAsyncWithHttpInfo($body, $xAcceptVersion = null) + public function createChannelGroupAsyncWithHttpInfo($body) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->createChannelGroupRequest($body, $xAcceptVersion); + $request = $this->createChannelGroupRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -259,12 +255,11 @@ function ($exception) { * Create request for operation 'createChannelGroup' * * @param \Swagger\Client\Model\Body4 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createChannelGroupRequest($body, $xAcceptVersion = null) + protected function createChannelGroupRequest($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { @@ -280,10 +275,6 @@ protected function createChannelGroupRequest($body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -363,15 +354,14 @@ protected function createChannelGroupRequest($body, $xAcceptVersion = null) * Delete Channel Group * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteChannelGroup($id, $xAcceptVersion = null) + public function deleteChannelGroup($id) { - $this->deleteChannelGroupWithHttpInfo($id, $xAcceptVersion); + $this->deleteChannelGroupWithHttpInfo($id); } /** @@ -380,16 +370,15 @@ public function deleteChannelGroup($id, $xAcceptVersion = null) * Delete Channel Group * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteChannelGroupWithHttpInfo($id, $xAcceptVersion = null) + public function deleteChannelGroupWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteChannelGroupRequest($id, $xAcceptVersion); + $request = $this->deleteChannelGroupRequest($id); try { $options = $this->createHttpClientOption(); @@ -434,14 +423,13 @@ public function deleteChannelGroupWithHttpInfo($id, $xAcceptVersion = null) * Delete Channel Group * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteChannelGroupAsync($id, $xAcceptVersion = null) + public function deleteChannelGroupAsync($id) { - return $this->deleteChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion) + return $this->deleteChannelGroupAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -455,15 +443,14 @@ function ($response) { * Delete Channel Group * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion = null) + public function deleteChannelGroupAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteChannelGroupRequest($id, $xAcceptVersion); + $request = $this->deleteChannelGroupRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -492,12 +479,11 @@ function ($exception) { * Create request for operation 'deleteChannelGroup' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteChannelGroupRequest($id, $xAcceptVersion = null) + protected function deleteChannelGroupRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -513,10 +499,6 @@ protected function deleteChannelGroupRequest($id, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -602,15 +584,14 @@ protected function deleteChannelGroupRequest($id, $xAcceptVersion = null) * * @param int $id id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function executeChannelGroupAction($id, $body, $xAcceptVersion = null) + public function executeChannelGroupAction($id, $body) { - $this->executeChannelGroupActionWithHttpInfo($id, $body, $xAcceptVersion); + $this->executeChannelGroupActionWithHttpInfo($id, $body); } /** @@ -620,16 +601,15 @@ public function executeChannelGroupAction($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function executeChannelGroupActionWithHttpInfo($id, $body, $xAcceptVersion = null) + public function executeChannelGroupActionWithHttpInfo($id, $body) { $returnType = ''; - $request = $this->executeChannelGroupActionRequest($id, $body, $xAcceptVersion); + $request = $this->executeChannelGroupActionRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -683,14 +663,13 @@ public function executeChannelGroupActionWithHttpInfo($id, $body, $xAcceptVersio * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeChannelGroupActionAsync($id, $body, $xAcceptVersion = null) + public function executeChannelGroupActionAsync($id, $body) { - return $this->executeChannelGroupActionAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->executeChannelGroupActionAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -705,15 +684,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeChannelGroupActionAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function executeChannelGroupActionAsyncWithHttpInfo($id, $body) { $returnType = ''; - $request = $this->executeChannelGroupActionRequest($id, $body, $xAcceptVersion); + $request = $this->executeChannelGroupActionRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -743,12 +721,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function executeChannelGroupActionRequest($id, $body, $xAcceptVersion = null) + protected function executeChannelGroupActionRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -770,10 +747,6 @@ protected function executeChannelGroupActionRequest($id, $body, $xAcceptVersion $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -861,16 +834,15 @@ protected function executeChannelGroupActionRequest($id, $body, $xAcceptVersion * Get channel group by ID * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup */ - public function getChannelGroup($id, $xAcceptVersion = null, $include = null) + public function getChannelGroup($id, $include = null) { - list($response) = $this->getChannelGroupWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getChannelGroupWithHttpInfo($id, $include); return $response; } @@ -880,17 +852,16 @@ public function getChannelGroup($id, $xAcceptVersion = null, $include = null) * Get channel group by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) */ - public function getChannelGroupWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getChannelGroupWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->getChannelGroupRequest($id, $xAcceptVersion, $include); + $request = $this->getChannelGroupRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -957,15 +928,14 @@ public function getChannelGroupWithHttpInfo($id, $xAcceptVersion = null, $includ * Get channel group by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupAsync($id, $xAcceptVersion = null, $include = null) + public function getChannelGroupAsync($id, $include = null) { - return $this->getChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getChannelGroupAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -979,16 +949,15 @@ function ($response) { * Get channel group by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getChannelGroupAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->getChannelGroupRequest($id, $xAcceptVersion, $include); + $request = $this->getChannelGroupRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1031,13 +1000,12 @@ function ($exception) { * Create request for operation 'getChannelGroup' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelGroupRequest($id, $xAcceptVersion = null, $include = null) + protected function getChannelGroupRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1060,10 +1028,6 @@ protected function getChannelGroupRequest($id, $xAcceptVersion = null, $include if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -1147,16 +1111,15 @@ protected function getChannelGroupRequest($id, $xAcceptVersion = null, $include * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup[] */ - public function getChannelGroups($xAcceptVersion = null, $include = null) + public function getChannelGroups($include = null) { - list($response) = $this->getChannelGroupsWithHttpInfo($xAcceptVersion, $include); + list($response) = $this->getChannelGroupsWithHttpInfo($include); return $response; } @@ -1165,17 +1128,16 @@ public function getChannelGroups($xAcceptVersion = null, $include = null) * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelGroupsWithHttpInfo($xAcceptVersion = null, $include = null) + public function getChannelGroupsWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup[]'; - $request = $this->getChannelGroupsRequest($xAcceptVersion, $include); + $request = $this->getChannelGroupsRequest($include); try { $options = $this->createHttpClientOption(); @@ -1241,15 +1203,14 @@ public function getChannelGroupsWithHttpInfo($xAcceptVersion = null, $include = * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupsAsync($xAcceptVersion = null, $include = null) + public function getChannelGroupsAsync($include = null) { - return $this->getChannelGroupsAsyncWithHttpInfo($xAcceptVersion, $include) + return $this->getChannelGroupsAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -1262,16 +1223,15 @@ function ($response) { * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelGroupsAsyncWithHttpInfo($xAcceptVersion = null, $include = null) + public function getChannelGroupsAsyncWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\ChannelGroup[]'; - $request = $this->getChannelGroupsRequest($xAcceptVersion, $include); + $request = $this->getChannelGroupsRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1313,13 +1273,12 @@ function ($exception) { /** * Create request for operation 'getChannelGroups' * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelGroupsRequest($xAcceptVersion = null, $include = null) + protected function getChannelGroupsRequest($include = null) { $resourcePath = '/channel-groups'; @@ -1336,10 +1295,6 @@ protected function getChannelGroupsRequest($xAcceptVersion = null, $include = nu if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -1417,15 +1372,14 @@ protected function getChannelGroupsRequest($xAcceptVersion = null, $include = nu * * @param int $id id (required) * @param \Swagger\Client\Model\Body5 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ChannelGroup */ - public function updateChannelGroup($id, $body, $xAcceptVersion = null) + public function updateChannelGroup($id, $body) { - list($response) = $this->updateChannelGroupWithHttpInfo($id, $body, $xAcceptVersion); + list($response) = $this->updateChannelGroupWithHttpInfo($id, $body); return $response; } @@ -1436,16 +1390,15 @@ public function updateChannelGroup($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ChannelGroup, HTTP status code, HTTP response headers (array of strings) */ - public function updateChannelGroupWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateChannelGroupWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->updateChannelGroupRequest($id, $body, $xAcceptVersion); + $request = $this->updateChannelGroupRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -1513,14 +1466,13 @@ public function updateChannelGroupWithHttpInfo($id, $body, $xAcceptVersion = nul * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelGroupAsync($id, $body, $xAcceptVersion = null) + public function updateChannelGroupAsync($id, $body) { - return $this->updateChannelGroupAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->updateChannelGroupAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -1535,15 +1487,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelGroupAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateChannelGroupAsyncWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\ChannelGroup'; - $request = $this->updateChannelGroupRequest($id, $body, $xAcceptVersion); + $request = $this->updateChannelGroupRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1587,12 +1538,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body5 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateChannelGroupRequest($id, $body, $xAcceptVersion = null) + protected function updateChannelGroupRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1614,10 +1564,6 @@ protected function updateChannelGroupRequest($id, $body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/ChannelsApi.php b/lib/Api/ChannelsApi.php index b94c3f8..1e70536 100644 --- a/lib/Api/ChannelsApi.php +++ b/lib/Api/ChannelsApi.php @@ -94,15 +94,14 @@ public function getConfig() * * @param int $id id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function executeAction($id, $body, $xAcceptVersion = null) + public function executeAction($id, $body) { - $this->executeActionWithHttpInfo($id, $body, $xAcceptVersion); + $this->executeActionWithHttpInfo($id, $body); } /** @@ -112,16 +111,15 @@ public function executeAction($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function executeActionWithHttpInfo($id, $body, $xAcceptVersion = null) + public function executeActionWithHttpInfo($id, $body) { $returnType = ''; - $request = $this->executeActionRequest($id, $body, $xAcceptVersion); + $request = $this->executeActionRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -175,14 +173,13 @@ public function executeActionWithHttpInfo($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeActionAsync($id, $body, $xAcceptVersion = null) + public function executeActionAsync($id, $body) { - return $this->executeActionAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->executeActionAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -197,15 +194,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function executeActionAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function executeActionAsyncWithHttpInfo($id, $body) { $returnType = ''; - $request = $this->executeActionRequest($id, $body, $xAcceptVersion); + $request = $this->executeActionRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -235,12 +231,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function executeActionRequest($id, $body, $xAcceptVersion = null) + protected function executeActionRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -262,10 +257,6 @@ protected function executeActionRequest($id, $body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -353,16 +344,15 @@ protected function executeActionRequest($id, $body, $xAcceptVersion = null) * Get channel by ID * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel */ - public function getChannel($id, $xAcceptVersion = null, $include = null) + public function getChannel($id, $include = null) { - list($response) = $this->getChannelWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getChannelWithHttpInfo($id, $include); return $response; } @@ -372,17 +362,16 @@ public function getChannel($id, $xAcceptVersion = null, $include = null) * Get channel by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) */ - public function getChannelWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getChannelWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getChannelRequest($id, $xAcceptVersion, $include); + $request = $this->getChannelRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -449,15 +438,14 @@ public function getChannelWithHttpInfo($id, $xAcceptVersion = null, $include = n * Get channel by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelAsync($id, $xAcceptVersion = null, $include = null) + public function getChannelAsync($id, $include = null) { - return $this->getChannelAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getChannelAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -471,16 +459,15 @@ function ($response) { * Get channel by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getChannelAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getChannelRequest($id, $xAcceptVersion, $include); + $request = $this->getChannelRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -523,13 +510,12 @@ function ($exception) { * Create request for operation 'getChannel' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelRequest($id, $xAcceptVersion = null, $include = null) + protected function getChannelRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -552,10 +538,6 @@ protected function getChannelRequest($id, $xAcceptVersion = null, $include = nul if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -640,7 +622,6 @@ protected function getChannelRequest($id, $xAcceptVersion = null, $include = nul * Get measurement logs. * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * @@ -648,9 +629,9 @@ protected function getChannelRequest($id, $xAcceptVersion = null, $include = nul * @throws \InvalidArgumentException * @return \Swagger\Client\Model\InlineResponse2003[] */ - public function getChannelMeasurementLogs($id, $xAcceptVersion = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogs($id, $limit = '5000', $offset = null) { - list($response) = $this->getChannelMeasurementLogsWithHttpInfo($id, $xAcceptVersion, $limit, $offset); + list($response) = $this->getChannelMeasurementLogsWithHttpInfo($id, $limit, $offset); return $response; } @@ -660,7 +641,6 @@ public function getChannelMeasurementLogs($id, $xAcceptVersion = null, $limit = * Get measurement logs. * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * @@ -668,10 +648,10 @@ public function getChannelMeasurementLogs($id, $xAcceptVersion = null, $limit = * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\InlineResponse2003[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelMeasurementLogsWithHttpInfo($id, $xAcceptVersion = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogsWithHttpInfo($id, $limit = '5000', $offset = null) { $returnType = '\Swagger\Client\Model\InlineResponse2003[]'; - $request = $this->getChannelMeasurementLogsRequest($id, $xAcceptVersion, $limit, $offset); + $request = $this->getChannelMeasurementLogsRequest($id, $limit, $offset); try { $options = $this->createHttpClientOption(); @@ -746,16 +726,15 @@ public function getChannelMeasurementLogsWithHttpInfo($id, $xAcceptVersion = nul * Get measurement logs. * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsAsync($id, $xAcceptVersion = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogsAsync($id, $limit = '5000', $offset = null) { - return $this->getChannelMeasurementLogsAsyncWithHttpInfo($id, $xAcceptVersion, $limit, $offset) + return $this->getChannelMeasurementLogsAsyncWithHttpInfo($id, $limit, $offset) ->then( function ($response) { return $response[0]; @@ -769,17 +748,16 @@ function ($response) { * Get measurement logs. * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsAsyncWithHttpInfo($id, $xAcceptVersion = null, $limit = '5000', $offset = null) + public function getChannelMeasurementLogsAsyncWithHttpInfo($id, $limit = '5000', $offset = null) { $returnType = '\Swagger\Client\Model\InlineResponse2003[]'; - $request = $this->getChannelMeasurementLogsRequest($id, $xAcceptVersion, $limit, $offset); + $request = $this->getChannelMeasurementLogsRequest($id, $limit, $offset); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -822,14 +800,13 @@ function ($exception) { * Create request for operation 'getChannelMeasurementLogs' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param int $limit Maximum items count in response, from 1 to 5000 (optional, default to 5000) * @param int $offset Pagination offset (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelMeasurementLogsRequest($id, $xAcceptVersion = null, $limit = '5000', $offset = null) + protected function getChannelMeasurementLogsRequest($id, $limit = '5000', $offset = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -853,10 +830,6 @@ protected function getChannelMeasurementLogsRequest($id, $xAcceptVersion = null, if ($offset !== null) { $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -941,15 +914,14 @@ protected function getChannelMeasurementLogsRequest($id, $xAcceptVersion = null, * Get measurement logs as zipped CSV file. * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \SplFileObject */ - public function getChannelMeasurementLogsCsvFile($id, $xAcceptVersion = null) + public function getChannelMeasurementLogsCsvFile($id) { - list($response) = $this->getChannelMeasurementLogsCsvFileWithHttpInfo($id, $xAcceptVersion); + list($response) = $this->getChannelMeasurementLogsCsvFileWithHttpInfo($id); return $response; } @@ -959,16 +931,15 @@ public function getChannelMeasurementLogsCsvFile($id, $xAcceptVersion = null) * Get measurement logs as zipped CSV file. * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $xAcceptVersion = null) + public function getChannelMeasurementLogsCsvFileWithHttpInfo($id) { $returnType = '\SplFileObject'; - $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion); + $request = $this->getChannelMeasurementLogsCsvFileRequest($id); try { $options = $this->createHttpClientOption(); @@ -1043,14 +1014,13 @@ public function getChannelMeasurementLogsCsvFileWithHttpInfo($id, $xAcceptVersio * Get measurement logs as zipped CSV file. * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsCsvFileAsync($id, $xAcceptVersion = null) + public function getChannelMeasurementLogsCsvFileAsync($id) { - return $this->getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $xAcceptVersion) + return $this->getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -1064,15 +1034,14 @@ function ($response) { * Get measurement logs as zipped CSV file. * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id, $xAcceptVersion = null) + public function getChannelMeasurementLogsCsvFileAsyncWithHttpInfo($id) { $returnType = '\SplFileObject'; - $request = $this->getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion); + $request = $this->getChannelMeasurementLogsCsvFileRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1115,12 +1084,11 @@ function ($exception) { * Create request for operation 'getChannelMeasurementLogsCsvFile' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion = null) + protected function getChannelMeasurementLogsCsvFileRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1136,10 +1104,6 @@ protected function getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -1224,16 +1188,15 @@ protected function getChannelMeasurementLogsCsvFileRequest($id, $xAcceptVersion * Get schedules list of the channel * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule[] */ - public function getChannelSchedules($id, $xAcceptVersion = null, $include = null) + public function getChannelSchedules($id, $include = null) { - list($response) = $this->getChannelSchedulesWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getChannelSchedulesWithHttpInfo($id, $include); return $response; } @@ -1243,17 +1206,16 @@ public function getChannelSchedules($id, $xAcceptVersion = null, $include = null * Get schedules list of the channel * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelSchedulesWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getChannelSchedulesWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getChannelSchedulesRequest($id, $xAcceptVersion, $include); + $request = $this->getChannelSchedulesRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -1320,15 +1282,14 @@ public function getChannelSchedulesWithHttpInfo($id, $xAcceptVersion = null, $in * Get schedules list of the channel * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelSchedulesAsync($id, $xAcceptVersion = null, $include = null) + public function getChannelSchedulesAsync($id, $include = null) { - return $this->getChannelSchedulesAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getChannelSchedulesAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -1342,16 +1303,15 @@ function ($response) { * Get schedules list of the channel * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelSchedulesAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getChannelSchedulesAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getChannelSchedulesRequest($id, $xAcceptVersion, $include); + $request = $this->getChannelSchedulesRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1394,13 +1354,12 @@ function ($exception) { * Create request for operation 'getChannelSchedules' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelSchedulesRequest($id, $xAcceptVersion = null, $include = null) + protected function getChannelSchedulesRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1423,10 +1382,6 @@ protected function getChannelSchedulesRequest($id, $xAcceptVersion = null, $incl if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -1510,7 +1465,6 @@ protected function getChannelSchedulesRequest($id, $xAcceptVersion = null, $incl * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function function (optional) * @param string $io Return only `input` or `output` channels. (optional) @@ -1520,9 +1474,9 @@ protected function getChannelSchedulesRequest($id, $xAcceptVersion = null, $incl * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel[] */ - public function getChannels($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) + public function getChannels($include = null, $function = null, $io = null, $hasFunction = null) { - list($response) = $this->getChannelsWithHttpInfo($xAcceptVersion, $include, $function, $io, $hasFunction); + list($response) = $this->getChannelsWithHttpInfo($include, $function, $io, $hasFunction); return $response; } @@ -1531,7 +1485,6 @@ public function getChannels($xAcceptVersion = null, $include = null, $function = * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) @@ -1541,10 +1494,10 @@ public function getChannels($xAcceptVersion = null, $include = null, $function = * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel[], HTTP status code, HTTP response headers (array of strings) */ - public function getChannelsWithHttpInfo($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) + public function getChannelsWithHttpInfo($include = null, $function = null, $io = null, $hasFunction = null) { $returnType = '\Swagger\Client\Model\Channel[]'; - $request = $this->getChannelsRequest($xAcceptVersion, $include, $function, $io, $hasFunction); + $request = $this->getChannelsRequest($include, $function, $io, $hasFunction); try { $options = $this->createHttpClientOption(); @@ -1610,7 +1563,6 @@ public function getChannelsWithHttpInfo($xAcceptVersion = null, $include = null, * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) @@ -1619,9 +1571,9 @@ public function getChannelsWithHttpInfo($xAcceptVersion = null, $include = null, * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelsAsync($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) + public function getChannelsAsync($include = null, $function = null, $io = null, $hasFunction = null) { - return $this->getChannelsAsyncWithHttpInfo($xAcceptVersion, $include, $function, $io, $hasFunction) + return $this->getChannelsAsyncWithHttpInfo($include, $function, $io, $hasFunction) ->then( function ($response) { return $response[0]; @@ -1634,7 +1586,6 @@ function ($response) { * * Get channels list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) @@ -1643,10 +1594,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChannelsAsyncWithHttpInfo($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) + public function getChannelsAsyncWithHttpInfo($include = null, $function = null, $io = null, $hasFunction = null) { $returnType = '\Swagger\Client\Model\Channel[]'; - $request = $this->getChannelsRequest($xAcceptVersion, $include, $function, $io, $hasFunction); + $request = $this->getChannelsRequest($include, $function, $io, $hasFunction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1688,7 +1639,6 @@ function ($exception) { /** * Create request for operation 'getChannels' * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * @param string[] $function (optional) * @param string $io Return only `input` or `output` channels. (optional) @@ -1697,7 +1647,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChannelsRequest($xAcceptVersion = null, $include = null, $function = null, $io = null, $hasFunction = null) + protected function getChannelsRequest($include = null, $function = null, $io = null, $hasFunction = null) { $resourcePath = '/channels'; @@ -1729,10 +1679,6 @@ protected function getChannelsRequest($xAcceptVersion = null, $include = null, $ if ($hasFunction !== null) { $queryParams['hasFunction'] = ObjectSerializer::toQueryValue($hasFunction); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -1810,15 +1756,14 @@ protected function getChannelsRequest($xAcceptVersion = null, $include = null, $ * * @param int $id id (required) * @param \Swagger\Client\Model\Body2 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel */ - public function updateChannel($id, $body, $xAcceptVersion = null) + public function updateChannel($id, $body) { - list($response) = $this->updateChannelWithHttpInfo($id, $body, $xAcceptVersion); + list($response) = $this->updateChannelWithHttpInfo($id, $body); return $response; } @@ -1829,16 +1774,15 @@ public function updateChannel($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) */ - public function updateChannelWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateChannelWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->updateChannelRequest($id, $body, $xAcceptVersion); + $request = $this->updateChannelRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -1914,14 +1858,13 @@ public function updateChannelWithHttpInfo($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelAsync($id, $body, $xAcceptVersion = null) + public function updateChannelAsync($id, $body) { - return $this->updateChannelAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->updateChannelAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -1936,15 +1879,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateChannelAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateChannelAsyncWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->updateChannelRequest($id, $body, $xAcceptVersion); + $request = $this->updateChannelRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1988,12 +1930,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body2 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateChannelRequest($id, $body, $xAcceptVersion = null) + protected function updateChannelRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -2015,10 +1956,6 @@ protected function updateChannelRequest($id, $body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/ClientAppsApi.php b/lib/Api/ClientAppsApi.php index 487d5f5..af30338 100644 --- a/lib/Api/ClientAppsApi.php +++ b/lib/Api/ClientAppsApi.php @@ -93,15 +93,14 @@ public function getConfig() * Delete Client App * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteClientApp($id, $xAcceptVersion = null) + public function deleteClientApp($id) { - $this->deleteClientAppWithHttpInfo($id, $xAcceptVersion); + $this->deleteClientAppWithHttpInfo($id); } /** @@ -110,16 +109,15 @@ public function deleteClientApp($id, $xAcceptVersion = null) * Delete Client App * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteClientAppWithHttpInfo($id, $xAcceptVersion = null) + public function deleteClientAppWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteClientAppRequest($id, $xAcceptVersion); + $request = $this->deleteClientAppRequest($id); try { $options = $this->createHttpClientOption(); @@ -164,14 +162,13 @@ public function deleteClientAppWithHttpInfo($id, $xAcceptVersion = null) * Delete Client App * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteClientAppAsync($id, $xAcceptVersion = null) + public function deleteClientAppAsync($id) { - return $this->deleteClientAppAsyncWithHttpInfo($id, $xAcceptVersion) + return $this->deleteClientAppAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -185,15 +182,14 @@ function ($response) { * Delete Client App * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteClientAppAsyncWithHttpInfo($id, $xAcceptVersion = null) + public function deleteClientAppAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteClientAppRequest($id, $xAcceptVersion); + $request = $this->deleteClientAppRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -222,12 +218,11 @@ function ($exception) { * Create request for operation 'deleteClientApp' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteClientAppRequest($id, $xAcceptVersion = null) + protected function deleteClientAppRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -243,10 +238,6 @@ protected function deleteClientAppRequest($id, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -330,16 +321,15 @@ protected function deleteClientAppRequest($id, $xAcceptVersion = null) * * Get client apps * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ClientApp[] */ - public function getClientApps($xAcceptVersion = null, $include = null) + public function getClientApps($include = null) { - list($response) = $this->getClientAppsWithHttpInfo($xAcceptVersion, $include); + list($response) = $this->getClientAppsWithHttpInfo($include); return $response; } @@ -348,17 +338,16 @@ public function getClientApps($xAcceptVersion = null, $include = null) * * Get client apps * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ClientApp[], HTTP status code, HTTP response headers (array of strings) */ - public function getClientAppsWithHttpInfo($xAcceptVersion = null, $include = null) + public function getClientAppsWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\ClientApp[]'; - $request = $this->getClientAppsRequest($xAcceptVersion, $include); + $request = $this->getClientAppsRequest($include); try { $options = $this->createHttpClientOption(); @@ -424,15 +413,14 @@ public function getClientAppsWithHttpInfo($xAcceptVersion = null, $include = nul * * Get client apps * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getClientAppsAsync($xAcceptVersion = null, $include = null) + public function getClientAppsAsync($include = null) { - return $this->getClientAppsAsyncWithHttpInfo($xAcceptVersion, $include) + return $this->getClientAppsAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -445,16 +433,15 @@ function ($response) { * * Get client apps * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getClientAppsAsyncWithHttpInfo($xAcceptVersion = null, $include = null) + public function getClientAppsAsyncWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\ClientApp[]'; - $request = $this->getClientAppsRequest($xAcceptVersion, $include); + $request = $this->getClientAppsRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -496,13 +483,12 @@ function ($exception) { /** * Create request for operation 'getClientApps' * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getClientAppsRequest($xAcceptVersion = null, $include = null) + protected function getClientAppsRequest($include = null) { $resourcePath = '/client-apps'; @@ -519,10 +505,6 @@ protected function getClientAppsRequest($xAcceptVersion = null, $include = null) if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -600,15 +582,14 @@ protected function getClientAppsRequest($xAcceptVersion = null, $include = null) * * @param int $id id (required) * @param \Swagger\Client\Model\Body7 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ClientApp */ - public function updateClientApp($id, $body, $xAcceptVersion = null) + public function updateClientApp($id, $body) { - list($response) = $this->updateClientAppWithHttpInfo($id, $body, $xAcceptVersion); + list($response) = $this->updateClientAppWithHttpInfo($id, $body); return $response; } @@ -619,16 +600,15 @@ public function updateClientApp($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ClientApp, HTTP status code, HTTP response headers (array of strings) */ - public function updateClientAppWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateClientAppWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\ClientApp'; - $request = $this->updateClientAppRequest($id, $body, $xAcceptVersion); + $request = $this->updateClientAppRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -696,14 +676,13 @@ public function updateClientAppWithHttpInfo($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateClientAppAsync($id, $body, $xAcceptVersion = null) + public function updateClientAppAsync($id, $body) { - return $this->updateClientAppAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->updateClientAppAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -718,15 +697,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateClientAppAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateClientAppAsyncWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\ClientApp'; - $request = $this->updateClientAppRequest($id, $body, $xAcceptVersion); + $request = $this->updateClientAppRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -770,12 +748,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body7 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateClientAppRequest($id, $body, $xAcceptVersion = null) + protected function updateClientAppRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -797,10 +774,6 @@ protected function updateClientAppRequest($id, $body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/IODevicesApi.php b/lib/Api/IODevicesApi.php index 9cae5a2..501fee8 100644 --- a/lib/Api/IODevicesApi.php +++ b/lib/Api/IODevicesApi.php @@ -93,15 +93,14 @@ public function getConfig() * Delete IO Device * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteIoDevice($id, $xAcceptVersion = null) + public function deleteIoDevice($id) { - $this->deleteIoDeviceWithHttpInfo($id, $xAcceptVersion); + $this->deleteIoDeviceWithHttpInfo($id); } /** @@ -110,16 +109,15 @@ public function deleteIoDevice($id, $xAcceptVersion = null) * Delete IO Device * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteIoDeviceWithHttpInfo($id, $xAcceptVersion = null) + public function deleteIoDeviceWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteIoDeviceRequest($id, $xAcceptVersion); + $request = $this->deleteIoDeviceRequest($id); try { $options = $this->createHttpClientOption(); @@ -164,14 +162,13 @@ public function deleteIoDeviceWithHttpInfo($id, $xAcceptVersion = null) * Delete IO Device * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteIoDeviceAsync($id, $xAcceptVersion = null) + public function deleteIoDeviceAsync($id) { - return $this->deleteIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion) + return $this->deleteIoDeviceAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -185,15 +182,14 @@ function ($response) { * Delete IO Device * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion = null) + public function deleteIoDeviceAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteIoDeviceRequest($id, $xAcceptVersion); + $request = $this->deleteIoDeviceRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -222,12 +218,11 @@ function ($exception) { * Create request for operation 'deleteIoDevice' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteIoDeviceRequest($id, $xAcceptVersion = null) + protected function deleteIoDeviceRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -243,10 +238,6 @@ protected function deleteIoDeviceRequest($id, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -331,16 +322,15 @@ protected function deleteIoDeviceRequest($id, $xAcceptVersion = null) * Get IO Device * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Device */ - public function getIoDevice($id, $xAcceptVersion = null, $include = null) + public function getIoDevice($id, $include = null) { - list($response) = $this->getIoDeviceWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getIoDeviceWithHttpInfo($id, $include); return $response; } @@ -350,17 +340,16 @@ public function getIoDevice($id, $xAcceptVersion = null, $include = null) * Get IO Device * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Device, HTTP status code, HTTP response headers (array of strings) */ - public function getIoDeviceWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->getIoDeviceRequest($id, $xAcceptVersion, $include); + $request = $this->getIoDeviceRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -427,15 +416,14 @@ public function getIoDeviceWithHttpInfo($id, $xAcceptVersion = null, $include = * Get IO Device * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceAsync($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceAsync($id, $include = null) { - return $this->getIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getIoDeviceAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -449,16 +437,15 @@ function ($response) { * Get IO Device * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->getIoDeviceRequest($id, $xAcceptVersion, $include); + $request = $this->getIoDeviceRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -501,13 +488,12 @@ function ($exception) { * Create request for operation 'getIoDevice' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIoDeviceRequest($id, $xAcceptVersion = null, $include = null) + protected function getIoDeviceRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -530,10 +516,6 @@ protected function getIoDeviceRequest($id, $xAcceptVersion = null, $include = nu if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -618,16 +600,15 @@ protected function getIoDeviceRequest($id, $xAcceptVersion = null, $include = nu * Get Channels that belong to IO Deice * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Channel */ - public function getIoDeviceChannels($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceChannels($id, $include = null) { - list($response) = $this->getIoDeviceChannelsWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getIoDeviceChannelsWithHttpInfo($id, $include); return $response; } @@ -637,17 +618,16 @@ public function getIoDeviceChannels($id, $xAcceptVersion = null, $include = null * Get Channels that belong to IO Deice * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Channel, HTTP status code, HTTP response headers (array of strings) */ - public function getIoDeviceChannelsWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceChannelsWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getIoDeviceChannelsRequest($id, $xAcceptVersion, $include); + $request = $this->getIoDeviceChannelsRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -714,15 +694,14 @@ public function getIoDeviceChannelsWithHttpInfo($id, $xAcceptVersion = null, $in * Get Channels that belong to IO Deice * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceChannelsAsync($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceChannelsAsync($id, $include = null) { - return $this->getIoDeviceChannelsAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getIoDeviceChannelsAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -736,16 +715,15 @@ function ($response) { * Get Channels that belong to IO Deice * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDeviceChannelsAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getIoDeviceChannelsAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Channel'; - $request = $this->getIoDeviceChannelsRequest($id, $xAcceptVersion, $include); + $request = $this->getIoDeviceChannelsRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -788,13 +766,12 @@ function ($exception) { * Create request for operation 'getIoDeviceChannels' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIoDeviceChannelsRequest($id, $xAcceptVersion = null, $include = null) + protected function getIoDeviceChannelsRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -817,10 +794,6 @@ protected function getIoDeviceChannelsRequest($id, $xAcceptVersion = null, $incl if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -904,16 +877,15 @@ protected function getIoDeviceChannelsRequest($id, $xAcceptVersion = null, $incl * * Get IO Devices * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Device[] */ - public function getIoDevices($xAcceptVersion = null, $include = null) + public function getIoDevices($include = null) { - list($response) = $this->getIoDevicesWithHttpInfo($xAcceptVersion, $include); + list($response) = $this->getIoDevicesWithHttpInfo($include); return $response; } @@ -922,17 +894,16 @@ public function getIoDevices($xAcceptVersion = null, $include = null) * * Get IO Devices * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Device[], HTTP status code, HTTP response headers (array of strings) */ - public function getIoDevicesWithHttpInfo($xAcceptVersion = null, $include = null) + public function getIoDevicesWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\Device[]'; - $request = $this->getIoDevicesRequest($xAcceptVersion, $include); + $request = $this->getIoDevicesRequest($include); try { $options = $this->createHttpClientOption(); @@ -998,15 +969,14 @@ public function getIoDevicesWithHttpInfo($xAcceptVersion = null, $include = null * * Get IO Devices * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDevicesAsync($xAcceptVersion = null, $include = null) + public function getIoDevicesAsync($include = null) { - return $this->getIoDevicesAsyncWithHttpInfo($xAcceptVersion, $include) + return $this->getIoDevicesAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -1019,16 +989,15 @@ function ($response) { * * Get IO Devices * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getIoDevicesAsyncWithHttpInfo($xAcceptVersion = null, $include = null) + public function getIoDevicesAsyncWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\Device[]'; - $request = $this->getIoDevicesRequest($xAcceptVersion, $include); + $request = $this->getIoDevicesRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1070,13 +1039,12 @@ function ($exception) { /** * Create request for operation 'getIoDevices' * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIoDevicesRequest($xAcceptVersion = null, $include = null) + protected function getIoDevicesRequest($include = null) { $resourcePath = '/iodevices'; @@ -1093,10 +1061,6 @@ protected function getIoDevicesRequest($xAcceptVersion = null, $include = null) if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -1174,15 +1138,14 @@ protected function getIoDevicesRequest($xAcceptVersion = null, $include = null) * * @param int $id id (required) * @param \Swagger\Client\Model\Body8 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Device */ - public function updateIoDevice($id, $body, $xAcceptVersion = null) + public function updateIoDevice($id, $body) { - list($response) = $this->updateIoDeviceWithHttpInfo($id, $body, $xAcceptVersion); + list($response) = $this->updateIoDeviceWithHttpInfo($id, $body); return $response; } @@ -1193,16 +1156,15 @@ public function updateIoDevice($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Device, HTTP status code, HTTP response headers (array of strings) */ - public function updateIoDeviceWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateIoDeviceWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->updateIoDeviceRequest($id, $body, $xAcceptVersion); + $request = $this->updateIoDeviceRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -1270,14 +1232,13 @@ public function updateIoDeviceWithHttpInfo($id, $body, $xAcceptVersion = null) * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateIoDeviceAsync($id, $body, $xAcceptVersion = null) + public function updateIoDeviceAsync($id, $body) { - return $this->updateIoDeviceAsyncWithHttpInfo($id, $body, $xAcceptVersion) + return $this->updateIoDeviceAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -1292,15 +1253,14 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateIoDeviceAsyncWithHttpInfo($id, $body, $xAcceptVersion = null) + public function updateIoDeviceAsyncWithHttpInfo($id, $body) { $returnType = '\Swagger\Client\Model\Device'; - $request = $this->updateIoDeviceRequest($id, $body, $xAcceptVersion); + $request = $this->updateIoDeviceRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1344,12 +1304,11 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body8 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateIoDeviceRequest($id, $body, $xAcceptVersion = null) + protected function updateIoDeviceRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1371,10 +1330,6 @@ protected function updateIoDeviceRequest($id, $body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/LocationsApi.php b/lib/Api/LocationsApi.php index a9e027d..cacc172 100644 --- a/lib/Api/LocationsApi.php +++ b/lib/Api/LocationsApi.php @@ -92,15 +92,14 @@ public function getConfig() * * Create a new location * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location */ - public function createLocation($xAcceptVersion = null) + public function createLocation() { - list($response) = $this->createLocationWithHttpInfo($xAcceptVersion); + list($response) = $this->createLocationWithHttpInfo(); return $response; } @@ -109,16 +108,15 @@ public function createLocation($xAcceptVersion = null) * * Create a new location * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) */ - public function createLocationWithHttpInfo($xAcceptVersion = null) + public function createLocationWithHttpInfo() { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->createLocationRequest($xAcceptVersion); + $request = $this->createLocationRequest(); try { $options = $this->createHttpClientOption(); @@ -184,14 +182,13 @@ public function createLocationWithHttpInfo($xAcceptVersion = null) * * Create a new location * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLocationAsync($xAcceptVersion = null) + public function createLocationAsync() { - return $this->createLocationAsyncWithHttpInfo($xAcceptVersion) + return $this->createLocationAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -204,15 +201,14 @@ function ($response) { * * Create a new location * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLocationAsyncWithHttpInfo($xAcceptVersion = null) + public function createLocationAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->createLocationRequest($xAcceptVersion); + $request = $this->createLocationRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -254,12 +250,11 @@ function ($exception) { /** * Create request for operation 'createLocation' * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createLocationRequest($xAcceptVersion = null) + protected function createLocationRequest() { $resourcePath = '/locations'; @@ -269,10 +264,6 @@ protected function createLocationRequest($xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -349,16 +340,15 @@ protected function createLocationRequest($xAcceptVersion = null) * Delete location * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteLocation($id, $xAcceptVersion = null, $include = null) + public function deleteLocation($id, $include = null) { - $this->deleteLocationWithHttpInfo($id, $xAcceptVersion, $include); + $this->deleteLocationWithHttpInfo($id, $include); } /** @@ -367,17 +357,16 @@ public function deleteLocation($id, $xAcceptVersion = null, $include = null) * Delete location * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteLocationWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function deleteLocationWithHttpInfo($id, $include = null) { $returnType = ''; - $request = $this->deleteLocationRequest($id, $xAcceptVersion, $include); + $request = $this->deleteLocationRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -422,15 +411,14 @@ public function deleteLocationWithHttpInfo($id, $xAcceptVersion = null, $include * Delete location * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteLocationAsync($id, $xAcceptVersion = null, $include = null) + public function deleteLocationAsync($id, $include = null) { - return $this->deleteLocationAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->deleteLocationAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -444,16 +432,15 @@ function ($response) { * Delete location * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteLocationAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function deleteLocationAsyncWithHttpInfo($id, $include = null) { $returnType = ''; - $request = $this->deleteLocationRequest($id, $xAcceptVersion, $include); + $request = $this->deleteLocationRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -482,13 +469,12 @@ function ($exception) { * Create request for operation 'deleteLocation' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteLocationRequest($id, $xAcceptVersion = null, $include = null) + protected function deleteLocationRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -511,10 +497,6 @@ protected function deleteLocationRequest($id, $xAcceptVersion = null, $include = if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -599,16 +581,15 @@ protected function deleteLocationRequest($id, $xAcceptVersion = null, $include = * Get location by ID * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location */ - public function getLocation($id, $xAcceptVersion = null, $include = null) + public function getLocation($id, $include = null) { - list($response) = $this->getLocationWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getLocationWithHttpInfo($id, $include); return $response; } @@ -618,17 +599,16 @@ public function getLocation($id, $xAcceptVersion = null, $include = null) * Get location by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) */ - public function getLocationWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getLocationWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->getLocationRequest($id, $xAcceptVersion, $include); + $request = $this->getLocationRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -695,15 +675,14 @@ public function getLocationWithHttpInfo($id, $xAcceptVersion = null, $include = * Get location by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationAsync($id, $xAcceptVersion = null, $include = null) + public function getLocationAsync($id, $include = null) { - return $this->getLocationAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getLocationAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -717,16 +696,15 @@ function ($response) { * Get location by ID * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getLocationAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->getLocationRequest($id, $xAcceptVersion, $include); + $request = $this->getLocationRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -769,13 +747,12 @@ function ($exception) { * Create request for operation 'getLocation' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLocationRequest($id, $xAcceptVersion = null, $include = null) + protected function getLocationRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -798,10 +775,6 @@ protected function getLocationRequest($id, $xAcceptVersion = null, $include = nu if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -885,16 +858,15 @@ protected function getLocationRequest($id, $xAcceptVersion = null, $include = nu * * Get locations list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location[] */ - public function getLocations($xAcceptVersion = null, $include = null) + public function getLocations($include = null) { - list($response) = $this->getLocationsWithHttpInfo($xAcceptVersion, $include); + list($response) = $this->getLocationsWithHttpInfo($include); return $response; } @@ -903,17 +875,16 @@ public function getLocations($xAcceptVersion = null, $include = null) * * Get locations list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location[], HTTP status code, HTTP response headers (array of strings) */ - public function getLocationsWithHttpInfo($xAcceptVersion = null, $include = null) + public function getLocationsWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\Location[]'; - $request = $this->getLocationsRequest($xAcceptVersion, $include); + $request = $this->getLocationsRequest($include); try { $options = $this->createHttpClientOption(); @@ -979,15 +950,14 @@ public function getLocationsWithHttpInfo($xAcceptVersion = null, $include = null * * Get locations list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationsAsync($xAcceptVersion = null, $include = null) + public function getLocationsAsync($include = null) { - return $this->getLocationsAsyncWithHttpInfo($xAcceptVersion, $include) + return $this->getLocationsAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -1000,16 +970,15 @@ function ($response) { * * Get locations list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLocationsAsyncWithHttpInfo($xAcceptVersion = null, $include = null) + public function getLocationsAsyncWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\Location[]'; - $request = $this->getLocationsRequest($xAcceptVersion, $include); + $request = $this->getLocationsRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1051,13 +1020,12 @@ function ($exception) { /** * Create request for operation 'getLocations' * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLocationsRequest($xAcceptVersion = null, $include = null) + protected function getLocationsRequest($include = null) { $resourcePath = '/locations'; @@ -1074,10 +1042,6 @@ protected function getLocationsRequest($xAcceptVersion = null, $include = null) if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -1155,16 +1119,15 @@ protected function getLocationsRequest($xAcceptVersion = null, $include = null) * * @param int $id id (required) * @param \Swagger\Client\Model\Body1 $body body (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Location */ - public function updateLocation($id, $body, $xAcceptVersion = null, $include = null) + public function updateLocation($id, $body, $include = null) { - list($response) = $this->updateLocationWithHttpInfo($id, $body, $xAcceptVersion, $include); + list($response) = $this->updateLocationWithHttpInfo($id, $body, $include); return $response; } @@ -1175,17 +1138,16 @@ public function updateLocation($id, $body, $xAcceptVersion = null, $include = nu * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Location, HTTP status code, HTTP response headers (array of strings) */ - public function updateLocationWithHttpInfo($id, $body, $xAcceptVersion = null, $include = null) + public function updateLocationWithHttpInfo($id, $body, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->updateLocationRequest($id, $body, $xAcceptVersion, $include); + $request = $this->updateLocationRequest($id, $body, $include); try { $options = $this->createHttpClientOption(); @@ -1253,15 +1215,14 @@ public function updateLocationWithHttpInfo($id, $body, $xAcceptVersion = null, $ * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLocationAsync($id, $body, $xAcceptVersion = null, $include = null) + public function updateLocationAsync($id, $body, $include = null) { - return $this->updateLocationAsyncWithHttpInfo($id, $body, $xAcceptVersion, $include) + return $this->updateLocationAsyncWithHttpInfo($id, $body, $include) ->then( function ($response) { return $response[0]; @@ -1276,16 +1237,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLocationAsyncWithHttpInfo($id, $body, $xAcceptVersion = null, $include = null) + public function updateLocationAsyncWithHttpInfo($id, $body, $include = null) { $returnType = '\Swagger\Client\Model\Location'; - $request = $this->updateLocationRequest($id, $body, $xAcceptVersion, $include); + $request = $this->updateLocationRequest($id, $body, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1329,13 +1289,12 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\Body1 $body (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateLocationRequest($id, $body, $xAcceptVersion = null, $include = null) + protected function updateLocationRequest($id, $body, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1364,10 +1323,6 @@ protected function updateLocationRequest($id, $body, $xAcceptVersion = null, $in if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/SchedulesApi.php b/lib/Api/SchedulesApi.php index 3e52c0c..9616109 100644 --- a/lib/Api/SchedulesApi.php +++ b/lib/Api/SchedulesApi.php @@ -93,15 +93,14 @@ public function getConfig() * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule */ - public function createSchedule($body, $xAcceptVersion = null) + public function createSchedule($body) { - list($response) = $this->createScheduleWithHttpInfo($body, $xAcceptVersion); + list($response) = $this->createScheduleWithHttpInfo($body); return $response; } @@ -111,16 +110,15 @@ public function createSchedule($body, $xAcceptVersion = null) * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ - public function createScheduleWithHttpInfo($body, $xAcceptVersion = null) + public function createScheduleWithHttpInfo($body) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->createScheduleRequest($body, $xAcceptVersion); + $request = $this->createScheduleRequest($body); try { $options = $this->createHttpClientOption(); @@ -187,14 +185,13 @@ public function createScheduleWithHttpInfo($body, $xAcceptVersion = null) * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createScheduleAsync($body, $xAcceptVersion = null) + public function createScheduleAsync($body) { - return $this->createScheduleAsyncWithHttpInfo($body, $xAcceptVersion) + return $this->createScheduleAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -208,15 +205,14 @@ function ($response) { * Create a new schedule * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createScheduleAsyncWithHttpInfo($body, $xAcceptVersion = null) + public function createScheduleAsyncWithHttpInfo($body) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->createScheduleRequest($body, $xAcceptVersion); + $request = $this->createScheduleRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -259,12 +255,11 @@ function ($exception) { * Create request for operation 'createSchedule' * * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createScheduleRequest($body, $xAcceptVersion = null) + protected function createScheduleRequest($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { @@ -280,10 +275,6 @@ protected function createScheduleRequest($body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -363,15 +354,14 @@ protected function createScheduleRequest($body, $xAcceptVersion = null) * Delete Schedule * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteSchedule($id, $xAcceptVersion = null) + public function deleteSchedule($id) { - $this->deleteScheduleWithHttpInfo($id, $xAcceptVersion); + $this->deleteScheduleWithHttpInfo($id); } /** @@ -380,16 +370,15 @@ public function deleteSchedule($id, $xAcceptVersion = null) * Delete Schedule * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteScheduleWithHttpInfo($id, $xAcceptVersion = null) + public function deleteScheduleWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteScheduleRequest($id, $xAcceptVersion); + $request = $this->deleteScheduleRequest($id); try { $options = $this->createHttpClientOption(); @@ -434,14 +423,13 @@ public function deleteScheduleWithHttpInfo($id, $xAcceptVersion = null) * Delete Schedule * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteScheduleAsync($id, $xAcceptVersion = null) + public function deleteScheduleAsync($id) { - return $this->deleteScheduleAsyncWithHttpInfo($id, $xAcceptVersion) + return $this->deleteScheduleAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -455,15 +443,14 @@ function ($response) { * Delete Schedule * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteScheduleAsyncWithHttpInfo($id, $xAcceptVersion = null) + public function deleteScheduleAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteScheduleRequest($id, $xAcceptVersion); + $request = $this->deleteScheduleRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -492,12 +479,11 @@ function ($exception) { * Create request for operation 'deleteSchedule' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteScheduleRequest($id, $xAcceptVersion = null) + protected function deleteScheduleRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -513,10 +499,6 @@ protected function deleteScheduleRequest($id, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -601,15 +583,14 @@ protected function deleteScheduleRequest($id, $xAcceptVersion = null) * Enable schedules * * @param \Swagger\Client\Model\Body9 $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function enableSchedules($body, $xAcceptVersion = null) + public function enableSchedules($body) { - $this->enableSchedulesWithHttpInfo($body, $xAcceptVersion); + $this->enableSchedulesWithHttpInfo($body); } /** @@ -618,16 +599,15 @@ public function enableSchedules($body, $xAcceptVersion = null) * Enable schedules * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function enableSchedulesWithHttpInfo($body, $xAcceptVersion = null) + public function enableSchedulesWithHttpInfo($body) { $returnType = ''; - $request = $this->enableSchedulesRequest($body, $xAcceptVersion); + $request = $this->enableSchedulesRequest($body); try { $options = $this->createHttpClientOption(); @@ -672,14 +652,13 @@ public function enableSchedulesWithHttpInfo($body, $xAcceptVersion = null) * Enable schedules * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function enableSchedulesAsync($body, $xAcceptVersion = null) + public function enableSchedulesAsync($body) { - return $this->enableSchedulesAsyncWithHttpInfo($body, $xAcceptVersion) + return $this->enableSchedulesAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -693,15 +672,14 @@ function ($response) { * Enable schedules * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function enableSchedulesAsyncWithHttpInfo($body, $xAcceptVersion = null) + public function enableSchedulesAsyncWithHttpInfo($body) { $returnType = ''; - $request = $this->enableSchedulesRequest($body, $xAcceptVersion); + $request = $this->enableSchedulesRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -730,12 +708,11 @@ function ($exception) { * Create request for operation 'enableSchedules' * * @param \Swagger\Client\Model\Body9 $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function enableSchedulesRequest($body, $xAcceptVersion = null) + protected function enableSchedulesRequest($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { @@ -751,10 +728,6 @@ protected function enableSchedulesRequest($body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -834,16 +807,15 @@ protected function enableSchedulesRequest($body, $xAcceptVersion = null) * Get Schedule * * @param int $id id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule */ - public function getSchedule($id, $xAcceptVersion = null, $include = null) + public function getSchedule($id, $include = null) { - list($response) = $this->getScheduleWithHttpInfo($id, $xAcceptVersion, $include); + list($response) = $this->getScheduleWithHttpInfo($id, $include); return $response; } @@ -853,17 +825,16 @@ public function getSchedule($id, $xAcceptVersion = null, $include = null) * Get Schedule * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ - public function getScheduleWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getScheduleWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->getScheduleRequest($id, $xAcceptVersion, $include); + $request = $this->getScheduleRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -930,15 +901,14 @@ public function getScheduleWithHttpInfo($id, $xAcceptVersion = null, $include = * Get Schedule * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getScheduleAsync($id, $xAcceptVersion = null, $include = null) + public function getScheduleAsync($id, $include = null) { - return $this->getScheduleAsyncWithHttpInfo($id, $xAcceptVersion, $include) + return $this->getScheduleAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -952,16 +922,15 @@ function ($response) { * Get Schedule * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getScheduleAsyncWithHttpInfo($id, $xAcceptVersion = null, $include = null) + public function getScheduleAsyncWithHttpInfo($id, $include = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->getScheduleRequest($id, $xAcceptVersion, $include); + $request = $this->getScheduleRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1004,13 +973,12 @@ function ($exception) { * Create request for operation 'getSchedule' * * @param int $id (required) - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getScheduleRequest($id, $xAcceptVersion = null, $include = null) + protected function getScheduleRequest($id, $include = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1033,10 +1001,6 @@ protected function getScheduleRequest($id, $xAcceptVersion = null, $include = nu if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { @@ -1120,16 +1084,15 @@ protected function getScheduleRequest($id, $xAcceptVersion = null, $include = nu * * Get schedules list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule[] */ - public function getSchedules($xAcceptVersion = null, $include = null) + public function getSchedules($include = null) { - list($response) = $this->getSchedulesWithHttpInfo($xAcceptVersion, $include); + list($response) = $this->getSchedulesWithHttpInfo($include); return $response; } @@ -1138,17 +1101,16 @@ public function getSchedules($xAcceptVersion = null, $include = null) * * Get schedules list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) */ - public function getSchedulesWithHttpInfo($xAcceptVersion = null, $include = null) + public function getSchedulesWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getSchedulesRequest($xAcceptVersion, $include); + $request = $this->getSchedulesRequest($include); try { $options = $this->createHttpClientOption(); @@ -1214,15 +1176,14 @@ public function getSchedulesWithHttpInfo($xAcceptVersion = null, $include = null * * Get schedules list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSchedulesAsync($xAcceptVersion = null, $include = null) + public function getSchedulesAsync($include = null) { - return $this->getSchedulesAsyncWithHttpInfo($xAcceptVersion, $include) + return $this->getSchedulesAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -1235,16 +1196,15 @@ function ($response) { * * Get schedules list * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSchedulesAsyncWithHttpInfo($xAcceptVersion = null, $include = null) + public function getSchedulesAsyncWithHttpInfo($include = null) { $returnType = '\Swagger\Client\Model\Schedule[]'; - $request = $this->getSchedulesRequest($xAcceptVersion, $include); + $request = $this->getSchedulesRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1286,13 +1246,12 @@ function ($exception) { /** * Create request for operation 'getSchedules' * - * @param string $xAcceptVersion API Version (optional) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getSchedulesRequest($xAcceptVersion = null, $include = null) + protected function getSchedulesRequest($include = null) { $resourcePath = '/schedules'; @@ -1309,10 +1268,6 @@ protected function getSchedulesRequest($xAcceptVersion = null, $include = null) if ($include !== null) { $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -1390,16 +1345,15 @@ protected function getSchedulesRequest($xAcceptVersion = null, $include = null) * * @param int $id id (required) * @param \Swagger\Client\Model\ScheduleRequest $body body (required) - * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Schedule */ - public function updateSchedule($id, $body, $xAcceptVersion = null, $enable = null) + public function updateSchedule($id, $body, $enable = null) { - list($response) = $this->updateScheduleWithHttpInfo($id, $body, $xAcceptVersion, $enable); + list($response) = $this->updateScheduleWithHttpInfo($id, $body, $enable); return $response; } @@ -1410,17 +1364,16 @@ public function updateSchedule($id, $body, $xAcceptVersion = null, $enable = nul * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ - public function updateScheduleWithHttpInfo($id, $body, $xAcceptVersion = null, $enable = null) + public function updateScheduleWithHttpInfo($id, $body, $enable = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->updateScheduleRequest($id, $body, $xAcceptVersion, $enable); + $request = $this->updateScheduleRequest($id, $body, $enable); try { $options = $this->createHttpClientOption(); @@ -1488,15 +1441,14 @@ public function updateScheduleWithHttpInfo($id, $body, $xAcceptVersion = null, $ * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateScheduleAsync($id, $body, $xAcceptVersion = null, $enable = null) + public function updateScheduleAsync($id, $body, $enable = null) { - return $this->updateScheduleAsyncWithHttpInfo($id, $body, $xAcceptVersion, $enable) + return $this->updateScheduleAsyncWithHttpInfo($id, $body, $enable) ->then( function ($response) { return $response[0]; @@ -1511,16 +1463,15 @@ function ($response) { * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateScheduleAsyncWithHttpInfo($id, $body, $xAcceptVersion = null, $enable = null) + public function updateScheduleAsyncWithHttpInfo($id, $body, $enable = null) { $returnType = '\Swagger\Client\Model\Schedule'; - $request = $this->updateScheduleRequest($id, $body, $xAcceptVersion, $enable); + $request = $this->updateScheduleRequest($id, $body, $enable); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1564,13 +1515,12 @@ function ($exception) { * * @param int $id (required) * @param \Swagger\Client\Model\ScheduleRequest $body (required) - * @param string $xAcceptVersion API Version (optional) * @param bool $enable Set to `true` to enable the schedule after saving. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateScheduleRequest($id, $body, $xAcceptVersion = null, $enable = null) + protected function updateScheduleRequest($id, $body, $enable = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1596,10 +1546,6 @@ protected function updateScheduleRequest($id, $body, $xAcceptVersion = null, $en if ($enable !== null) { $queryParams['enable'] = ObjectSerializer::toQueryValue($enable); } - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // path params if ($id !== null) { diff --git a/lib/Api/ServerApi.php b/lib/Api/ServerApi.php index da81d1e..e5f0f92 100644 --- a/lib/Api/ServerApi.php +++ b/lib/Api/ServerApi.php @@ -92,15 +92,14 @@ public function getConfig() * * Get server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\InlineResponse200 */ - public function serverInfoGet($xAcceptVersion = null) + public function serverInfoGet() { - list($response) = $this->serverInfoGetWithHttpInfo($xAcceptVersion); + list($response) = $this->serverInfoGetWithHttpInfo(); return $response; } @@ -109,16 +108,15 @@ public function serverInfoGet($xAcceptVersion = null) * * Get server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) */ - public function serverInfoGetWithHttpInfo($xAcceptVersion = null) + public function serverInfoGetWithHttpInfo() { $returnType = '\Swagger\Client\Model\InlineResponse200'; - $request = $this->serverInfoGetRequest($xAcceptVersion); + $request = $this->serverInfoGetRequest(); try { $options = $this->createHttpClientOption(); @@ -184,14 +182,13 @@ public function serverInfoGetWithHttpInfo($xAcceptVersion = null) * * Get server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverInfoGetAsync($xAcceptVersion = null) + public function serverInfoGetAsync() { - return $this->serverInfoGetAsyncWithHttpInfo($xAcceptVersion) + return $this->serverInfoGetAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -204,15 +201,14 @@ function ($response) { * * Get server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverInfoGetAsyncWithHttpInfo($xAcceptVersion = null) + public function serverInfoGetAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\InlineResponse200'; - $request = $this->serverInfoGetRequest($xAcceptVersion); + $request = $this->serverInfoGetRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -254,12 +250,11 @@ function ($exception) { /** * Create request for operation 'serverInfoGet' * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverInfoGetRequest($xAcceptVersion = null) + protected function serverInfoGetRequest() { $resourcePath = '/server-info'; @@ -269,10 +264,6 @@ protected function serverInfoGetRequest($xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -344,15 +335,14 @@ protected function serverInfoGetRequest($xAcceptVersion = null) * * Get the SUPLA Server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\InlineResponse2001 */ - public function serverStatusGet($xAcceptVersion = null) + public function serverStatusGet() { - list($response) = $this->serverStatusGetWithHttpInfo($xAcceptVersion); + list($response) = $this->serverStatusGetWithHttpInfo(); return $response; } @@ -361,16 +351,15 @@ public function serverStatusGet($xAcceptVersion = null) * * Get the SUPLA Server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\InlineResponse2001, HTTP status code, HTTP response headers (array of strings) */ - public function serverStatusGetWithHttpInfo($xAcceptVersion = null) + public function serverStatusGetWithHttpInfo() { $returnType = '\Swagger\Client\Model\InlineResponse2001'; - $request = $this->serverStatusGetRequest($xAcceptVersion); + $request = $this->serverStatusGetRequest(); try { $options = $this->createHttpClientOption(); @@ -444,14 +433,13 @@ public function serverStatusGetWithHttpInfo($xAcceptVersion = null) * * Get the SUPLA Server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverStatusGetAsync($xAcceptVersion = null) + public function serverStatusGetAsync() { - return $this->serverStatusGetAsyncWithHttpInfo($xAcceptVersion) + return $this->serverStatusGetAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -464,15 +452,14 @@ function ($response) { * * Get the SUPLA Server status * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverStatusGetAsyncWithHttpInfo($xAcceptVersion = null) + public function serverStatusGetAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\InlineResponse2001'; - $request = $this->serverStatusGetRequest($xAcceptVersion); + $request = $this->serverStatusGetRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -514,12 +501,11 @@ function ($exception) { /** * Create request for operation 'serverStatusGet' * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverStatusGetRequest($xAcceptVersion = null) + protected function serverStatusGetRequest() { $resourcePath = '/server-status'; @@ -529,10 +515,6 @@ protected function serverStatusGetRequest($xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index e28d0a7..020a941 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -93,15 +93,14 @@ public function getConfig() * Edit current user * * @param \Swagger\Client\Model\Body $body body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\InlineResponse2002 */ - public function editCurrentUser($body, $xAcceptVersion = null) + public function editCurrentUser($body) { - list($response) = $this->editCurrentUserWithHttpInfo($body, $xAcceptVersion); + list($response) = $this->editCurrentUserWithHttpInfo($body); return $response; } @@ -111,16 +110,15 @@ public function editCurrentUser($body, $xAcceptVersion = null) * Edit current user * * @param \Swagger\Client\Model\Body $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\InlineResponse2002, HTTP status code, HTTP response headers (array of strings) */ - public function editCurrentUserWithHttpInfo($body, $xAcceptVersion = null) + public function editCurrentUserWithHttpInfo($body) { $returnType = '\Swagger\Client\Model\InlineResponse2002'; - $request = $this->editCurrentUserRequest($body, $xAcceptVersion); + $request = $this->editCurrentUserRequest($body); try { $options = $this->createHttpClientOption(); @@ -187,14 +185,13 @@ public function editCurrentUserWithHttpInfo($body, $xAcceptVersion = null) * Edit current user * * @param \Swagger\Client\Model\Body $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editCurrentUserAsync($body, $xAcceptVersion = null) + public function editCurrentUserAsync($body) { - return $this->editCurrentUserAsyncWithHttpInfo($body, $xAcceptVersion) + return $this->editCurrentUserAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -208,15 +205,14 @@ function ($response) { * Edit current user * * @param \Swagger\Client\Model\Body $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editCurrentUserAsyncWithHttpInfo($body, $xAcceptVersion = null) + public function editCurrentUserAsyncWithHttpInfo($body) { $returnType = '\Swagger\Client\Model\InlineResponse2002'; - $request = $this->editCurrentUserRequest($body, $xAcceptVersion); + $request = $this->editCurrentUserRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -259,12 +255,11 @@ function ($exception) { * Create request for operation 'editCurrentUser' * * @param \Swagger\Client\Model\Body $body (required) - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function editCurrentUserRequest($body, $xAcceptVersion = null) + protected function editCurrentUserRequest($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { @@ -280,10 +275,6 @@ protected function editCurrentUserRequest($body, $xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params @@ -362,15 +353,14 @@ protected function editCurrentUserRequest($body, $xAcceptVersion = null) * * Get current user * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\UserRequest */ - public function getCurrentUser($xAcceptVersion = null) + public function getCurrentUser() { - list($response) = $this->getCurrentUserWithHttpInfo($xAcceptVersion); + list($response) = $this->getCurrentUserWithHttpInfo(); return $response; } @@ -379,16 +369,15 @@ public function getCurrentUser($xAcceptVersion = null) * * Get current user * - * @param string $xAcceptVersion API Version (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\UserRequest, HTTP status code, HTTP response headers (array of strings) */ - public function getCurrentUserWithHttpInfo($xAcceptVersion = null) + public function getCurrentUserWithHttpInfo() { $returnType = '\Swagger\Client\Model\UserRequest'; - $request = $this->getCurrentUserRequest($xAcceptVersion); + $request = $this->getCurrentUserRequest(); try { $options = $this->createHttpClientOption(); @@ -454,14 +443,13 @@ public function getCurrentUserWithHttpInfo($xAcceptVersion = null) * * Get current user * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentUserAsync($xAcceptVersion = null) + public function getCurrentUserAsync() { - return $this->getCurrentUserAsyncWithHttpInfo($xAcceptVersion) + return $this->getCurrentUserAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -474,15 +462,14 @@ function ($response) { * * Get current user * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentUserAsyncWithHttpInfo($xAcceptVersion = null) + public function getCurrentUserAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\UserRequest'; - $request = $this->getCurrentUserRequest($xAcceptVersion); + $request = $this->getCurrentUserRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -524,12 +511,11 @@ function ($exception) { /** * Create request for operation 'getCurrentUser' * - * @param string $xAcceptVersion API Version (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCurrentUserRequest($xAcceptVersion = null) + protected function getCurrentUserRequest() { $resourcePath = '/users/current'; @@ -539,10 +525,6 @@ protected function getCurrentUserRequest($xAcceptVersion = null) $httpBody = ''; $multipart = false; - // header params - if ($xAcceptVersion !== null) { - $headerParams['X-Accept-Version'] = ObjectSerializer::toHeaderValue($xAcceptVersion); - } // body params diff --git a/lib/Configuration.php b/lib/Configuration.php index 3c8e38a..dd575fd 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -81,7 +81,7 @@ class Configuration * * @var string */ - protected $host = 'https://cloud.supla.org/api'; + protected $host = 'https://cloud.supla.org/api/v2.2.0'; /** * User agent of the HTTP request, set to "PHP-Swagger" by default diff --git a/lib/Model/Channel.php b/lib/Model/Channel.php index 2b28740..0ce3001 100644 --- a/lib/Model/Channel.php +++ b/lib/Model/Channel.php @@ -565,7 +565,7 @@ public function getInheritedLocation() /** * Sets inheritedLocation * - * @param bool $inheritedLocation Whether this channel inherits its IODevice's location (`true`) or not (`false`) + * @param bool $inheritedLocation Whether this channel inherits its IO Device's location (`true`) or not (`false`) * * @return $this */ diff --git a/swagger.json b/swagger.json index 656d5ce..1e5507d 100644 --- a/swagger.json +++ b/swagger.json @@ -5,7 +5,7 @@ "title" : "SUPLA Cloud API" }, "host" : "cloud.supla.org", - "basePath" : "/api", + "basePath" : "/api/v2.2.0", "schemes" : [ "https", "http" ], "consumes" : [ "application/json" ], "produces" : [ "application/json" ], @@ -17,15 +17,7 @@ "get" : { "tags" : [ "Server" ], "summary" : "Get server status", - "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - } ], + "parameters" : [ ], "responses" : { "200" : { "description" : "Server status", @@ -41,15 +33,7 @@ "get" : { "tags" : [ "Server" ], "summary" : "Get the SUPLA Server status", - "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - } ], + "parameters" : [ ], "responses" : { "200" : { "description" : "SUPLA Server is alive", @@ -72,15 +56,7 @@ "tags" : [ "Users" ], "summary" : "Get current user", "operationId" : "getCurrentUser", - "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - } ], + "parameters" : [ ], "responses" : { "200" : { "description" : "Success", @@ -95,14 +71,6 @@ "summary" : "Edit current user", "operationId" : "editCurrentUser", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "in" : "body", "name" : "body", "required" : true, @@ -126,14 +94,6 @@ "summary" : "Get locations list", "operationId" : "getLocations", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -161,15 +121,7 @@ "tags" : [ "Locations" ], "summary" : "Create a new location", "operationId" : "createLocation", - "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - } ], + "parameters" : [ ], "responses" : { "201" : { "description" : "Newely created location with automatic name", @@ -186,14 +138,6 @@ "summary" : "Get location by ID", "operationId" : "getLocation", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -224,14 +168,6 @@ "summary" : "Edit location", "operationId" : "updateLocation", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -269,14 +205,6 @@ "summary" : "Delete location", "operationId" : "deleteLocation", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -306,14 +234,6 @@ "summary" : "Get channels list", "operationId" : "getChannels", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -367,14 +287,6 @@ "summary" : "Get channel by ID", "operationId" : "getChannel", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -405,14 +317,6 @@ "summary" : "Update channel", "operationId" : "updateChannel", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -445,14 +349,6 @@ "summary" : "Execute action on the channel", "operationId" : "executeAction", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -485,14 +381,6 @@ "summary" : "Get schedules list of the channel", "operationId" : "getChannelSchedules", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -530,14 +418,6 @@ "operationId" : "getChannelMeasurementLogsCsvFile", "produces" : [ "application/zip" ], "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -566,14 +446,6 @@ "description" : "Supported channel functions: `THERMOMETER` and `HUMIDITYANDTEMPERATURE`. Logs ordered by date, descending.", "operationId" : "getChannelMeasurementLogs", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -623,14 +495,6 @@ "summary" : "Get channels list", "operationId" : "getChannelGroups", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -659,14 +523,6 @@ "summary" : "Create a new channel group", "operationId" : "createChannelGroup", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "in" : "body", "name" : "body", "required" : true, @@ -690,14 +546,6 @@ "summary" : "Get channel group by ID", "operationId" : "getChannelGroup", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -728,14 +576,6 @@ "summary" : "Update channel group", "operationId" : "updateChannelGroup", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -762,14 +602,6 @@ "summary" : "Delete Channel Group", "operationId" : "deleteChannelGroup", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -786,14 +618,6 @@ "summary" : "Execute action on the channel group", "operationId" : "executeChannelGroupAction", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -826,14 +650,6 @@ "summary" : "Get client apps", "operationId" : "getClientApps", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -864,14 +680,6 @@ "summary" : "Update client app", "operationId" : "updateClientApp", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -898,14 +706,6 @@ "summary" : "Delete Client App", "operationId" : "deleteClientApp", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -924,14 +724,6 @@ "summary" : "Get IO Devices", "operationId" : "getIoDevices", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -962,14 +754,6 @@ "summary" : "Get IO Device", "operationId" : "getIoDevice", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1000,14 +784,6 @@ "summary" : "Update IO Device", "operationId" : "updateIoDevice", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1034,14 +810,6 @@ "summary" : "Delete IO Device", "operationId" : "deleteIoDevice", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1060,14 +828,6 @@ "summary" : "Get Channels that belong to IO Deice", "operationId" : "getIoDeviceChannels", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1100,14 +860,6 @@ "summary" : "Get schedules list", "operationId" : "getSchedules", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -1136,14 +888,6 @@ "summary" : "Create a new schedule", "operationId" : "createSchedule", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "in" : "body", "name" : "body", "required" : true, @@ -1165,14 +909,6 @@ "summary" : "Enable schedules", "operationId" : "enableSchedules", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "in" : "body", "name" : "body", "required" : true, @@ -1193,14 +929,6 @@ "summary" : "Get Schedule", "operationId" : "getSchedule", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1231,14 +959,6 @@ "summary" : "Update schedule", "operationId" : "updateSchedule", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1272,14 +992,6 @@ "summary" : "Delete Schedule", "operationId" : "deleteSchedule", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1296,15 +1008,8 @@ "get" : { "tags" : [ "Access IDs" ], "summary" : "Get Access IDs list", + "operationId" : "getAccessID", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "include", "in" : "query", "description" : "Specify what extra fields to include in the response.", @@ -1331,15 +1036,8 @@ "post" : { "tags" : [ "Access IDs" ], "summary" : "Create a new Access ID", - "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - } ], + "operationId" : "createAccessID", + "parameters" : [ ], "responses" : { "201" : { "description" : "Newely created AccessID with automatic name", @@ -1356,14 +1054,6 @@ "summary" : "Get Access ID", "operationId" : "getAccessID", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1394,14 +1084,6 @@ "summary" : "Edit Access ID", "operationId" : "updateAccessID", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1428,14 +1110,6 @@ "summary" : "Delete Access Identifier", "operationId" : "deleteAccessID", "parameters" : [ { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, { "name" : "id", "in" : "path", "required" : true, @@ -1641,7 +1315,7 @@ }, "inheritedLocation" : { "type" : "boolean", - "description" : "Whether this channel inherits its IODevice's location (`true`) or not (`false`)" + "description" : "Whether this channel inherits its IO Device's location (`true`) or not (`false`)" }, "iodeviceId" : { "type" : "integer" @@ -5369,15 +5043,6 @@ } }, "parameters" : { - "version" : { - "name" : "X-Accept-Version", - "in" : "header", - "description" : "API Version", - "required" : false, - "type" : "string", - "x-example" : "2.2.0", - "enum" : [ "2.0.0", "2.1.0", "2.2.0" ] - }, "AccessIdIncludes" : { "name" : "include", "in" : "query", From 43880ba26f62fc2bb386b4f6aef0e94af66fd217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 14:03:07 +0200 Subject: [PATCH 07/13] Provide SuplaApi wrapper implementation --- src/SuplaApi.php | 25 ++++++++++++++++++++----- src/SuplaApiConfiguration.php | 4 ++-- src/demo.php | 9 +++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/SuplaApi.php b/src/SuplaApi.php index 5a7940c..aad8c13 100644 --- a/src/SuplaApi.php +++ b/src/SuplaApi.php @@ -1,10 +1,20 @@ token = $response['access_token']; } - /** @return UsersApi */ - public function users() { - return new UsersApi($this->httpClient, new SuplaApiConfiguration($this->server, $this->retrieveToken())); + public function __call($name, $arguments) { + $apiName = ucfirst($name); + $apiClass = "Swagger\\Client\\Api\\${apiName}Api"; + if (class_exists($apiClass)) { + return new $apiClass($this->httpClient, new SuplaApiConfiguration($this->server, $this->retrieveToken())); + } else { + throw new \BadMethodCallException($name); + } } } diff --git a/src/SuplaApiConfiguration.php b/src/SuplaApiConfiguration.php index 4c76a24..74dfb56 100644 --- a/src/SuplaApiConfiguration.php +++ b/src/SuplaApiConfiguration.php @@ -15,14 +15,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -namespace SuplaApi\Client; +namespace Supla\ApiClient; use Swagger\Client\Configuration; class SuplaApiConfiguration extends Configuration { public function __construct($server, $token) { parent::__construct(); - $this->host = $server . '/api'; + $this->host = $server . '/api/v2.2.0'; $this->accessToken = $token; } } diff --git a/src/demo.php b/src/demo.php index eaa88fd..4d6e386 100644 --- a/src/demo.php +++ b/src/demo.php @@ -1,4 +1,7 @@ users()->getCurrentUser(); -echo $user->getEmail(); -$api->users()->editCurrentUser(new \Swagger\Client\Model\Body(['action' => \Swagger\Client\Model\Body::ACTION_CHANGEPASSWORD])); +echo $api->channelGroups()->getChannelGroup(1)->getCaption(); From 9efabd88e5ef518c8983f983ef06f208cea31930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 14:04:22 +0200 Subject: [PATCH 08/13] Delete old SuplaApiClient --- src/SuplaApi.php | 15 ++ src/SuplaApiClient.php | 310 ---------------------------------- src/SuplaApiConfiguration.php | 4 +- src/demo.php | 30 ---- 4 files changed, 18 insertions(+), 341 deletions(-) delete mode 100644 src/SuplaApiClient.php diff --git a/src/SuplaApi.php b/src/SuplaApi.php index aad8c13..af38353 100644 --- a/src/SuplaApi.php +++ b/src/SuplaApi.php @@ -1,4 +1,19 @@ server = $server_params['server']; - $this->clientId = $server_params['clientId']; - $this->secret = $server_params['secret']; - $this->username = $server_params['username']; - $this->password = $server_params['password']; - - $this->debug = $debug; - $this->sslVerify = $sslVerify; - $this->token = null; - $this->auto_logout = $auto_logout; - } - - private function setLastError($error) { - $this->last_error = $error; - } - - private function remoteRequest($data, $path, $method = 'POST', $bearer = false) { - - $data_string = ''; - $result = false; - $access_token = null; - - if ($bearer && ($access_token = $this->getAccessToken()) == '') { - return false; - } - - if ($method == 'GET') { - $data_string = @http_build_query($data); - - if ($data_string !== false) { - $path .= '/' . $data_string; - $data_string = null; - } - } else { - $data_string = json_encode($data); - } - - $ch = curl_init('https://' . $this->server . $path); - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - - if ($method != 'GET') { - curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); - } - - if ($bearer) { - curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $access_token]); - } else { - if (strlen(@$data_string) > 0) { - curl_setopt($ch, CURLOPT_HTTPHEADER, [ - 'Content-Type: application/json', - 'Content-Length: ' . strlen($data_string)]); - } - } - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - if (!$this->sslVerify) { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - } - $cresult = curl_exec($ch); - $result = false; - - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - - if (curl_errno($ch) == 0) { - if ($code === 200) { - $result = json_decode($cresult); - } else { - $this->setLastError("HTTP: " . $code); - } - } else { - $this->setLastError("CURL ERR: " . curl_error($ch)); - } - - if ($this->debug) { - var_dump($cresult); - var_dump($result); - echo $this->getLastError() . PHP_EOL; - } - - curl_close($ch); - return $result; - } - - private function tokenRequest() { - $params = ["client_id" => $this->clientId, - "client_secret" => $this->secret, - "grant_type" => 'password', - "username" => $this->username, - "password" => $this->password]; - $result = $this->remoteRequest($params, '/oauth/v2/token'); - if ($result !== false && @$result->token_type == 'bearer') { - $result->expires_in = time() + intval(@$result->expires_in); - $this->token = $result; - return true; - } elseif ($result === false && $this->last_error === null) { - $this->setLastError('Unknown error'); - } - $this->token = null; - return false; - } - - private function accessTokenExists() { - return $this->token !== null && $this->token->expires_in > time() + 5 && $this->token->access_token != ''; - } - - private function getAccessToken() { - if ($this->accessTokenExists() == false) { - $this->tokenRequest(); - } - return @$this->token->access_token; - } - - private function autoLogout() { - if ($this->auto_logout === true) { - $this->logout(); - } - } - - private function apiGET($path, $data = null) { - if (is_array($data)) { - foreach ($data as $value) { - $path .= '/' . urlencode($value); - } - } - $result = $this->remoteRequest(null, $path, 'GET', true); - return $result; - } - - private function apiP($path, $method, $data = null) { - $result = $this->remoteRequest($data, $path, $method, true); - if ($result !== false) { - return @$result->data; - } - return false; - } - - private function apiPUT($path, $data = null) { - return $this->apiP($path, 'PUT', $data); - } - - private function apiPATCH($path, $data = null) { - return $this->apiP($path, 'PATCH', $data); - } - - private function getResult($path) { - $result = $this->apiGET('/api' . $path); - $this->autoLogout(); - return $result; - } - - private function put($path, $data = null) { - $result = $this->apiPUT('/api' . $path, $data); - $this->autoLogout(); - return $result; - } - - private function patch($path, $data = null) { - $result = $this->apiPATCH('/api' . $path, $data); - $this->autoLogout(); - return $result; - } - - public function getLastError() { - return $this->last_error; - } - - public function setDebug($debug) { - $this->debug = $debug; - } - - public function setAutoLogout($auto_logout) { - $this->auto_logout = $auto_logout; - } - - public function getToken() { - $this->getAccessToken(); - return serialize($this->token); - } - - public function setToken($token) { - $this->token = unserialize($token); - } - - public function logout() { - if ($this->accessTokenExists()) { - $this->apiGET('/api/logout', [@$this->token->refresh_token]); - } - $this->token = null; - } - - public function getServerInfo() { - return $this->getResult('/server-info'); - } - - public function locations() { - return $this->getResult('/locations'); - } - - public function accessIDs() { - return $this->getResult('/accessids'); - } - - public function ioDevices() { - return $this->getResult('/iodevices'); - } - - public function ioDevice($devid) { - return $this->getResult('/iodevices/' . $devid); - } - - public function temperatureLogItemCount($channelid) { - return $this->getResult('/channels/' . $channelid . '/temperature-log-count'); - } - - public function temperatureLogGetItems($channelid, $offset = 0, $limit = 0) { - return $this->getResult('/channels/' . $channelid . '/temperature-log-items?offset=' . $offset . '&limit=' . $limit); - } - - public function temperatureAndHumidityLogItemCount($channelid) { - return $this->getResult('/channels/' . $channelid . '/temperature-and-humidity-count'); - } - - public function temperatureAndHumidityLogGetItems($channelid, $offset = 0, $limit = 0) { - return $this->getResult('/channels/' . $channelid . '/temperature-and-humidity-items?offset=' . $offset . '&limit=' . $limit); - } - - public function channel($channelid) { - return $this->getResult('/channels/' . $channelid); - } - - public function channelSetRGBW($channelid, $color, $color_brightness, $brightness) { - $data = ['color' => $color, - 'color_brightness' => $color_brightness, - 'brightness' => $brightness]; - return $this->put('/channels/' . $channelid, $data); - } - - public function channelSetRGB($channelid, $color, $color_brightness) { - $data = ['color' => $color, - 'color_brightness' => $color_brightness]; - return $this->put('/channels/' . $channelid, $data); - } - - public function channelSetBrightness($channelid, $brightness) { - $data = ['brightness' => $brightness]; - return $this->put('/channels/' . $channelid, $data); - } - - public function channelTurnOn($channelid) { - return $this->patch('/channels/' . $channelid, ['action' => 'turn-on']); - } - - public function channelTurnOff($channelid) { - return $this->patch('/channels/' . $channelid, ['action' => 'turn-off']); - } - - public function channelOpen($channelid) { - return $this->patch('/channels/' . $channelid, ['action' => 'open']); - } - - public function channelOpenClose($channelid) { - return $this->patch('/channels/' . $channelid, ['action' => 'open-close']); - } - - public function channelShut($channelid, $percent = 100) { - return $this->patch('/channels/' . $channelid, ['action' => 'shut', 'percent' => $percent]); - } - - public function channelReveal($channelid, $percent = 100) { - return $this->patch('/channels/' . $channelid, ['action' => 'reveal', 'percent' => $percent]); - } - - public function channelStop($channelid) { - return $this->patch('/channels/' . $channelid, ['action' => 'stop']); - } -} diff --git a/src/SuplaApiConfiguration.php b/src/SuplaApiConfiguration.php index 74dfb56..a164669 100644 --- a/src/SuplaApiConfiguration.php +++ b/src/SuplaApiConfiguration.php @@ -20,9 +20,11 @@ use Swagger\Client\Configuration; class SuplaApiConfiguration extends Configuration { + const VERSION = '2.2.0'; + public function __construct($server, $token) { parent::__construct(); - $this->host = $server . '/api/v2.2.0'; + $this->host = $server . '/api/v' . self::VERSION; $this->accessToken = $token; } } diff --git a/src/demo.php b/src/demo.php index 4d6e386..45a9b10 100644 --- a/src/demo.php +++ b/src/demo.php @@ -4,36 +4,6 @@ require_once(__DIR__ . '/../vendor/autoload.php'); -//// Configure API key authorization: bearer -//$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); -//// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); -//// Configure OAuth2 access token for authorization: password -//$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -// -//$apiInstance = new Swagger\Client\Api\ChannelsApi( -//// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. -//// This is optional, `GuzzleHttp\Client` will be used as default. -// new GuzzleHttp\Client(), -// $config -//); -//$x_accept_version = "x_accept_version_example"; // string | API Version -//$include = array("include_example"); // string[] | Specify what extra fields to include in the response. -//$function = array("function_example"); // string[] | -//$io = "io_example"; // string | Return only `input` or `output` channels. -//$has_function = true; // bool | Return only channels with (`true`) or without (`false`) chosen functions. -// -//try { -// $result = $apiInstance->getChannels($x_accept_version, $include, $function, $io, $has_function); -// foreach ($result as $channel) { -// $channel->getIodevice()-> -// } -// print_r($result); -//} catch (Exception $e) { -// echo 'Exception when calling ChannelsApi->getChannels: ', $e->getMessage(), PHP_EOL; -//} - - $api = new SuplaApi( 'http://supla.local', '1_6cabrio4xdcsw8sk4socc04k00os4ssw88wc0kkws0g4ogkwgg', From bdea37bdb226569241ab51c1b2e5ae0c9bf734a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 14:45:05 +0200 Subject: [PATCH 09/13] Names for all entities --- README.md | 44 +- codegen-template/api_doc.mustache | 2 +- docs/Api/AccessIDsApi.md | 10 +- docs/Api/ChannelGroupsApi.md | 16 +- docs/Api/ChannelsApi.md | 12 +- docs/Api/ClientAppsApi.md | 6 +- docs/Api/IODevicesApi.md | 6 +- docs/Api/LocationsApi.md | 10 +- docs/Api/SchedulesApi.md | 8 +- docs/Api/ServerApi.md | 7 +- docs/Api/UsersApi.md | 29 +- .../{Body10.md => AccessIDUpdateRequest.md} | 2 +- docs/Model/Body5.md | 14 - ...> ChannelActionExecutionFailedResponse.md} | 2 +- ...ody6.md => ChannelExecuteActionRequest.md} | 2 +- ...md => ChannelGroupExecuteActionRequest.md} | 2 +- .../{Body4.md => ChannelGroupRequest.md} | 2 +- ...sponse2003.md => ChannelMeasurementLog.md} | 2 +- ... => ChannelUnsupportedFunctionResponse.md} | 2 +- ...d => ChannelUpdateConfirmationResponse.md} | 2 +- .../{Body2.md => ChannelUpdateRequest.md} | 2 +- .../{Body7.md => ClientAppUpdateRequest.md} | 2 +- .../{Body8.md => IODeviceUpdateRequest.md} | 2 +- docs/Model/InlineResponse2001.md | 10 - docs/Model/InlineResponse2002.md | 10 - docs/Model/InlineResponse503.md | 10 - .../{Body1.md => LocationUpdateRequest.md} | 2 +- .../{Body9.md => SchedulesEnableRequest.md} | 2 +- .../{InlineResponse200.md => ServerInfo.md} | 4 +- ...se200Timezone.md => ServerInfoTimezone.md} | 2 +- docs/Model/{UserRequest.md => UserData.md} | 2 +- docs/Model/{Body.md => UserUpdateRequest.md} | 2 +- lib/Api/AccessIDsApi.php | 18 +- lib/Api/ChannelGroupsApi.php | 32 +- lib/Api/ChannelsApi.php | 38 +- lib/Api/ClientAppsApi.php | 10 +- lib/Api/IODevicesApi.php | 10 +- lib/Api/LocationsApi.php | 18 +- lib/Api/SchedulesApi.php | 10 +- lib/Api/ServerApi.php | 69 +- lib/Api/UsersApi.php | 163 +- .../{Body10.php => AccessIDUpdateRequest.php} | 8 +- lib/Model/Body5.php | 421 -- ... ChannelActionExecutionFailedResponse.php} | 8 +- ...y6.php => ChannelExecuteActionRequest.php} | 8 +- ...p => ChannelGroupExecuteActionRequest.php} | 8 +- .../{Body4.php => ChannelGroupRequest.php} | 8 +- ...onse2003.php => ChannelMeasurementLog.php} | 8 +- ...=> ChannelUnsupportedFunctionResponse.php} | 8 +- ... => ChannelUpdateConfirmationResponse.php} | 8 +- .../{Body2.php => ChannelUpdateRequest.php} | 8 +- .../{Body7.php => ClientAppUpdateRequest.php} | 8 +- .../{Body8.php => IODeviceUpdateRequest.php} | 8 +- lib/Model/InlineResponse2001.php | 301 -- lib/Model/InlineResponse2002.php | 301 -- lib/Model/InlineResponse503.php | 301 -- .../{Body1.php => LocationUpdateRequest.php} | 8 +- .../{Body9.php => SchedulesEnableRequest.php} | 8 +- .../{InlineResponse200.php => ServerInfo.php} | 14 +- ...200Timezone.php => ServerInfoTimezone.php} | 8 +- lib/Model/{UserRequest.php => UserData.php} | 8 +- lib/Model/{Body.php => UserUpdateRequest.php} | 8 +- swagger.json | 3858 ++++++++++++----- 63 files changed, 3124 insertions(+), 2798 deletions(-) rename docs/Model/{Body10.md => AccessIDUpdateRequest.md} (96%) delete mode 100644 docs/Model/Body5.md rename docs/Model/{InlineResponse400.md => ChannelActionExecutionFailedResponse.md} (90%) rename docs/Model/{Body6.md => ChannelExecuteActionRequest.md} (93%) rename docs/Model/{Body3.md => ChannelGroupExecuteActionRequest.md} (92%) rename docs/Model/{Body4.md => ChannelGroupRequest.md} (95%) rename docs/Model/{InlineResponse2003.md => ChannelMeasurementLog.md} (95%) rename docs/Model/{InlineResponse4001.md => ChannelUnsupportedFunctionResponse.md} (90%) rename docs/Model/{InlineResponse409.md => ChannelUpdateConfirmationResponse.md} (94%) rename docs/Model/{Body2.md => ChannelUpdateRequest.md} (96%) rename docs/Model/{Body7.md => ClientAppUpdateRequest.md} (94%) rename docs/Model/{Body8.md => IODeviceUpdateRequest.md} (94%) delete mode 100644 docs/Model/InlineResponse2001.md delete mode 100644 docs/Model/InlineResponse2002.md delete mode 100644 docs/Model/InlineResponse503.md rename docs/Model/{Body1.md => LocationUpdateRequest.md} (95%) rename docs/Model/{Body9.md => SchedulesEnableRequest.md} (93%) rename docs/Model/{InlineResponse200.md => ServerInfo.md} (84%) rename docs/Model/{InlineResponse200Timezone.md => ServerInfoTimezone.md} (93%) rename docs/Model/{UserRequest.md => UserData.md} (97%) rename docs/Model/{Body.md => UserUpdateRequest.md} (96%) rename lib/Model/{Body10.php => AccessIDUpdateRequest.php} (97%) delete mode 100644 lib/Model/Body5.php rename lib/Model/{InlineResponse4001.php => ChannelActionExecutionFailedResponse.php} (96%) rename lib/Model/{Body6.php => ChannelExecuteActionRequest.php} (96%) rename lib/Model/{Body3.php => ChannelGroupExecuteActionRequest.php} (96%) rename lib/Model/{Body4.php => ChannelGroupRequest.php} (97%) rename lib/Model/{InlineResponse2003.php => ChannelMeasurementLog.php} (97%) rename lib/Model/{InlineResponse400.php => ChannelUnsupportedFunctionResponse.php} (96%) rename lib/Model/{InlineResponse409.php => ChannelUpdateConfirmationResponse.php} (96%) rename lib/Model/{Body2.php => ChannelUpdateRequest.php} (98%) rename lib/Model/{Body7.php => ClientAppUpdateRequest.php} (97%) rename lib/Model/{Body8.php => IODeviceUpdateRequest.php} (97%) delete mode 100644 lib/Model/InlineResponse2001.php delete mode 100644 lib/Model/InlineResponse2002.php delete mode 100644 lib/Model/InlineResponse503.php rename lib/Model/{Body1.php => LocationUpdateRequest.php} (97%) rename lib/Model/{Body9.php => SchedulesEnableRequest.php} (96%) rename lib/Model/{InlineResponse200.php => ServerInfo.php} (96%) rename lib/Model/{InlineResponse200Timezone.php => ServerInfoTimezone.php} (96%) rename lib/Model/{UserRequest.php => UserData.php} (98%) rename lib/Model/{Body.php => UserUpdateRequest.php} (97%) diff --git a/README.md b/README.md index 6fa8fa2..0abc414 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Class | Method | HTTP request | Description *AccessIDsApi* | [**deleteAccessID**](docs/Api/AccessIDsApi.md#deleteaccessid) | **DELETE** /accessids/{id} | Delete Access Identifier *AccessIDsApi* | [**getAccessID**](docs/Api/AccessIDsApi.md#getaccessid) | **GET** /accessids | Get Access IDs list *AccessIDsApi* | [**getAccessID_0**](docs/Api/AccessIDsApi.md#getaccessid_0) | **GET** /accessids/{id} | Get Access ID -*AccessIDsApi* | [**updateAccessID**](docs/Api/AccessIDsApi.md#updateaccessid) | **PUT** /accessids/{id} | Edit Access ID +*AccessIDsApi* | [**updateAccessID**](docs/Api/AccessIDsApi.md#updateaccessid) | **PUT** /accessids/{id} | Update Access ID *ChannelGroupsApi* | [**createChannelGroup**](docs/Api/ChannelGroupsApi.md#createchannelgroup) | **POST** /channel-groups | Create a new channel group *ChannelGroupsApi* | [**deleteChannelGroup**](docs/Api/ChannelGroupsApi.md#deletechannelgroup) | **DELETE** /channel-groups/{id} | Delete Channel Group *ChannelGroupsApi* | [**executeChannelGroupAction**](docs/Api/ChannelGroupsApi.md#executechannelgroupaction) | **PATCH** /channel-groups/{id} | Execute action on the channel group @@ -76,7 +76,7 @@ Class | Method | HTTP request | Description *LocationsApi* | [**deleteLocation**](docs/Api/LocationsApi.md#deletelocation) | **DELETE** /locations/{id} | Delete location *LocationsApi* | [**getLocation**](docs/Api/LocationsApi.md#getlocation) | **GET** /locations/{id} | Get location by ID *LocationsApi* | [**getLocations**](docs/Api/LocationsApi.md#getlocations) | **GET** /locations | Get locations list -*LocationsApi* | [**updateLocation**](docs/Api/LocationsApi.md#updatelocation) | **PUT** /locations/{id} | Edit location +*LocationsApi* | [**updateLocation**](docs/Api/LocationsApi.md#updatelocation) | **PUT** /locations/{id} | Update location *SchedulesApi* | [**createSchedule**](docs/Api/SchedulesApi.md#createschedule) | **POST** /schedules | Create a new schedule *SchedulesApi* | [**deleteSchedule**](docs/Api/SchedulesApi.md#deleteschedule) | **DELETE** /schedules/{id} | Delete Schedule *SchedulesApi* | [**enableSchedules**](docs/Api/SchedulesApi.md#enableschedules) | **PATCH** /schedules | Enable schedules @@ -85,51 +85,47 @@ Class | Method | HTTP request | Description *SchedulesApi* | [**updateSchedule**](docs/Api/SchedulesApi.md#updateschedule) | **PUT** /schedules/{id} | Update schedule *ServerApi* | [**serverInfoGet**](docs/Api/ServerApi.md#serverinfoget) | **GET** /server-info | Get server status *ServerApi* | [**serverStatusGet**](docs/Api/ServerApi.md#serverstatusget) | **GET** /server-status | Get the SUPLA Server status -*UsersApi* | [**editCurrentUser**](docs/Api/UsersApi.md#editcurrentuser) | **PATCH** /users/current | Edit current user *UsersApi* | [**getCurrentUser**](docs/Api/UsersApi.md#getcurrentuser) | **GET** /users/current | Get current user +*UsersApi* | [**updateCurrentUser**](docs/Api/UsersApi.md#updatecurrentuser) | **PATCH** /users/current | Update current user ## Documentation For Models - [AccessID](docs/Model/AccessID.md) - - [Body](docs/Model/Body.md) - - [Body1](docs/Model/Body1.md) - - [Body10](docs/Model/Body10.md) - - [Body2](docs/Model/Body2.md) - - [Body3](docs/Model/Body3.md) - - [Body4](docs/Model/Body4.md) - - [Body5](docs/Model/Body5.md) - - [Body6](docs/Model/Body6.md) - - [Body7](docs/Model/Body7.md) - - [Body8](docs/Model/Body8.md) - - [Body9](docs/Model/Body9.md) + - [AccessIDUpdateRequest](docs/Model/AccessIDUpdateRequest.md) - [Channel](docs/Model/Channel.md) + - [ChannelActionExecutionFailedResponse](docs/Model/ChannelActionExecutionFailedResponse.md) + - [ChannelExecuteActionRequest](docs/Model/ChannelExecuteActionRequest.md) - [ChannelFunction](docs/Model/ChannelFunction.md) - [ChannelFunctionAction](docs/Model/ChannelFunctionAction.md) - [ChannelFunctionActionEnum](docs/Model/ChannelFunctionActionEnum.md) - [ChannelFunctionEnumNames](docs/Model/ChannelFunctionEnumNames.md) - [ChannelGroup](docs/Model/ChannelGroup.md) + - [ChannelGroupExecuteActionRequest](docs/Model/ChannelGroupExecuteActionRequest.md) + - [ChannelGroupRequest](docs/Model/ChannelGroupRequest.md) + - [ChannelMeasurementLog](docs/Model/ChannelMeasurementLog.md) - [ChannelParam](docs/Model/ChannelParam.md) - [ChannelType](docs/Model/ChannelType.md) + - [ChannelUnsupportedFunctionResponse](docs/Model/ChannelUnsupportedFunctionResponse.md) + - [ChannelUpdateConfirmationResponse](docs/Model/ChannelUpdateConfirmationResponse.md) + - [ChannelUpdateRequest](docs/Model/ChannelUpdateRequest.md) - [ClientApp](docs/Model/ClientApp.md) + - [ClientAppUpdateRequest](docs/Model/ClientAppUpdateRequest.md) - [Device](docs/Model/Device.md) - - [InlineResponse200](docs/Model/InlineResponse200.md) - - [InlineResponse2001](docs/Model/InlineResponse2001.md) - - [InlineResponse2002](docs/Model/InlineResponse2002.md) - - [InlineResponse2003](docs/Model/InlineResponse2003.md) - - [InlineResponse200Timezone](docs/Model/InlineResponse200Timezone.md) - - [InlineResponse400](docs/Model/InlineResponse400.md) - - [InlineResponse4001](docs/Model/InlineResponse4001.md) - - [InlineResponse409](docs/Model/InlineResponse409.md) - - [InlineResponse503](docs/Model/InlineResponse503.md) + - [IODeviceUpdateRequest](docs/Model/IODeviceUpdateRequest.md) - [Location](docs/Model/Location.md) + - [LocationUpdateRequest](docs/Model/LocationUpdateRequest.md) - [Schedule](docs/Model/Schedule.md) - [ScheduleClosestExecutions](docs/Model/ScheduleClosestExecutions.md) - [ScheduleFuture](docs/Model/ScheduleFuture.md) - [SchedulePast](docs/Model/SchedulePast.md) - [ScheduleRequest](docs/Model/ScheduleRequest.md) - [ScheduleResult](docs/Model/ScheduleResult.md) - - [UserRequest](docs/Model/UserRequest.md) + - [SchedulesEnableRequest](docs/Model/SchedulesEnableRequest.md) + - [ServerInfo](docs/Model/ServerInfo.md) + - [ServerInfoTimezone](docs/Model/ServerInfoTimezone.md) + - [UserData](docs/Model/UserData.md) + - [UserUpdateRequest](docs/Model/UserUpdateRequest.md) ## Documentation For Authorization diff --git a/codegen-template/api_doc.mustache b/codegen-template/api_doc.mustache index 722078a..e41e85a 100644 --- a/codegen-template/api_doc.mustache +++ b/codegen-template/api_doc.mustache @@ -18,7 +18,7 @@ Method | HTTP request | Description ```php {{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -$result = $client->{{classVarName}}()->{{operationId}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} +{{#returnType}}$result = {{/returnType}}$client->{{classVarName}}()->{{operationId}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} print_r($result);{{/returnType}} ``` diff --git a/docs/Api/AccessIDsApi.md b/docs/Api/AccessIDsApi.md index 9bd2f58..723ff0a 100644 --- a/docs/Api/AccessIDsApi.md +++ b/docs/Api/AccessIDsApi.md @@ -6,7 +6,7 @@ Method | HTTP request | Description [**deleteAccessID**](AccessIDsApi.md#deleteAccessID) | **DELETE** /accessids/{id} | Delete Access Identifier [**getAccessID**](AccessIDsApi.md#getAccessID) | **GET** /accessids | Get Access IDs list [**getAccessID_0**](AccessIDsApi.md#getAccessID_0) | **GET** /accessids/{id} | Get Access ID -[**updateAccessID**](AccessIDsApi.md#updateAccessID) | **PUT** /accessids/{id} | Edit Access ID +[**updateAccessID**](AccessIDsApi.md#updateAccessID) | **PUT** /accessids/{id} | Update Access ID # **createAccessID** @@ -34,7 +34,7 @@ Delete Access Identifier ### Example ```php $id = 56; // int | -$result = $client->accessIDs()->deleteAccessID($id); +$client->accessIDs()->deleteAccessID($id); ``` @@ -99,12 +99,12 @@ Name | Type | Description | Notes # **updateAccessID** -Edit Access ID +Update Access ID ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body10(); // \Swagger\Client\Model\Body10 | +$body = new \Swagger\Client\Model\AccessIDUpdateRequest(); // \Swagger\Client\Model\AccessIDUpdateRequest | $result = $client->accessIDs()->updateAccessID($id, $body); print_r($result); ``` @@ -114,7 +114,7 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body10**](../Model/Body10.md)| | + **body** | [**\Swagger\Client\Model\AccessIDUpdateRequest**](../Model/AccessIDUpdateRequest.md)| | ### Return type diff --git a/docs/Api/ChannelGroupsApi.md b/docs/Api/ChannelGroupsApi.md index c076ec8..4c4475e 100644 --- a/docs/Api/ChannelGroupsApi.md +++ b/docs/Api/ChannelGroupsApi.md @@ -16,7 +16,7 @@ Create a new channel group ### Example ```php -$body = new \Swagger\Client\Model\Body4(); // \Swagger\Client\Model\Body4 | +$body = new \Swagger\Client\Model\ChannelGroupRequest(); // \Swagger\Client\Model\ChannelGroupRequest | $result = $client->channelGroups()->createChannelGroup($body); print_r($result); ``` @@ -25,7 +25,7 @@ print_r($result); ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Body4**](../Model/Body4.md)| | + **body** | [**\Swagger\Client\Model\ChannelGroupRequest**](../Model/ChannelGroupRequest.md)| | ### Return type @@ -40,7 +40,7 @@ Delete Channel Group ### Example ```php $id = 56; // int | -$result = $client->channelGroups()->deleteChannelGroup($id); +$client->channelGroups()->deleteChannelGroup($id); ``` @@ -62,8 +62,8 @@ Execute action on the channel group ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body6(); // \Swagger\Client\Model\Body6 | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). -$result = $client->channelGroups()->executeChannelGroupAction($id, $body); +$body = new \Swagger\Client\Model\ChannelGroupExecuteActionRequest(); // \Swagger\Client\Model\ChannelGroupExecuteActionRequest | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$client->channelGroups()->executeChannelGroupAction($id, $body); ``` @@ -71,7 +71,7 @@ $result = $client->channelGroups()->executeChannelGroupAction($id, $body); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body6**](../Model/Body6.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | + **body** | [**\Swagger\Client\Model\ChannelGroupExecuteActionRequest**](../Model/ChannelGroupExecuteActionRequest.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | ### Return type @@ -134,7 +134,7 @@ Update channel group ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body5(); // \Swagger\Client\Model\Body5 | +$body = new \Swagger\Client\Model\ChannelGroupRequest(); // \Swagger\Client\Model\ChannelGroupRequest | $result = $client->channelGroups()->updateChannelGroup($id, $body); print_r($result); ``` @@ -144,7 +144,7 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body5**](../Model/Body5.md)| | + **body** | [**\Swagger\Client\Model\ChannelGroupRequest**](../Model/ChannelGroupRequest.md)| | ### Return type diff --git a/docs/Api/ChannelsApi.md b/docs/Api/ChannelsApi.md index 3c74ef6..b6df58f 100644 --- a/docs/Api/ChannelsApi.md +++ b/docs/Api/ChannelsApi.md @@ -18,8 +18,8 @@ Execute action on the channel ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body3(); // \Swagger\Client\Model\Body3 | Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). -$result = $client->channels()->executeAction($id, $body); +$body = new \Swagger\Client\Model\ChannelExecuteActionRequest(); // \Swagger\Client\Model\ChannelExecuteActionRequest | Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$client->channels()->executeAction($id, $body); ``` @@ -27,7 +27,7 @@ $result = $client->channels()->executeAction($id, $body); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body3**](../Model/Body3.md)| Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | + **body** | [**\Swagger\Client\Model\ChannelExecuteActionRequest**](../Model/ChannelExecuteActionRequest.md)| Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | ### Return type @@ -85,7 +85,7 @@ Name | Type | Description | Notes ### Return type -[**\Swagger\Client\Model\InlineResponse2003[]**](../Model/InlineResponse2003.md) +[**\Swagger\Client\Model\ChannelMeasurementLog[]**](../Model/ChannelMeasurementLog.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) @@ -175,7 +175,7 @@ Update channel ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body2(); // \Swagger\Client\Model\Body2 | +$body = new \Swagger\Client\Model\ChannelUpdateRequest(); // \Swagger\Client\Model\ChannelUpdateRequest | $result = $client->channels()->updateChannel($id, $body); print_r($result); ``` @@ -185,7 +185,7 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body2**](../Model/Body2.md)| | + **body** | [**\Swagger\Client\Model\ChannelUpdateRequest**](../Model/ChannelUpdateRequest.md)| | ### Return type diff --git a/docs/Api/ClientAppsApi.md b/docs/Api/ClientAppsApi.md index 4a5016a..4e185e2 100644 --- a/docs/Api/ClientAppsApi.md +++ b/docs/Api/ClientAppsApi.md @@ -14,7 +14,7 @@ Delete Client App ### Example ```php $id = 56; // int | -$result = $client->clientApps()->deleteClientApp($id); +$client->clientApps()->deleteClientApp($id); ``` @@ -59,7 +59,7 @@ Update client app ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body7(); // \Swagger\Client\Model\Body7 | +$body = new \Swagger\Client\Model\ClientAppUpdateRequest(); // \Swagger\Client\Model\ClientAppUpdateRequest | $result = $client->clientApps()->updateClientApp($id, $body); print_r($result); ``` @@ -69,7 +69,7 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body7**](../Model/Body7.md)| | + **body** | [**\Swagger\Client\Model\ClientAppUpdateRequest**](../Model/ClientAppUpdateRequest.md)| | ### Return type diff --git a/docs/Api/IODevicesApi.md b/docs/Api/IODevicesApi.md index 77a538d..5f96232 100644 --- a/docs/Api/IODevicesApi.md +++ b/docs/Api/IODevicesApi.md @@ -16,7 +16,7 @@ Delete IO Device ### Example ```php $id = 56; // int | -$result = $client->iODevices()->deleteIoDevice($id); +$client->iODevices()->deleteIoDevice($id); ``` @@ -111,7 +111,7 @@ Update IO Device ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body8(); // \Swagger\Client\Model\Body8 | +$body = new \Swagger\Client\Model\IODeviceUpdateRequest(); // \Swagger\Client\Model\IODeviceUpdateRequest | $result = $client->iODevices()->updateIoDevice($id, $body); print_r($result); ``` @@ -121,7 +121,7 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body8**](../Model/Body8.md)| | + **body** | [**\Swagger\Client\Model\IODeviceUpdateRequest**](../Model/IODeviceUpdateRequest.md)| | ### Return type diff --git a/docs/Api/LocationsApi.md b/docs/Api/LocationsApi.md index cb4c19b..5ee9dd0 100644 --- a/docs/Api/LocationsApi.md +++ b/docs/Api/LocationsApi.md @@ -6,7 +6,7 @@ Method | HTTP request | Description [**deleteLocation**](LocationsApi.md#deleteLocation) | **DELETE** /locations/{id} | Delete location [**getLocation**](LocationsApi.md#getLocation) | **GET** /locations/{id} | Get location by ID [**getLocations**](LocationsApi.md#getLocations) | **GET** /locations | Get locations list -[**updateLocation**](LocationsApi.md#updateLocation) | **PUT** /locations/{id} | Edit location +[**updateLocation**](LocationsApi.md#updateLocation) | **PUT** /locations/{id} | Update location # **createLocation** @@ -35,7 +35,7 @@ Delete location ```php $id = 56; // int | $include = array("include_example"); // string[] | Specify what extra fields to include in the response. -$result = $client->locations()->deleteLocation($id, $include); +$client->locations()->deleteLocation($id, $include); ``` @@ -101,12 +101,12 @@ Name | Type | Description | Notes # **updateLocation** -Edit location +Update location ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\Body1(); // \Swagger\Client\Model\Body1 | +$body = new \Swagger\Client\Model\LocationUpdateRequest(); // \Swagger\Client\Model\LocationUpdateRequest | $include = array("include_example"); // string[] | Specify what extra fields to include in the response. $result = $client->locations()->updateLocation($id, $body, $include); print_r($result); @@ -117,7 +117,7 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\Body1**](../Model/Body1.md)| | + **body** | [**\Swagger\Client\Model\LocationUpdateRequest**](../Model/LocationUpdateRequest.md)| | **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type diff --git a/docs/Api/SchedulesApi.md b/docs/Api/SchedulesApi.md index ca92bbb..c550446 100644 --- a/docs/Api/SchedulesApi.md +++ b/docs/Api/SchedulesApi.md @@ -40,7 +40,7 @@ Delete Schedule ### Example ```php $id = 56; // int | -$result = $client->schedules()->deleteSchedule($id); +$client->schedules()->deleteSchedule($id); ``` @@ -61,15 +61,15 @@ Enable schedules ### Example ```php -$body = new \Swagger\Client\Model\Body9(); // \Swagger\Client\Model\Body9 | -$result = $client->schedules()->enableSchedules($body); +$body = new \Swagger\Client\Model\SchedulesEnableRequest(); // \Swagger\Client\Model\SchedulesEnableRequest | +$client->schedules()->enableSchedules($body); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Body9**](../Model/Body9.md)| | + **body** | [**\Swagger\Client\Model\SchedulesEnableRequest**](../Model/SchedulesEnableRequest.md)| | ### Return type diff --git a/docs/Api/ServerApi.md b/docs/Api/ServerApi.md index 5346a9f..75e88a4 100644 --- a/docs/Api/ServerApi.md +++ b/docs/Api/ServerApi.md @@ -20,7 +20,7 @@ print_r($result); ### Return type -[**\Swagger\Client\Model\InlineResponse200**](../Model/InlineResponse200.md) +[**\Swagger\Client\Model\ServerInfo**](../Model/ServerInfo.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) @@ -30,15 +30,14 @@ Get the SUPLA Server status ### Example ```php -$result = $client->server()->serverStatusGet(); -print_r($result); +$client->server()->serverStatusGet(); ``` ### Return type -[**\Swagger\Client\Model\InlineResponse2001**](../Model/InlineResponse2001.md) +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) diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md index b2d6523..656c84c 100644 --- a/docs/Api/UsersApi.md +++ b/docs/Api/UsersApi.md @@ -2,48 +2,47 @@ Method | HTTP request | Description ------------- | ------------- | ------------- -[**editCurrentUser**](UsersApi.md#editCurrentUser) | **PATCH** /users/current | Edit current user [**getCurrentUser**](UsersApi.md#getCurrentUser) | **GET** /users/current | Get current user +[**updateCurrentUser**](UsersApi.md#updateCurrentUser) | **PATCH** /users/current | Update current user -# **editCurrentUser** +# **getCurrentUser** -Edit current user +Get current user ### Example ```php -$body = new \Swagger\Client\Model\Body(); // \Swagger\Client\Model\Body | -$result = $client->users()->editCurrentUser($body); +$result = $client->users()->getCurrentUser(); print_r($result); ``` -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Body**](../Model/Body.md)| | ### Return type -[**\Swagger\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md) +[**\Swagger\Client\Model\UserData**](../Model/UserData.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) -# **getCurrentUser** +# **updateCurrentUser** -Get current user +Update current user ### Example ```php -$result = $client->users()->getCurrentUser(); -print_r($result); +$body = new \Swagger\Client\Model\UserUpdateRequest(); // \Swagger\Client\Model\UserUpdateRequest | +$client->users()->updateCurrentUser($body); ``` +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\UserUpdateRequest**](../Model/UserUpdateRequest.md)| | ### Return type -[**\Swagger\Client\Model\UserRequest**](../Model/UserRequest.md) +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) diff --git a/docs/Model/Body10.md b/docs/Model/AccessIDUpdateRequest.md similarity index 96% rename from docs/Model/Body10.md rename to docs/Model/AccessIDUpdateRequest.md index 5212d12..83c768b 100644 --- a/docs/Model/Body10.md +++ b/docs/Model/AccessIDUpdateRequest.md @@ -1,4 +1,4 @@ -# Body10 +# AccessIDUpdateRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body5.md b/docs/Model/Body5.md deleted file mode 100644 index c73eb92..0000000 --- a/docs/Model/Body5.md +++ /dev/null @@ -1,14 +0,0 @@ -# Body5 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**caption** | **string** | | [optional] -**altIcon** | **int** | | [optional] -**hidden** | **bool** | | [optional] -**locationId** | **int** | | [optional] -**channelIds** | **int[]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/InlineResponse400.md b/docs/Model/ChannelActionExecutionFailedResponse.md similarity index 90% rename from docs/Model/InlineResponse400.md rename to docs/Model/ChannelActionExecutionFailedResponse.md index 5cd2c6c..63ecf60 100644 --- a/docs/Model/InlineResponse400.md +++ b/docs/Model/ChannelActionExecutionFailedResponse.md @@ -1,4 +1,4 @@ -# InlineResponse400 +# ChannelActionExecutionFailedResponse ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body6.md b/docs/Model/ChannelExecuteActionRequest.md similarity index 93% rename from docs/Model/Body6.md rename to docs/Model/ChannelExecuteActionRequest.md index f8298d7..aeaf0de 100644 --- a/docs/Model/Body6.md +++ b/docs/Model/ChannelExecuteActionRequest.md @@ -1,4 +1,4 @@ -# Body6 +# ChannelExecuteActionRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body3.md b/docs/Model/ChannelGroupExecuteActionRequest.md similarity index 92% rename from docs/Model/Body3.md rename to docs/Model/ChannelGroupExecuteActionRequest.md index 67f9d83..37ba8ca 100644 --- a/docs/Model/Body3.md +++ b/docs/Model/ChannelGroupExecuteActionRequest.md @@ -1,4 +1,4 @@ -# Body3 +# ChannelGroupExecuteActionRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body4.md b/docs/Model/ChannelGroupRequest.md similarity index 95% rename from docs/Model/Body4.md rename to docs/Model/ChannelGroupRequest.md index 29c3af9..4b39c76 100644 --- a/docs/Model/Body4.md +++ b/docs/Model/ChannelGroupRequest.md @@ -1,4 +1,4 @@ -# Body4 +# ChannelGroupRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/InlineResponse2003.md b/docs/Model/ChannelMeasurementLog.md similarity index 95% rename from docs/Model/InlineResponse2003.md rename to docs/Model/ChannelMeasurementLog.md index 4a7fda8..cce201d 100644 --- a/docs/Model/InlineResponse2003.md +++ b/docs/Model/ChannelMeasurementLog.md @@ -1,4 +1,4 @@ -# InlineResponse2003 +# ChannelMeasurementLog ## Properties Name | Type | Description | Notes diff --git a/docs/Model/InlineResponse4001.md b/docs/Model/ChannelUnsupportedFunctionResponse.md similarity index 90% rename from docs/Model/InlineResponse4001.md rename to docs/Model/ChannelUnsupportedFunctionResponse.md index 40c42b7..ba0aa3c 100644 --- a/docs/Model/InlineResponse4001.md +++ b/docs/Model/ChannelUnsupportedFunctionResponse.md @@ -1,4 +1,4 @@ -# InlineResponse4001 +# ChannelUnsupportedFunctionResponse ## Properties Name | Type | Description | Notes diff --git a/docs/Model/InlineResponse409.md b/docs/Model/ChannelUpdateConfirmationResponse.md similarity index 94% rename from docs/Model/InlineResponse409.md rename to docs/Model/ChannelUpdateConfirmationResponse.md index cd90fd6..17d590c 100644 --- a/docs/Model/InlineResponse409.md +++ b/docs/Model/ChannelUpdateConfirmationResponse.md @@ -1,4 +1,4 @@ -# InlineResponse409 +# ChannelUpdateConfirmationResponse ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body2.md b/docs/Model/ChannelUpdateRequest.md similarity index 96% rename from docs/Model/Body2.md rename to docs/Model/ChannelUpdateRequest.md index 65f703c..0d2df0f 100644 --- a/docs/Model/Body2.md +++ b/docs/Model/ChannelUpdateRequest.md @@ -1,4 +1,4 @@ -# Body2 +# ChannelUpdateRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body7.md b/docs/Model/ClientAppUpdateRequest.md similarity index 94% rename from docs/Model/Body7.md rename to docs/Model/ClientAppUpdateRequest.md index 85968f7..7727fd3 100644 --- a/docs/Model/Body7.md +++ b/docs/Model/ClientAppUpdateRequest.md @@ -1,4 +1,4 @@ -# Body7 +# ClientAppUpdateRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body8.md b/docs/Model/IODeviceUpdateRequest.md similarity index 94% rename from docs/Model/Body8.md rename to docs/Model/IODeviceUpdateRequest.md index b756a22..2ede08d 100644 --- a/docs/Model/Body8.md +++ b/docs/Model/IODeviceUpdateRequest.md @@ -1,4 +1,4 @@ -# Body8 +# IODeviceUpdateRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/InlineResponse2001.md b/docs/Model/InlineResponse2001.md deleted file mode 100644 index 6f4a96e..0000000 --- a/docs/Model/InlineResponse2001.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse2001 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **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) - - diff --git a/docs/Model/InlineResponse2002.md b/docs/Model/InlineResponse2002.md deleted file mode 100644 index 1a50678..0000000 --- a/docs/Model/InlineResponse2002.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse2002 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/InlineResponse503.md b/docs/Model/InlineResponse503.md deleted file mode 100644 index 581ffcf..0000000 --- a/docs/Model/InlineResponse503.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse503 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **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) - - diff --git a/docs/Model/Body1.md b/docs/Model/LocationUpdateRequest.md similarity index 95% rename from docs/Model/Body1.md rename to docs/Model/LocationUpdateRequest.md index 15bcf48..8f52168 100644 --- a/docs/Model/Body1.md +++ b/docs/Model/LocationUpdateRequest.md @@ -1,4 +1,4 @@ -# Body1 +# LocationUpdateRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body9.md b/docs/Model/SchedulesEnableRequest.md similarity index 93% rename from docs/Model/Body9.md rename to docs/Model/SchedulesEnableRequest.md index 357a0ed..19a08be 100644 --- a/docs/Model/Body9.md +++ b/docs/Model/SchedulesEnableRequest.md @@ -1,4 +1,4 @@ -# Body9 +# SchedulesEnableRequest ## Properties Name | Type | Description | Notes diff --git a/docs/Model/InlineResponse200.md b/docs/Model/ServerInfo.md similarity index 84% rename from docs/Model/InlineResponse200.md rename to docs/Model/ServerInfo.md index 8305a5a..10d26c4 100644 --- a/docs/Model/InlineResponse200.md +++ b/docs/Model/ServerInfo.md @@ -1,11 +1,11 @@ -# InlineResponse200 +# ServerInfo ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **address** | **string** | SUPLA Server address (to be used in smartphones) | [optional] **time** | [**\DateTime**](\DateTime.md) | Current server time | [optional] -**timezone** | [**\Swagger\Client\Model\InlineResponse200Timezone**](InlineResponse200Timezone.md) | | [optional] +**timezone** | [**\Swagger\Client\Model\ServerInfoTimezone**](ServerInfoTimezone.md) | | [optional] **authenticated** | **bool** | | [optional] **username** | **string** | Present only if `authenticated=true` | [optional] **cloudVersion** | **string** | | [optional] diff --git a/docs/Model/InlineResponse200Timezone.md b/docs/Model/ServerInfoTimezone.md similarity index 93% rename from docs/Model/InlineResponse200Timezone.md rename to docs/Model/ServerInfoTimezone.md index 1415fe6..5563e63 100644 --- a/docs/Model/InlineResponse200Timezone.md +++ b/docs/Model/ServerInfoTimezone.md @@ -1,4 +1,4 @@ -# InlineResponse200Timezone +# ServerInfoTimezone ## Properties Name | Type | Description | Notes diff --git a/docs/Model/UserRequest.md b/docs/Model/UserData.md similarity index 97% rename from docs/Model/UserRequest.md rename to docs/Model/UserData.md index c2aa032..021b380 100644 --- a/docs/Model/UserRequest.md +++ b/docs/Model/UserData.md @@ -1,4 +1,4 @@ -# UserRequest +# UserData ## Properties Name | Type | Description | Notes diff --git a/docs/Model/Body.md b/docs/Model/UserUpdateRequest.md similarity index 96% rename from docs/Model/Body.md rename to docs/Model/UserUpdateRequest.md index 1a3a8d0..159fb39 100644 --- a/docs/Model/Body.md +++ b/docs/Model/UserUpdateRequest.md @@ -1,4 +1,4 @@ -# Body +# UserUpdateRequest ## Properties Name | Type | Description | Notes diff --git a/lib/Api/AccessIDsApi.php b/lib/Api/AccessIDsApi.php index 39ae9d1..e3b34d3 100644 --- a/lib/Api/AccessIDsApi.php +++ b/lib/Api/AccessIDsApi.php @@ -1103,10 +1103,10 @@ protected function getAccessID_0Request($id, $include = null) /** * Operation updateAccessID * - * Edit Access ID + * Update Access ID * * @param int $id id (required) - * @param \Swagger\Client\Model\Body10 $body body (required) + * @param \Swagger\Client\Model\AccessIDUpdateRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1121,10 +1121,10 @@ public function updateAccessID($id, $body) /** * Operation updateAccessIDWithHttpInfo * - * Edit Access ID + * Update Access ID * * @param int $id (required) - * @param \Swagger\Client\Model\Body10 $body (required) + * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1197,10 +1197,10 @@ public function updateAccessIDWithHttpInfo($id, $body) /** * Operation updateAccessIDAsync * - * Edit Access ID + * Update Access ID * * @param int $id (required) - * @param \Swagger\Client\Model\Body10 $body (required) + * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1218,10 +1218,10 @@ function ($response) { /** * Operation updateAccessIDAsyncWithHttpInfo * - * Edit Access ID + * Update Access ID * * @param int $id (required) - * @param \Swagger\Client\Model\Body10 $body (required) + * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1272,7 +1272,7 @@ function ($exception) { * Create request for operation 'updateAccessID' * * @param int $id (required) - * @param \Swagger\Client\Model\Body10 $body (required) + * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/ChannelGroupsApi.php b/lib/Api/ChannelGroupsApi.php index af142eb..1f35c5e 100644 --- a/lib/Api/ChannelGroupsApi.php +++ b/lib/Api/ChannelGroupsApi.php @@ -92,7 +92,7 @@ public function getConfig() * * Create a new channel group * - * @param \Swagger\Client\Model\Body4 $body body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -109,7 +109,7 @@ public function createChannelGroup($body) * * Create a new channel group * - * @param \Swagger\Client\Model\Body4 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -184,7 +184,7 @@ public function createChannelGroupWithHttpInfo($body) * * Create a new channel group * - * @param \Swagger\Client\Model\Body4 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -204,7 +204,7 @@ function ($response) { * * Create a new channel group * - * @param \Swagger\Client\Model\Body4 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -254,7 +254,7 @@ function ($exception) { /** * Create request for operation 'createChannelGroup' * - * @param \Swagger\Client\Model\Body4 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -583,7 +583,7 @@ protected function deleteChannelGroupRequest($id) * Execute action on the channel group * * @param int $id id (required) - * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -600,7 +600,7 @@ public function executeChannelGroupAction($id, $body) * Execute action on the channel group * * @param int $id (required) - * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -646,7 +646,7 @@ public function executeChannelGroupActionWithHttpInfo($id, $body) case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse400', + '\Swagger\Client\Model\ChannelActionExecutionFailedResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -662,7 +662,7 @@ public function executeChannelGroupActionWithHttpInfo($id, $body) * Execute action on the channel group * * @param int $id (required) - * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -683,7 +683,7 @@ function ($response) { * Execute action on the channel group * * @param int $id (required) - * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -720,7 +720,7 @@ function ($exception) { * Create request for operation 'executeChannelGroupAction' * * @param int $id (required) - * @param \Swagger\Client\Model\Body6 $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1371,7 +1371,7 @@ protected function getChannelGroupsRequest($include = null) * Update channel group * * @param int $id id (required) - * @param \Swagger\Client\Model\Body5 $body body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1389,7 +1389,7 @@ public function updateChannelGroup($id, $body) * Update channel group * * @param int $id (required) - * @param \Swagger\Client\Model\Body5 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1465,7 +1465,7 @@ public function updateChannelGroupWithHttpInfo($id, $body) * Update channel group * * @param int $id (required) - * @param \Swagger\Client\Model\Body5 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1486,7 +1486,7 @@ function ($response) { * Update channel group * * @param int $id (required) - * @param \Swagger\Client\Model\Body5 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1537,7 +1537,7 @@ function ($exception) { * Create request for operation 'updateChannelGroup' * * @param int $id (required) - * @param \Swagger\Client\Model\Body5 $body (required) + * @param \Swagger\Client\Model\ChannelGroupRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/ChannelsApi.php b/lib/Api/ChannelsApi.php index 1e70536..873abe2 100644 --- a/lib/Api/ChannelsApi.php +++ b/lib/Api/ChannelsApi.php @@ -93,7 +93,7 @@ public function getConfig() * Execute action on the channel * * @param int $id id (required) - * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -110,7 +110,7 @@ public function executeAction($id, $body) * Execute action on the channel * * @param int $id (required) - * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -156,7 +156,7 @@ public function executeActionWithHttpInfo($id, $body) case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse400', + '\Swagger\Client\Model\ChannelActionExecutionFailedResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -172,7 +172,7 @@ public function executeActionWithHttpInfo($id, $body) * Execute action on the channel * * @param int $id (required) - * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -193,7 +193,7 @@ function ($response) { * Execute action on the channel * * @param int $id (required) - * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -230,7 +230,7 @@ function ($exception) { * Create request for operation 'executeAction' * * @param int $id (required) - * @param \Swagger\Client\Model\Body3 $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -627,7 +627,7 @@ protected function getChannelRequest($id, $include = null) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse2003[] + * @return \Swagger\Client\Model\ChannelMeasurementLog[] */ public function getChannelMeasurementLogs($id, $limit = '5000', $offset = null) { @@ -646,11 +646,11 @@ public function getChannelMeasurementLogs($id, $limit = '5000', $offset = null) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse2003[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\ChannelMeasurementLog[], HTTP status code, HTTP response headers (array of strings) */ public function getChannelMeasurementLogsWithHttpInfo($id, $limit = '5000', $offset = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2003[]'; + $returnType = '\Swagger\Client\Model\ChannelMeasurementLog[]'; $request = $this->getChannelMeasurementLogsRequest($id, $limit, $offset); try { @@ -702,7 +702,7 @@ public function getChannelMeasurementLogsWithHttpInfo($id, $limit = '5000', $off case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse2003[]', + '\Swagger\Client\Model\ChannelMeasurementLog[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -710,7 +710,7 @@ public function getChannelMeasurementLogsWithHttpInfo($id, $limit = '5000', $off case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse4001', + '\Swagger\Client\Model\ChannelUnsupportedFunctionResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -756,7 +756,7 @@ function ($response) { */ public function getChannelMeasurementLogsAsyncWithHttpInfo($id, $limit = '5000', $offset = null) { - $returnType = '\Swagger\Client\Model\InlineResponse2003[]'; + $returnType = '\Swagger\Client\Model\ChannelMeasurementLog[]'; $request = $this->getChannelMeasurementLogsRequest($id, $limit, $offset); return $this->client @@ -998,7 +998,7 @@ public function getChannelMeasurementLogsCsvFileWithHttpInfo($id) case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse4001', + '\Swagger\Client\Model\ChannelUnsupportedFunctionResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1755,7 +1755,7 @@ protected function getChannelsRequest($include = null, $function = null, $io = n * Update channel * * @param int $id id (required) - * @param \Swagger\Client\Model\Body2 $body body (required) + * @param \Swagger\Client\Model\ChannelUpdateRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1773,7 +1773,7 @@ public function updateChannel($id, $body) * Update channel * * @param int $id (required) - * @param \Swagger\Client\Model\Body2 $body (required) + * @param \Swagger\Client\Model\ChannelUpdateRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1841,7 +1841,7 @@ public function updateChannelWithHttpInfo($id, $body) case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse409', + '\Swagger\Client\Model\ChannelUpdateConfirmationResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1857,7 +1857,7 @@ public function updateChannelWithHttpInfo($id, $body) * Update channel * * @param int $id (required) - * @param \Swagger\Client\Model\Body2 $body (required) + * @param \Swagger\Client\Model\ChannelUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1878,7 +1878,7 @@ function ($response) { * Update channel * * @param int $id (required) - * @param \Swagger\Client\Model\Body2 $body (required) + * @param \Swagger\Client\Model\ChannelUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1929,7 +1929,7 @@ function ($exception) { * Create request for operation 'updateChannel' * * @param int $id (required) - * @param \Swagger\Client\Model\Body2 $body (required) + * @param \Swagger\Client\Model\ChannelUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/ClientAppsApi.php b/lib/Api/ClientAppsApi.php index af30338..cbbf1b1 100644 --- a/lib/Api/ClientAppsApi.php +++ b/lib/Api/ClientAppsApi.php @@ -581,7 +581,7 @@ protected function getClientAppsRequest($include = null) * Update client app * * @param int $id id (required) - * @param \Swagger\Client\Model\Body7 $body body (required) + * @param \Swagger\Client\Model\ClientAppUpdateRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -599,7 +599,7 @@ public function updateClientApp($id, $body) * Update client app * * @param int $id (required) - * @param \Swagger\Client\Model\Body7 $body (required) + * @param \Swagger\Client\Model\ClientAppUpdateRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -675,7 +675,7 @@ public function updateClientAppWithHttpInfo($id, $body) * Update client app * * @param int $id (required) - * @param \Swagger\Client\Model\Body7 $body (required) + * @param \Swagger\Client\Model\ClientAppUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -696,7 +696,7 @@ function ($response) { * Update client app * * @param int $id (required) - * @param \Swagger\Client\Model\Body7 $body (required) + * @param \Swagger\Client\Model\ClientAppUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -747,7 +747,7 @@ function ($exception) { * Create request for operation 'updateClientApp' * * @param int $id (required) - * @param \Swagger\Client\Model\Body7 $body (required) + * @param \Swagger\Client\Model\ClientAppUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/IODevicesApi.php b/lib/Api/IODevicesApi.php index 501fee8..5ba2d90 100644 --- a/lib/Api/IODevicesApi.php +++ b/lib/Api/IODevicesApi.php @@ -1137,7 +1137,7 @@ protected function getIoDevicesRequest($include = null) * Update IO Device * * @param int $id id (required) - * @param \Swagger\Client\Model\Body8 $body body (required) + * @param \Swagger\Client\Model\IODeviceUpdateRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1155,7 +1155,7 @@ public function updateIoDevice($id, $body) * Update IO Device * * @param int $id (required) - * @param \Swagger\Client\Model\Body8 $body (required) + * @param \Swagger\Client\Model\IODeviceUpdateRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1231,7 +1231,7 @@ public function updateIoDeviceWithHttpInfo($id, $body) * Update IO Device * * @param int $id (required) - * @param \Swagger\Client\Model\Body8 $body (required) + * @param \Swagger\Client\Model\IODeviceUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1252,7 +1252,7 @@ function ($response) { * Update IO Device * * @param int $id (required) - * @param \Swagger\Client\Model\Body8 $body (required) + * @param \Swagger\Client\Model\IODeviceUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1303,7 +1303,7 @@ function ($exception) { * Create request for operation 'updateIoDevice' * * @param int $id (required) - * @param \Swagger\Client\Model\Body8 $body (required) + * @param \Swagger\Client\Model\IODeviceUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/LocationsApi.php b/lib/Api/LocationsApi.php index cacc172..7bf94e2 100644 --- a/lib/Api/LocationsApi.php +++ b/lib/Api/LocationsApi.php @@ -1115,10 +1115,10 @@ protected function getLocationsRequest($include = null) /** * Operation updateLocation * - * Edit location + * Update location * * @param int $id id (required) - * @param \Swagger\Client\Model\Body1 $body body (required) + * @param \Swagger\Client\Model\LocationUpdateRequest $body body (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response @@ -1134,10 +1134,10 @@ public function updateLocation($id, $body, $include = null) /** * Operation updateLocationWithHttpInfo * - * Edit location + * Update location * * @param int $id (required) - * @param \Swagger\Client\Model\Body1 $body (required) + * @param \Swagger\Client\Model\LocationUpdateRequest $body (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response @@ -1211,10 +1211,10 @@ public function updateLocationWithHttpInfo($id, $body, $include = null) /** * Operation updateLocationAsync * - * Edit location + * Update location * * @param int $id (required) - * @param \Swagger\Client\Model\Body1 $body (required) + * @param \Swagger\Client\Model\LocationUpdateRequest $body (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException @@ -1233,10 +1233,10 @@ function ($response) { /** * Operation updateLocationAsyncWithHttpInfo * - * Edit location + * Update location * * @param int $id (required) - * @param \Swagger\Client\Model\Body1 $body (required) + * @param \Swagger\Client\Model\LocationUpdateRequest $body (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException @@ -1288,7 +1288,7 @@ function ($exception) { * Create request for operation 'updateLocation' * * @param int $id (required) - * @param \Swagger\Client\Model\Body1 $body (required) + * @param \Swagger\Client\Model\LocationUpdateRequest $body (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException diff --git a/lib/Api/SchedulesApi.php b/lib/Api/SchedulesApi.php index 9616109..e4d00a3 100644 --- a/lib/Api/SchedulesApi.php +++ b/lib/Api/SchedulesApi.php @@ -582,7 +582,7 @@ protected function deleteScheduleRequest($id) * * Enable schedules * - * @param \Swagger\Client\Model\Body9 $body body (required) + * @param \Swagger\Client\Model\SchedulesEnableRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -598,7 +598,7 @@ public function enableSchedules($body) * * Enable schedules * - * @param \Swagger\Client\Model\Body9 $body (required) + * @param \Swagger\Client\Model\SchedulesEnableRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -651,7 +651,7 @@ public function enableSchedulesWithHttpInfo($body) * * Enable schedules * - * @param \Swagger\Client\Model\Body9 $body (required) + * @param \Swagger\Client\Model\SchedulesEnableRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -671,7 +671,7 @@ function ($response) { * * Enable schedules * - * @param \Swagger\Client\Model\Body9 $body (required) + * @param \Swagger\Client\Model\SchedulesEnableRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -707,7 +707,7 @@ function ($exception) { /** * Create request for operation 'enableSchedules' * - * @param \Swagger\Client\Model\Body9 $body (required) + * @param \Swagger\Client\Model\SchedulesEnableRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/ServerApi.php b/lib/Api/ServerApi.php index e5f0f92..ac0d67c 100644 --- a/lib/Api/ServerApi.php +++ b/lib/Api/ServerApi.php @@ -95,7 +95,7 @@ public function getConfig() * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse200 + * @return \Swagger\Client\Model\ServerInfo */ public function serverInfoGet() { @@ -111,11 +111,11 @@ public function serverInfoGet() * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\ServerInfo, HTTP status code, HTTP response headers (array of strings) */ public function serverInfoGetWithHttpInfo() { - $returnType = '\Swagger\Client\Model\InlineResponse200'; + $returnType = '\Swagger\Client\Model\ServerInfo'; $request = $this->serverInfoGetRequest(); try { @@ -167,7 +167,7 @@ public function serverInfoGetWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse200', + '\Swagger\Client\Model\ServerInfo', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -207,7 +207,7 @@ function ($response) { */ public function serverInfoGetAsyncWithHttpInfo() { - $returnType = '\Swagger\Client\Model\InlineResponse200'; + $returnType = '\Swagger\Client\Model\ServerInfo'; $request = $this->serverInfoGetRequest(); return $this->client @@ -338,12 +338,11 @@ protected function serverInfoGetRequest() * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse2001 + * @return void */ public function serverStatusGet() { - list($response) = $this->serverStatusGetWithHttpInfo(); - return $response; + $this->serverStatusGetWithHttpInfo(); } /** @@ -354,11 +353,11 @@ public function serverStatusGet() * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse2001, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function serverStatusGetWithHttpInfo() { - $returnType = '\Swagger\Client\Model\InlineResponse2001'; + $returnType = ''; $request = $this->serverStatusGetRequest(); try { @@ -389,40 +388,10 @@ public function serverStatusGetWithHttpInfo() ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse2001', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 503: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse503', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } @@ -458,28 +427,14 @@ function ($response) { */ public function serverStatusGetAsyncWithHttpInfo() { - $returnType = '\Swagger\Client\Model\InlineResponse2001'; + $returnType = ''; $request = $this->serverStatusGetRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index 020a941..0e73413 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -88,37 +88,35 @@ public function getConfig() } /** - * Operation editCurrentUser + * Operation getCurrentUser * - * Edit current user + * Get current user * - * @param \Swagger\Client\Model\Body $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\InlineResponse2002 + * @return \Swagger\Client\Model\UserData */ - public function editCurrentUser($body) + public function getCurrentUser() { - list($response) = $this->editCurrentUserWithHttpInfo($body); + list($response) = $this->getCurrentUserWithHttpInfo(); return $response; } /** - * Operation editCurrentUserWithHttpInfo + * Operation getCurrentUserWithHttpInfo * - * Edit current user + * Get current user * - * @param \Swagger\Client\Model\Body $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\InlineResponse2002, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\UserData, HTTP status code, HTTP response headers (array of strings) */ - public function editCurrentUserWithHttpInfo($body) + public function getCurrentUserWithHttpInfo() { - $returnType = '\Swagger\Client\Model\InlineResponse2002'; - $request = $this->editCurrentUserRequest($body); + $returnType = '\Swagger\Client\Model\UserData'; + $request = $this->getCurrentUserRequest(); try { $options = $this->createHttpClientOption(); @@ -169,7 +167,7 @@ public function editCurrentUserWithHttpInfo($body) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\InlineResponse2002', + '\Swagger\Client\Model\UserData', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -180,18 +178,17 @@ public function editCurrentUserWithHttpInfo($body) } /** - * Operation editCurrentUserAsync + * Operation getCurrentUserAsync * - * Edit current user + * Get current user * - * @param \Swagger\Client\Model\Body $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editCurrentUserAsync($body) + public function getCurrentUserAsync() { - return $this->editCurrentUserAsyncWithHttpInfo($body) + return $this->getCurrentUserAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -200,19 +197,18 @@ function ($response) { } /** - * Operation editCurrentUserAsyncWithHttpInfo + * Operation getCurrentUserAsyncWithHttpInfo * - * Edit current user + * Get current user * - * @param \Swagger\Client\Model\Body $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editCurrentUserAsyncWithHttpInfo($body) + public function getCurrentUserAsyncWithHttpInfo() { - $returnType = '\Swagger\Client\Model\InlineResponse2002'; - $request = $this->editCurrentUserRequest($body); + $returnType = '\Swagger\Client\Model\UserData'; + $request = $this->getCurrentUserRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,21 +248,14 @@ function ($exception) { } /** - * Create request for operation 'editCurrentUser' + * Create request for operation 'getCurrentUser' * - * @param \Swagger\Client\Model\Body $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function editCurrentUserRequest($body) + protected function getCurrentUserRequest() { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling editCurrentUser' - ); - } $resourcePath = '/users/current'; $formParams = []; @@ -279,9 +268,6 @@ protected function editCurrentUserRequest($body) // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -341,7 +327,7 @@ protected function editCurrentUserRequest($body) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -349,35 +335,36 @@ protected function editCurrentUserRequest($body) } /** - * Operation getCurrentUser + * Operation updateCurrentUser * - * Get current user + * Update current user * + * @param \Swagger\Client\Model\UserUpdateRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\UserRequest + * @return void */ - public function getCurrentUser() + public function updateCurrentUser($body) { - list($response) = $this->getCurrentUserWithHttpInfo(); - return $response; + $this->updateCurrentUserWithHttpInfo($body); } /** - * Operation getCurrentUserWithHttpInfo + * Operation updateCurrentUserWithHttpInfo * - * Get current user + * Update current user * + * @param \Swagger\Client\Model\UserUpdateRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\UserRequest, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getCurrentUserWithHttpInfo() + public function updateCurrentUserWithHttpInfo($body) { - $returnType = '\Swagger\Client\Model\UserRequest'; - $request = $this->getCurrentUserRequest(); + $returnType = ''; + $request = $this->updateCurrentUserRequest($body); try { $options = $this->createHttpClientOption(); @@ -407,49 +394,28 @@ public function getCurrentUserWithHttpInfo() ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Swagger\Client\Model\UserRequest', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getCurrentUserAsync + * Operation updateCurrentUserAsync * - * Get current user + * Update current user * + * @param \Swagger\Client\Model\UserUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentUserAsync() + public function updateCurrentUserAsync($body) { - return $this->getCurrentUserAsyncWithHttpInfo() + return $this->updateCurrentUserAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -458,38 +424,25 @@ function ($response) { } /** - * Operation getCurrentUserAsyncWithHttpInfo + * Operation updateCurrentUserAsyncWithHttpInfo * - * Get current user + * Update current user * + * @param \Swagger\Client\Model\UserUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentUserAsyncWithHttpInfo() + public function updateCurrentUserAsyncWithHttpInfo($body) { - $returnType = '\Swagger\Client\Model\UserRequest'; - $request = $this->getCurrentUserRequest(); + $returnType = ''; + $request = $this->updateCurrentUserRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -509,14 +462,21 @@ function ($exception) { } /** - * Create request for operation 'getCurrentUser' + * Create request for operation 'updateCurrentUser' * + * @param \Swagger\Client\Model\UserUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCurrentUserRequest() + protected function updateCurrentUserRequest($body) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateCurrentUser' + ); + } $resourcePath = '/users/current'; $formParams = []; @@ -529,6 +489,9 @@ protected function getCurrentUserRequest() // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -588,7 +551,7 @@ protected function getCurrentUserRequest() $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/lib/Model/Body10.php b/lib/Model/AccessIDUpdateRequest.php similarity index 97% rename from lib/Model/Body10.php rename to lib/Model/AccessIDUpdateRequest.php index d578fbd..9032b18 100644 --- a/lib/Model/Body10.php +++ b/lib/Model/AccessIDUpdateRequest.php @@ -1,6 +1,6 @@ 'string', - 'altIcon' => 'int', - 'hidden' => 'bool', - 'locationId' => 'int', - 'channelIds' => 'int[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'caption' => null, - 'altIcon' => null, - 'hidden' => null, - 'locationId' => null, - 'channelIds' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'caption' => 'caption', - 'altIcon' => 'altIcon', - 'hidden' => 'hidden', - 'locationId' => 'locationId', - 'channelIds' => 'channelIds' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'caption' => 'setCaption', - 'altIcon' => 'setAltIcon', - 'hidden' => 'setHidden', - 'locationId' => 'setLocationId', - 'channelIds' => 'setChannelIds' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'caption' => 'getCaption', - 'altIcon' => 'getAltIcon', - 'hidden' => 'getHidden', - 'locationId' => 'getLocationId', - 'channelIds' => 'getChannelIds' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['altIcon'] = isset($data['altIcon']) ? $data['altIcon'] : null; - $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; - $this->container['locationId'] = isset($data['locationId']) ? $data['locationId'] : null; - $this->container['channelIds'] = isset($data['channelIds']) ? $data['channelIds'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets caption - * - * @return string - */ - public function getCaption() - { - return $this->container['caption']; - } - - /** - * Sets caption - * - * @param string $caption caption - * - * @return $this - */ - public function setCaption($caption) - { - $this->container['caption'] = $caption; - - return $this; - } - - /** - * Gets altIcon - * - * @return int - */ - public function getAltIcon() - { - return $this->container['altIcon']; - } - - /** - * Sets altIcon - * - * @param int $altIcon altIcon - * - * @return $this - */ - public function setAltIcon($altIcon) - { - $this->container['altIcon'] = $altIcon; - - return $this; - } - - /** - * Gets hidden - * - * @return bool - */ - public function getHidden() - { - return $this->container['hidden']; - } - - /** - * Sets hidden - * - * @param bool $hidden hidden - * - * @return $this - */ - public function setHidden($hidden) - { - $this->container['hidden'] = $hidden; - - return $this; - } - - /** - * Gets locationId - * - * @return int - */ - public function getLocationId() - { - return $this->container['locationId']; - } - - /** - * Sets locationId - * - * @param int $locationId locationId - * - * @return $this - */ - public function setLocationId($locationId) - { - $this->container['locationId'] = $locationId; - - return $this; - } - - /** - * Gets channelIds - * - * @return int[] - */ - public function getChannelIds() - { - return $this->container['channelIds']; - } - - /** - * Sets channelIds - * - * @param int[] $channelIds channelIds - * - * @return $this - */ - public function setChannelIds($channelIds) - { - $this->container['channelIds'] = $channelIds; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/InlineResponse4001.php b/lib/Model/ChannelActionExecutionFailedResponse.php similarity index 96% rename from lib/Model/InlineResponse4001.php rename to lib/Model/ChannelActionExecutionFailedResponse.php index a492042..2a369b3 100644 --- a/lib/Model/InlineResponse4001.php +++ b/lib/Model/ChannelActionExecutionFailedResponse.php @@ -1,6 +1,6 @@ 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'status' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/InlineResponse2002.php b/lib/Model/InlineResponse2002.php deleted file mode 100644 index 2c82cb7..0000000 --- a/lib/Model/InlineResponse2002.php +++ /dev/null @@ -1,301 +0,0 @@ - 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return int - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int $id id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/InlineResponse503.php b/lib/Model/InlineResponse503.php deleted file mode 100644 index 682b105..0000000 --- a/lib/Model/InlineResponse503.php +++ /dev/null @@ -1,301 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'status' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/Body1.php b/lib/Model/LocationUpdateRequest.php similarity index 97% rename from lib/Model/Body1.php rename to lib/Model/LocationUpdateRequest.php index ab05bc8..7b2129d 100644 --- a/lib/Model/Body1.php +++ b/lib/Model/LocationUpdateRequest.php @@ -1,6 +1,6 @@ 'string', 'time' => '\DateTime', - 'timezone' => '\Swagger\Client\Model\InlineResponse200Timezone', + 'timezone' => '\Swagger\Client\Model\ServerInfoTimezone', 'authenticated' => 'bool', 'username' => 'string', 'cloudVersion' => 'string', @@ -297,7 +297,7 @@ public function setTime($time) /** * Gets timezone * - * @return \Swagger\Client\Model\InlineResponse200Timezone + * @return \Swagger\Client\Model\ServerInfoTimezone */ public function getTimezone() { @@ -307,7 +307,7 @@ public function getTimezone() /** * Sets timezone * - * @param \Swagger\Client\Model\InlineResponse200Timezone $timezone timezone + * @param \Swagger\Client\Model\ServerInfoTimezone $timezone timezone * * @return $this */ diff --git a/lib/Model/InlineResponse200Timezone.php b/lib/Model/ServerInfoTimezone.php similarity index 96% rename from lib/Model/InlineResponse200Timezone.php rename to lib/Model/ServerInfoTimezone.php index e04e6d0..ceaa316 100644 --- a/lib/Model/InlineResponse200Timezone.php +++ b/lib/Model/ServerInfoTimezone.php @@ -1,6 +1,6 @@ Date: Wed, 2 May 2018 14:51:43 +0200 Subject: [PATCH 10/13] Server endpoint names --- README.md | 4 +-- docs/Api/ServerApi.md | 14 +++++----- lib/Api/ServerApi.php | 64 +++++++++++++++++++++---------------------- swagger.json | 4 ++- 4 files changed, 44 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 0abc414..6165527 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,8 @@ Class | Method | HTTP request | Description *SchedulesApi* | [**getSchedule**](docs/Api/SchedulesApi.md#getschedule) | **GET** /schedules/{id} | Get Schedule *SchedulesApi* | [**getSchedules**](docs/Api/SchedulesApi.md#getschedules) | **GET** /schedules | Get schedules list *SchedulesApi* | [**updateSchedule**](docs/Api/SchedulesApi.md#updateschedule) | **PUT** /schedules/{id} | Update schedule -*ServerApi* | [**serverInfoGet**](docs/Api/ServerApi.md#serverinfoget) | **GET** /server-info | Get server status -*ServerApi* | [**serverStatusGet**](docs/Api/ServerApi.md#serverstatusget) | **GET** /server-status | Get the SUPLA Server status +*ServerApi* | [**getServerInfo**](docs/Api/ServerApi.md#getserverinfo) | **GET** /server-info | Get server info +*ServerApi* | [**getSuplaServerStatus**](docs/Api/ServerApi.md#getsuplaserverstatus) | **GET** /server-status | Get the SUPLA Server status *UsersApi* | [**getCurrentUser**](docs/Api/UsersApi.md#getcurrentuser) | **GET** /users/current | Get current user *UsersApi* | [**updateCurrentUser**](docs/Api/UsersApi.md#updatecurrentuser) | **PATCH** /users/current | Update current user diff --git a/docs/Api/ServerApi.md b/docs/Api/ServerApi.md index 75e88a4..7b606dc 100644 --- a/docs/Api/ServerApi.md +++ b/docs/Api/ServerApi.md @@ -2,17 +2,17 @@ Method | HTTP request | Description ------------- | ------------- | ------------- -[**serverInfoGet**](ServerApi.md#serverInfoGet) | **GET** /server-info | Get server status -[**serverStatusGet**](ServerApi.md#serverStatusGet) | **GET** /server-status | Get the SUPLA Server status +[**getServerInfo**](ServerApi.md#getServerInfo) | **GET** /server-info | Get server info +[**getSuplaServerStatus**](ServerApi.md#getSuplaServerStatus) | **GET** /server-status | Get the SUPLA Server status -# **serverInfoGet** +# **getServerInfo** -Get server status +Get server info ### Example ```php -$result = $client->server()->serverInfoGet(); +$result = $client->server()->getServerInfo(); print_r($result); ``` @@ -24,13 +24,13 @@ print_r($result); [[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) -# **serverStatusGet** +# **getSuplaServerStatus** Get the SUPLA Server status ### Example ```php -$client->server()->serverStatusGet(); +$client->server()->getSuplaServerStatus(); ``` diff --git a/lib/Api/ServerApi.php b/lib/Api/ServerApi.php index ac0d67c..54ccbe0 100644 --- a/lib/Api/ServerApi.php +++ b/lib/Api/ServerApi.php @@ -88,35 +88,35 @@ public function getConfig() } /** - * Operation serverInfoGet + * Operation getServerInfo * - * Get server status + * Get server info * * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ServerInfo */ - public function serverInfoGet() + public function getServerInfo() { - list($response) = $this->serverInfoGetWithHttpInfo(); + list($response) = $this->getServerInfoWithHttpInfo(); return $response; } /** - * Operation serverInfoGetWithHttpInfo + * Operation getServerInfoWithHttpInfo * - * Get server status + * Get server info * * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ServerInfo, HTTP status code, HTTP response headers (array of strings) */ - public function serverInfoGetWithHttpInfo() + public function getServerInfoWithHttpInfo() { $returnType = '\Swagger\Client\Model\ServerInfo'; - $request = $this->serverInfoGetRequest(); + $request = $this->getServerInfoRequest(); try { $options = $this->createHttpClientOption(); @@ -178,17 +178,17 @@ public function serverInfoGetWithHttpInfo() } /** - * Operation serverInfoGetAsync + * Operation getServerInfoAsync * - * Get server status + * Get server info * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverInfoGetAsync() + public function getServerInfoAsync() { - return $this->serverInfoGetAsyncWithHttpInfo() + return $this->getServerInfoAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -197,18 +197,18 @@ function ($response) { } /** - * Operation serverInfoGetAsyncWithHttpInfo + * Operation getServerInfoAsyncWithHttpInfo * - * Get server status + * Get server info * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverInfoGetAsyncWithHttpInfo() + public function getServerInfoAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\ServerInfo'; - $request = $this->serverInfoGetRequest(); + $request = $this->getServerInfoRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -248,13 +248,13 @@ function ($exception) { } /** - * Create request for operation 'serverInfoGet' + * Create request for operation 'getServerInfo' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverInfoGetRequest() + protected function getServerInfoRequest() { $resourcePath = '/server-info'; @@ -331,7 +331,7 @@ protected function serverInfoGetRequest() } /** - * Operation serverStatusGet + * Operation getSuplaServerStatus * * Get the SUPLA Server status * @@ -340,13 +340,13 @@ protected function serverInfoGetRequest() * @throws \InvalidArgumentException * @return void */ - public function serverStatusGet() + public function getSuplaServerStatus() { - $this->serverStatusGetWithHttpInfo(); + $this->getSuplaServerStatusWithHttpInfo(); } /** - * Operation serverStatusGetWithHttpInfo + * Operation getSuplaServerStatusWithHttpInfo * * Get the SUPLA Server status * @@ -355,10 +355,10 @@ public function serverStatusGet() * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function serverStatusGetWithHttpInfo() + public function getSuplaServerStatusWithHttpInfo() { $returnType = ''; - $request = $this->serverStatusGetRequest(); + $request = $this->getSuplaServerStatusRequest(); try { $options = $this->createHttpClientOption(); @@ -398,7 +398,7 @@ public function serverStatusGetWithHttpInfo() } /** - * Operation serverStatusGetAsync + * Operation getSuplaServerStatusAsync * * Get the SUPLA Server status * @@ -406,9 +406,9 @@ public function serverStatusGetWithHttpInfo() * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverStatusGetAsync() + public function getSuplaServerStatusAsync() { - return $this->serverStatusGetAsyncWithHttpInfo() + return $this->getSuplaServerStatusAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -417,7 +417,7 @@ function ($response) { } /** - * Operation serverStatusGetAsyncWithHttpInfo + * Operation getSuplaServerStatusAsyncWithHttpInfo * * Get the SUPLA Server status * @@ -425,10 +425,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverStatusGetAsyncWithHttpInfo() + public function getSuplaServerStatusAsyncWithHttpInfo() { $returnType = ''; - $request = $this->serverStatusGetRequest(); + $request = $this->getSuplaServerStatusRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -454,13 +454,13 @@ function ($exception) { } /** - * Create request for operation 'serverStatusGet' + * Create request for operation 'getSuplaServerStatus' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverStatusGetRequest() + protected function getSuplaServerStatusRequest() { $resourcePath = '/server-status'; diff --git a/swagger.json b/swagger.json index abc8366..139cf2f 100644 --- a/swagger.json +++ b/swagger.json @@ -901,6 +901,7 @@ "get" : { "tags" : [ "Server" ], "summary" : "Get the SUPLA Server status", + "operationId" : "getSuplaServerStatus", "parameters" : [ ], "responses" : { "200" : { @@ -916,7 +917,8 @@ "/server-info" : { "get" : { "tags" : [ "Server" ], - "summary" : "Get server status", + "summary" : "Get server info", + "operationId" : "getServerInfo", "parameters" : [ ], "responses" : { "200" : { From 6ce9465f068421427c5de76068783664e8f8f66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 15:24:13 +0200 Subject: [PATCH 11/13] New API Spec with required channel execte action --- README.md | 1 - docs/Api/ChannelGroupsApi.md | 4 +- docs/Model/ChannelExecuteActionRequest.md | 5 +- .../Model/ChannelGroupExecuteActionRequest.md | 11 - docs/Model/ChannelGroupRequest.md | 2 +- docs/Model/ScheduleRequest.md | 8 +- lib/Api/ChannelGroupsApi.php | 10 +- lib/Model/ChannelExecuteActionRequest.php | 105 +++++- .../ChannelGroupExecuteActionRequest.php | 331 ------------------ lib/Model/ChannelGroupRequest.php | 3 + lib/Model/ScheduleRequest.php | 14 +- swagger.json | 67 ++-- 12 files changed, 164 insertions(+), 397 deletions(-) delete mode 100644 docs/Model/ChannelGroupExecuteActionRequest.md delete mode 100644 lib/Model/ChannelGroupExecuteActionRequest.php diff --git a/README.md b/README.md index 6165527..8fe2ab1 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,6 @@ Class | Method | HTTP request | Description - [ChannelFunctionActionEnum](docs/Model/ChannelFunctionActionEnum.md) - [ChannelFunctionEnumNames](docs/Model/ChannelFunctionEnumNames.md) - [ChannelGroup](docs/Model/ChannelGroup.md) - - [ChannelGroupExecuteActionRequest](docs/Model/ChannelGroupExecuteActionRequest.md) - [ChannelGroupRequest](docs/Model/ChannelGroupRequest.md) - [ChannelMeasurementLog](docs/Model/ChannelMeasurementLog.md) - [ChannelParam](docs/Model/ChannelParam.md) diff --git a/docs/Api/ChannelGroupsApi.md b/docs/Api/ChannelGroupsApi.md index 4c4475e..bdcdae8 100644 --- a/docs/Api/ChannelGroupsApi.md +++ b/docs/Api/ChannelGroupsApi.md @@ -62,7 +62,7 @@ Execute action on the channel group ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\ChannelGroupExecuteActionRequest(); // \Swagger\Client\Model\ChannelGroupExecuteActionRequest | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). +$body = new \Swagger\Client\Model\ChannelExecuteActionRequest(); // \Swagger\Client\Model\ChannelExecuteActionRequest | Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). $client->channelGroups()->executeChannelGroupAction($id, $body); ``` @@ -71,7 +71,7 @@ $client->channelGroups()->executeChannelGroupAction($id, $body); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\ChannelGroupExecuteActionRequest**](../Model/ChannelGroupExecuteActionRequest.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | + **body** | [**\Swagger\Client\Model\ChannelExecuteActionRequest**](../Model/ChannelExecuteActionRequest.md)| Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). | ### Return type diff --git a/docs/Model/ChannelExecuteActionRequest.md b/docs/Model/ChannelExecuteActionRequest.md index aeaf0de..bfdee22 100644 --- a/docs/Model/ChannelExecuteActionRequest.md +++ b/docs/Model/ChannelExecuteActionRequest.md @@ -3,8 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**\Swagger\Client\Model\ChannelFunctionActionEnum**](ChannelFunctionActionEnum.md) | | [optional] +**action** | [**\Swagger\Client\Model\ChannelFunctionActionEnum**](ChannelFunctionActionEnum.md) | | **percentage** | **int** | | [optional] +**color** | **string** | | [optional] +**colorBrightness** | **int** | | [optional] +**brightness** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/ChannelGroupExecuteActionRequest.md b/docs/Model/ChannelGroupExecuteActionRequest.md deleted file mode 100644 index 37ba8ca..0000000 --- a/docs/Model/ChannelGroupExecuteActionRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChannelGroupExecuteActionRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**action** | [**\Swagger\Client\Model\ChannelFunctionActionEnum**](ChannelFunctionActionEnum.md) | | [optional] -**percentage** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/ChannelGroupRequest.md b/docs/Model/ChannelGroupRequest.md index 4b39c76..2273667 100644 --- a/docs/Model/ChannelGroupRequest.md +++ b/docs/Model/ChannelGroupRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **altIcon** | **int** | | [optional] **hidden** | **bool** | | [optional] **locationId** | **int** | | [optional] -**channelIds** | **int[]** | | [optional] +**channelIds** | **int[]** | | [[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/ScheduleRequest.md b/docs/Model/ScheduleRequest.md index d2eae88..1ff7ba6 100644 --- a/docs/Model/ScheduleRequest.md +++ b/docs/Model/ScheduleRequest.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**channelId** | **int** | | [optional] -**actionId** | **int** | | [optional] -**mode** | **string** | | [optional] -**timeExpression** | **string** | Schedule time expression in crontab notation (with some custom additions). | [optional] +**channelId** | **int** | | +**actionId** | **int** | | +**mode** | **string** | | +**timeExpression** | **string** | Schedule time expression in crontab notation (with some custom additions). | **dateStart** | [**\DateTime**](\DateTime.md) | | [optional] **dateEnd** | [**\DateTime**](\DateTime.md) | | [optional] **caption** | **string** | | [optional] diff --git a/lib/Api/ChannelGroupsApi.php b/lib/Api/ChannelGroupsApi.php index 1f35c5e..74d341b 100644 --- a/lib/Api/ChannelGroupsApi.php +++ b/lib/Api/ChannelGroupsApi.php @@ -583,7 +583,7 @@ protected function deleteChannelGroupRequest($id) * Execute action on the channel group * * @param int $id id (required) - * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -600,7 +600,7 @@ public function executeChannelGroupAction($id, $body) * Execute action on the channel group * * @param int $id (required) - * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -662,7 +662,7 @@ public function executeChannelGroupActionWithHttpInfo($id, $body) * Execute action on the channel group * * @param int $id (required) - * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -683,7 +683,7 @@ function ($response) { * Execute action on the channel group * * @param int $id (required) - * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -720,7 +720,7 @@ function ($exception) { * Create request for operation 'executeChannelGroupAction' * * @param int $id (required) - * @param \Swagger\Client\Model\ChannelGroupExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) + * @param \Swagger\Client\Model\ChannelExecuteActionRequest $body Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions). (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Model/ChannelExecuteActionRequest.php b/lib/Model/ChannelExecuteActionRequest.php index 12add5e..71e6f69 100644 --- a/lib/Model/ChannelExecuteActionRequest.php +++ b/lib/Model/ChannelExecuteActionRequest.php @@ -49,7 +49,7 @@ class ChannelExecuteActionRequest implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'Channel execute action request'; + protected static $swaggerModelName = 'ChannelExecuteActionRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,7 +58,10 @@ class ChannelExecuteActionRequest implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'action' => '\Swagger\Client\Model\ChannelFunctionActionEnum', - 'percentage' => 'int' + 'percentage' => 'int', + 'color' => 'string', + 'colorBrightness' => 'int', + 'brightness' => 'int' ]; /** @@ -68,7 +71,10 @@ class ChannelExecuteActionRequest implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'action' => null, - 'percentage' => null + 'percentage' => null, + 'color' => null, + 'colorBrightness' => null, + 'brightness' => null ]; /** @@ -99,7 +105,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'action' => 'action', - 'percentage' => 'percentage' + 'percentage' => 'percentage', + 'color' => 'color', + 'colorBrightness' => 'color_brightness', + 'brightness' => 'brightness' ]; /** @@ -109,7 +118,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'action' => 'setAction', - 'percentage' => 'setPercentage' + 'percentage' => 'setPercentage', + 'color' => 'setColor', + 'colorBrightness' => 'setColorBrightness', + 'brightness' => 'setBrightness' ]; /** @@ -119,7 +131,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'action' => 'getAction', - 'percentage' => 'getPercentage' + 'percentage' => 'getPercentage', + 'color' => 'getColor', + 'colorBrightness' => 'getColorBrightness', + 'brightness' => 'getBrightness' ]; /** @@ -184,6 +199,9 @@ public function __construct(array $data = null) { $this->container['action'] = isset($data['action']) ? $data['action'] : null; $this->container['percentage'] = isset($data['percentage']) ? $data['percentage'] : null; + $this->container['color'] = isset($data['color']) ? $data['color'] : null; + $this->container['colorBrightness'] = isset($data['colorBrightness']) ? $data['colorBrightness'] : null; + $this->container['brightness'] = isset($data['brightness']) ? $data['brightness'] : null; } /** @@ -195,6 +213,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } return $invalidProperties; } @@ -257,6 +278,78 @@ public function setPercentage($percentage) return $this; } + + /** + * Gets color + * + * @return string + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string $color color + * + * @return $this + */ + public function setColor($color) + { + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets colorBrightness + * + * @return int + */ + public function getColorBrightness() + { + return $this->container['colorBrightness']; + } + + /** + * Sets colorBrightness + * + * @param int $colorBrightness colorBrightness + * + * @return $this + */ + public function setColorBrightness($colorBrightness) + { + $this->container['colorBrightness'] = $colorBrightness; + + return $this; + } + + /** + * Gets brightness + * + * @return int + */ + public function getBrightness() + { + return $this->container['brightness']; + } + + /** + * Sets brightness + * + * @param int $brightness brightness + * + * @return $this + */ + public function setBrightness($brightness) + { + $this->container['brightness'] = $brightness; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ChannelGroupExecuteActionRequest.php b/lib/Model/ChannelGroupExecuteActionRequest.php deleted file mode 100644 index 787f0c3..0000000 --- a/lib/Model/ChannelGroupExecuteActionRequest.php +++ /dev/null @@ -1,331 +0,0 @@ - '\Swagger\Client\Model\ChannelFunctionActionEnum', - 'percentage' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'action' => null, - 'percentage' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'action' => 'action', - 'percentage' => 'percentage' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'action' => 'setAction', - 'percentage' => 'setPercentage' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'action' => 'getAction', - 'percentage' => 'getPercentage' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['action'] = isset($data['action']) ? $data['action'] : null; - $this->container['percentage'] = isset($data['percentage']) ? $data['percentage'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets action - * - * @return \Swagger\Client\Model\ChannelFunctionActionEnum - */ - public function getAction() - { - return $this->container['action']; - } - - /** - * Sets action - * - * @param \Swagger\Client\Model\ChannelFunctionActionEnum $action action - * - * @return $this - */ - public function setAction($action) - { - $this->container['action'] = $action; - - return $this; - } - - /** - * Gets percentage - * - * @return int - */ - public function getPercentage() - { - return $this->container['percentage']; - } - - /** - * Sets percentage - * - * @param int $percentage percentage - * - * @return $this - */ - public function setPercentage($percentage) - { - $this->container['percentage'] = $percentage; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/ChannelGroupRequest.php b/lib/Model/ChannelGroupRequest.php index 0feeba3..d8af48d 100644 --- a/lib/Model/ChannelGroupRequest.php +++ b/lib/Model/ChannelGroupRequest.php @@ -213,6 +213,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['channelIds'] === null) { + $invalidProperties[] = "'channelIds' can't be null"; + } return $invalidProperties; } diff --git a/lib/Model/ScheduleRequest.php b/lib/Model/ScheduleRequest.php index 6f66254..048178a 100644 --- a/lib/Model/ScheduleRequest.php +++ b/lib/Model/ScheduleRequest.php @@ -250,6 +250,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['channelId'] === null) { + $invalidProperties[] = "'channelId' can't be null"; + } + if ($this->container['actionId'] === null) { + $invalidProperties[] = "'actionId' can't be null"; + } + if ($this->container['mode'] === null) { + $invalidProperties[] = "'mode' can't be null"; + } $allowedValues = $this->getModeAllowableValues(); if (!is_null($this->container['mode']) && !in_array($this->container['mode'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -258,6 +267,9 @@ public function listInvalidProperties() ); } + if ($this->container['timeExpression'] === null) { + $invalidProperties[] = "'timeExpression' can't be null"; + } return $invalidProperties; } @@ -341,7 +353,7 @@ public function getMode() public function setMode($mode) { $allowedValues = $this->getModeAllowableValues(); - if (!is_null($mode) && !in_array($mode, $allowedValues, true)) { + if (!in_array($mode, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'mode', must be one of '%s'", diff --git a/swagger.json b/swagger.json index 139cf2f..d4c9807 100644 --- a/swagger.json +++ b/swagger.json @@ -262,7 +262,7 @@ "description" : "Defines an action to execute on channel. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions).", "required" : true, "schema" : { - "$ref" : "#/definitions/Channel execute action request" + "$ref" : "#/definitions/ChannelExecuteActionRequest" } } ], "responses" : { @@ -531,7 +531,7 @@ "description" : "Defines an action to execute on channel group. The `action` key is always required. The rest of the keys are params depending on the chosen action. Read more on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Actions).", "required" : true, "schema" : { - "$ref" : "#/definitions/Channel Group execute action request" + "$ref" : "#/definitions/ChannelExecuteActionRequest" } } ], "responses" : { @@ -4500,6 +4500,7 @@ } }, "ChannelGroupRequest" : { + "required" : [ "channelIds" ], "properties" : { "caption" : { "type" : "string" @@ -4622,6 +4623,35 @@ "type" : "string", "enum" : [ "OPEN", "CLOSE", "SHUT", "REVEAL", "REVEAL_PARTIALLY", "TURN_ON", "TURN_OFF", "SET_RGBW_PARAMETERS", "OPEN_CLOSE", "STOP" ] }, + "ChannelExecuteActionRequest" : { + "required" : [ "action" ], + "properties" : { + "action" : { + "$ref" : "#/definitions/ChannelFunctionActionEnum" + }, + "percentage" : { + "type" : "integer", + "example" : 40 + }, + "color" : { + "type" : "string", + "example" : "0x00FF00" + }, + "color_brightness" : { + "type" : "integer" + }, + "brightness" : { + "type" : "integer" + } + }, + "example" : { + "brightness" : 6, + "color" : "0x00FF00", + "color_brightness" : 0, + "percentage" : 40, + "action" : { } + } + }, "ChannelParam" : { "type" : "integer", "description" : "Configuration of the channel behavior. Value meaning depends on the chosen channel function. See more details on [Github Wiki](https://github.com/SUPLA/supla-cloud/wiki/Channel-Functions-parameters)." @@ -6327,6 +6357,7 @@ } }, "ScheduleRequest" : { + "required" : [ "actionId", "channelId", "mode", "timeExpression" ], "properties" : { "channelId" : { "type" : "integer" @@ -6465,22 +6496,6 @@ } } }, - "Channel execute action request" : { - "properties" : { - "action" : { - "$ref" : "#/definitions/ChannelFunctionActionEnum" - }, - "percentage" : { - "type" : "integer", - "example" : 40 - } - }, - "title" : "Channel execute action request", - "example" : { - "percentage" : 40, - "action" : { } - } - }, "Channel action execution failed response" : { "properties" : { "status" : { @@ -6529,22 +6544,6 @@ "date_timestamp" : 0 } }, - "Channel Group execute action request" : { - "properties" : { - "action" : { - "$ref" : "#/definitions/ChannelFunctionActionEnum" - }, - "percentage" : { - "type" : "integer", - "example" : 40 - } - }, - "title" : "Channel Group execute action request", - "example" : { - "percentage" : 40, - "action" : { } - } - }, "Client App update request" : { "properties" : { "caption" : { From 1a3c9abf3fe75ac7a800f26b701921fc9326e406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Wed, 2 May 2018 15:34:39 +0200 Subject: [PATCH 12/13] Add generation instructions --- Development.md | 9 ++++++++ README.md | 26 +++++++---------------- codegen-template/README.mustache | 36 +++++++------------------------- 3 files changed, 23 insertions(+), 48 deletions(-) create mode 100644 Development.md diff --git a/Development.md b/Development.md new file mode 100644 index 0000000..7998e44 --- /dev/null +++ b/Development.md @@ -0,0 +1,9 @@ +# Regenerate the Client: + +1. Download resolved JSON API Specification from [SwaggerHub](https://app.swaggerhub.com/apis/supla/supla-cloud-api) and save it as `swagger.json` in project's root. +1. Download `swagger-codegent-cli` jar file from the [Maven repo](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/) and save it as `swagger-codegen.jar` in project's root. +1. Make sure you have `java` installed and available in your command line. +1. Run `composer install` +1. Run `composer run-script generate` +1. Declare all possibly new endpoints in the `SuplApi` class PHPDOC. +1. Review, commit and push API changes. diff --git a/README.md b/README.md index 8fe2ab1..8311a6f 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ Then create an instance of a client in your code. 'svrX.supla.org', - 'clientId' => 'YOUR_CLIENT_ID', - 'secret' => 'YOUR_SECRET', - 'username' => 'YOUR_USERNAME', - 'password' => 'YOUR_PASSWORD', -]); +$client = new SuplaApi( + 'https://svr4.supla.org', // address of the SUPLA Cloud + '1_6cabrio4xdcsw8sk4socc04k00os4ssw88wc0kkws0g4ogkwgg', // Client ID + '54etn7d5ops0cooww80s0c8o88ssgkgsw4c4o8ks4wswgc0ww4', // Client Secret + 'api_1', // Username + 'pass' // Password +); ``` ## Requirements @@ -126,15 +126,3 @@ Class | Method | HTTP request | Description - [UserData](docs/Model/UserData.md) - [UserUpdateRequest](docs/Model/UserUpdateRequest.md) - -## Documentation For Authorization - - -## password - -- **Type**: OAuth -- **Flow**: password -- **Authorization URL**: -- **Scopes**: - - **restapi**: full API access - diff --git a/codegen-template/README.mustache b/codegen-template/README.mustache index 2e1ea42..f60d265 100644 --- a/codegen-template/README.mustache +++ b/codegen-template/README.mustache @@ -27,13 +27,13 @@ Then create an instance of a client in your code. 'svrX.supla.org', - 'clientId' => 'YOUR_CLIENT_ID', - 'secret' => 'YOUR_SECRET', - 'username' => 'YOUR_USERNAME', - 'password' => 'YOUR_PASSWORD', -]); +$client = new SuplaApi( + 'https://svr4.supla.org', // address of the SUPLA Cloud + '1_6cabrio4xdcsw8sk4socc04k00os4ssw88wc0kkws0g4ogkwgg', // Client ID + '54etn7d5ops0cooww80s0c8o88ssgkgsw4c4o8ks4wswgc0ww4', // Client Secret + 'api_1', // Username + 'pass' // Password +); ``` ## Requirements @@ -53,25 +53,3 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md) {{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} All endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}## {{{name}}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} From 63d56ecdc1829c627ee4c9b78a3adffce5d76ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Fr=C4=85cz?= Date: Fri, 4 May 2018 23:01:59 +0200 Subject: [PATCH 13/13] Access ID -> Access Identifier --- README.md | 14 +- ...ccessIDsApi.md => AccessIdentifiersApi.md} | 56 ++-- .../{AccessID.md => AccessIdentifier.md} | 4 +- ...st.md => AccessIdentifierUpdateRequest.md} | 6 +- docs/Model/ClientApp.md | 2 +- docs/Model/Location.md | 2 +- ...essIDsApi.php => AccessIdentifiersApi.php} | 276 +++++++++--------- .../{AccessID.php => AccessIdentifier.php} | 10 +- ....php => AccessIdentifierUpdateRequest.php} | 12 +- lib/Model/ClientApp.php | 6 +- lib/Model/Location.php | 6 +- src/SuplaApi.php | 2 +- swagger.json | 60 ++-- 13 files changed, 228 insertions(+), 228 deletions(-) rename docs/Api/{AccessIDsApi.md => AccessIdentifiersApi.md} (57%) rename docs/Model/{AccessID.md => AccessIdentifier.md} (92%) rename docs/Model/{AccessIDUpdateRequest.md => AccessIdentifierUpdateRequest.md} (71%) rename lib/Api/{AccessIDsApi.php => AccessIdentifiersApi.php} (85%) rename lib/Model/{AccessID.php => AccessIdentifier.php} (97%) rename lib/Model/{AccessIDUpdateRequest.php => AccessIdentifierUpdateRequest.php} (95%) diff --git a/README.md b/README.md index 8311a6f..eb2a6a2 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,11 @@ All URIs are relative to *https://cloud.supla.org/api/v2.2.0* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AccessIDsApi* | [**createAccessID**](docs/Api/AccessIDsApi.md#createaccessid) | **POST** /accessids | Create a new Access ID -*AccessIDsApi* | [**deleteAccessID**](docs/Api/AccessIDsApi.md#deleteaccessid) | **DELETE** /accessids/{id} | Delete Access Identifier -*AccessIDsApi* | [**getAccessID**](docs/Api/AccessIDsApi.md#getaccessid) | **GET** /accessids | Get Access IDs list -*AccessIDsApi* | [**getAccessID_0**](docs/Api/AccessIDsApi.md#getaccessid_0) | **GET** /accessids/{id} | Get Access ID -*AccessIDsApi* | [**updateAccessID**](docs/Api/AccessIDsApi.md#updateaccessid) | **PUT** /accessids/{id} | Update Access ID +*AccessIdentifiersApi* | [**createAccessIdentifier**](docs/Api/AccessIdentifiersApi.md#createaccessidentifier) | **POST** /accessids | Create a new Access Identifier +*AccessIdentifiersApi* | [**deleteAccessIdentifier**](docs/Api/AccessIdentifiersApi.md#deleteaccessidentifier) | **DELETE** /accessids/{id} | Delete Access Identifier +*AccessIdentifiersApi* | [**getAccessIdentifier**](docs/Api/AccessIdentifiersApi.md#getaccessidentifier) | **GET** /accessids/{id} | Get Access Identifier +*AccessIdentifiersApi* | [**getAccessIdentifiers**](docs/Api/AccessIdentifiersApi.md#getaccessidentifiers) | **GET** /accessids | Get Access Identifiers list +*AccessIdentifiersApi* | [**updateAccessIdentifier**](docs/Api/AccessIdentifiersApi.md#updateaccessidentifier) | **PUT** /accessids/{id} | Update Access Identifier *ChannelGroupsApi* | [**createChannelGroup**](docs/Api/ChannelGroupsApi.md#createchannelgroup) | **POST** /channel-groups | Create a new channel group *ChannelGroupsApi* | [**deleteChannelGroup**](docs/Api/ChannelGroupsApi.md#deletechannelgroup) | **DELETE** /channel-groups/{id} | Delete Channel Group *ChannelGroupsApi* | [**executeChannelGroupAction**](docs/Api/ChannelGroupsApi.md#executechannelgroupaction) | **PATCH** /channel-groups/{id} | Execute action on the channel group @@ -91,8 +91,8 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [AccessID](docs/Model/AccessID.md) - - [AccessIDUpdateRequest](docs/Model/AccessIDUpdateRequest.md) + - [AccessIdentifier](docs/Model/AccessIdentifier.md) + - [AccessIdentifierUpdateRequest](docs/Model/AccessIdentifierUpdateRequest.md) - [Channel](docs/Model/Channel.md) - [ChannelActionExecutionFailedResponse](docs/Model/ChannelActionExecutionFailedResponse.md) - [ChannelExecuteActionRequest](docs/Model/ChannelExecuteActionRequest.md) diff --git a/docs/Api/AccessIDsApi.md b/docs/Api/AccessIdentifiersApi.md similarity index 57% rename from docs/Api/AccessIDsApi.md rename to docs/Api/AccessIdentifiersApi.md index 723ff0a..84b3a02 100644 --- a/docs/Api/AccessIDsApi.md +++ b/docs/Api/AccessIdentifiersApi.md @@ -1,21 +1,21 @@ -# Swagger\Client\AccessIDsApi +# Swagger\Client\AccessIdentifiersApi Method | HTTP request | Description ------------- | ------------- | ------------- -[**createAccessID**](AccessIDsApi.md#createAccessID) | **POST** /accessids | Create a new Access ID -[**deleteAccessID**](AccessIDsApi.md#deleteAccessID) | **DELETE** /accessids/{id} | Delete Access Identifier -[**getAccessID**](AccessIDsApi.md#getAccessID) | **GET** /accessids | Get Access IDs list -[**getAccessID_0**](AccessIDsApi.md#getAccessID_0) | **GET** /accessids/{id} | Get Access ID -[**updateAccessID**](AccessIDsApi.md#updateAccessID) | **PUT** /accessids/{id} | Update Access ID +[**createAccessIdentifier**](AccessIdentifiersApi.md#createAccessIdentifier) | **POST** /accessids | Create a new Access Identifier +[**deleteAccessIdentifier**](AccessIdentifiersApi.md#deleteAccessIdentifier) | **DELETE** /accessids/{id} | Delete Access Identifier +[**getAccessIdentifier**](AccessIdentifiersApi.md#getAccessIdentifier) | **GET** /accessids/{id} | Get Access Identifier +[**getAccessIdentifiers**](AccessIdentifiersApi.md#getAccessIdentifiers) | **GET** /accessids | Get Access Identifiers list +[**updateAccessIdentifier**](AccessIdentifiersApi.md#updateAccessIdentifier) | **PUT** /accessids/{id} | Update Access Identifier -# **createAccessID** +# **createAccessIdentifier** -Create a new Access ID +Create a new Access Identifier ### Example ```php -$result = $client->accessIDs()->createAccessID(); +$result = $client->accessIdentifiers()->createAccessIdentifier(); print_r($result); ``` @@ -23,18 +23,18 @@ print_r($result); ### Return type -[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) +[**\Swagger\Client\Model\AccessIdentifier**](../Model/AccessIdentifier.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) -# **deleteAccessID** +# **deleteAccessIdentifier** Delete Access Identifier ### Example ```php $id = 56; // int | -$client->accessIDs()->deleteAccessID($id); +$client->accessIdentifiers()->deleteAccessIdentifier($id); ``` @@ -49,14 +49,15 @@ 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) -# **getAccessID** +# **getAccessIdentifier** -Get Access IDs list +Get Access Identifier ### Example ```php +$id = 56; // int | $include = array("include_example"); // string[] | Specify what extra fields to include in the response. -$result = $client->accessIDs()->getAccessID($include); +$result = $client->accessIdentifiers()->getAccessIdentifier($id, $include); print_r($result); ``` @@ -64,23 +65,23 @@ print_r($result); ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **id** | **int**| | **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type -[**\Swagger\Client\Model\AccessID[]**](../Model/AccessID.md) +[**\Swagger\Client\Model\AccessIdentifier**](../Model/AccessIdentifier.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) -# **getAccessID_0** +# **getAccessIdentifiers** -Get Access ID +Get Access Identifiers list ### Example ```php -$id = 56; // int | $include = array("include_example"); // string[] | Specify what extra fields to include in the response. -$result = $client->accessIDs()->getAccessID_0($id, $include); +$result = $client->accessIdentifiers()->getAccessIdentifiers($include); print_r($result); ``` @@ -88,24 +89,23 @@ print_r($result); ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int**| | **include** | [**string[]**](../Model/string.md)| Specify what extra fields to include in the response. | [optional] ### Return type -[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) +[**\Swagger\Client\Model\AccessIdentifier[]**](../Model/AccessIdentifier.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) -# **updateAccessID** +# **updateAccessIdentifier** -Update Access ID +Update Access Identifier ### Example ```php $id = 56; // int | -$body = new \Swagger\Client\Model\AccessIDUpdateRequest(); // \Swagger\Client\Model\AccessIDUpdateRequest | -$result = $client->accessIDs()->updateAccessID($id, $body); +$body = new \Swagger\Client\Model\AccessIdentifierUpdateRequest(); // \Swagger\Client\Model\AccessIdentifierUpdateRequest | +$result = $client->accessIdentifiers()->updateAccessIdentifier($id, $body); print_r($result); ``` @@ -114,11 +114,11 @@ print_r($result); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | - **body** | [**\Swagger\Client\Model\AccessIDUpdateRequest**](../Model/AccessIDUpdateRequest.md)| | + **body** | [**\Swagger\Client\Model\AccessIdentifierUpdateRequest**](../Model/AccessIdentifierUpdateRequest.md)| | ### Return type -[**\Swagger\Client\Model\AccessID**](../Model/AccessID.md) +[**\Swagger\Client\Model\AccessIdentifier**](../Model/AccessIdentifier.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) diff --git a/docs/Model/AccessID.md b/docs/Model/AccessIdentifier.md similarity index 92% rename from docs/Model/AccessID.md rename to docs/Model/AccessIdentifier.md index fc4b22f..70cef92 100644 --- a/docs/Model/AccessID.md +++ b/docs/Model/AccessIdentifier.md @@ -1,9 +1,9 @@ -# AccessID +# AccessIdentifier ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Access ID identifier | [optional] +**id** | **int** | Access Identifier identifier | [optional] **caption** | **string** | Location caption | [optional] **enabled** | **bool** | `true` if the location is enabled, `false` otherwise | [optional] **locationsIds** | **int[]** | array containing the location idenfifiers assigned to this access ID | [optional] diff --git a/docs/Model/AccessIDUpdateRequest.md b/docs/Model/AccessIdentifierUpdateRequest.md similarity index 71% rename from docs/Model/AccessIDUpdateRequest.md rename to docs/Model/AccessIdentifierUpdateRequest.md index 83c768b..1d6b377 100644 --- a/docs/Model/AccessIDUpdateRequest.md +++ b/docs/Model/AccessIdentifierUpdateRequest.md @@ -1,4 +1,4 @@ -# AccessIDUpdateRequest +# AccessIdentifierUpdateRequest ## Properties Name | Type | Description | Notes @@ -6,8 +6,8 @@ Name | Type | Description | Notes **enabled** | **bool** | | [optional] **caption** | **string** | | [optional] **password** | **string** | Provide new password if you want to change it. | [optional] -**locationsIds** | **int[]** | Locations identifiers to assign to this Access ID. | [optional] -**clientAppsIds** | **int[]** | Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. | [optional] +**locationsIds** | **int[]** | Locations identifiers to assign to this Access Identifier. | [optional] +**clientAppsIds** | **int[]** | Client Apps identifiers to assign to this Access Identifier. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning. | [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/ClientApp.md b/docs/Model/ClientApp.md index 62e88c3..8488fd9 100644 --- a/docs/Model/ClientApp.md +++ b/docs/Model/ClientApp.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **protocolVersion** | **int** | | [optional] **accessIdId** | **int** | | [optional] **connected** | **bool** | | [optional] -**accessId** | [**\Swagger\Client\Model\AccessID**](AccessID.md) | | [optional] +**accessId** | [**\Swagger\Client\Model\AccessIdentifier**](AccessIdentifier.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/Location.md b/docs/Model/Location.md index 5229200..3af4b58 100644 --- a/docs/Model/Location.md +++ b/docs/Model/Location.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **password** | **string** | Location password (plain text). Returned only if requested by the `include` parameter. | [optional] **iodevices** | [**\Swagger\Client\Model\Device[]**](Device.md) | Returned only if requested by the `include` parameter. | [optional] **channelGroups** | [**\Swagger\Client\Model\ChannelGroup[]**](ChannelGroup.md) | Returned only if requested by the `include` parameter. | [optional] -**accessIds** | [**\Swagger\Client\Model\AccessID[]**](AccessID.md) | Returned only if requested by the `include` parameter. | [optional] +**accessIds** | [**\Swagger\Client\Model\AccessIdentifier[]**](AccessIdentifier.md) | Returned only if requested by the `include` parameter. | [optional] **channels** | [**\Swagger\Client\Model\Channel[]**](Channel.md) | Returned only if requested by the `include` parameter. | [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/lib/Api/AccessIDsApi.php b/lib/Api/AccessIdentifiersApi.php similarity index 85% rename from lib/Api/AccessIDsApi.php rename to lib/Api/AccessIdentifiersApi.php index e3b34d3..f92d3b1 100644 --- a/lib/Api/AccessIDsApi.php +++ b/lib/Api/AccessIdentifiersApi.php @@ -1,6 +1,6 @@ createAccessIDWithHttpInfo(); + list($response) = $this->createAccessIdentifierWithHttpInfo(); return $response; } /** - * Operation createAccessIDWithHttpInfo + * Operation createAccessIdentifierWithHttpInfo * - * Create a new Access ID + * Create a new Access Identifier * * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\AccessIdentifier, HTTP status code, HTTP response headers (array of strings) */ - public function createAccessIDWithHttpInfo() + public function createAccessIdentifierWithHttpInfo() { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->createAccessIDRequest(); + $returnType = '\Swagger\Client\Model\AccessIdentifier'; + $request = $this->createAccessIdentifierRequest(); try { $options = $this->createHttpClientOption(); @@ -167,7 +167,7 @@ public function createAccessIDWithHttpInfo() case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\AccessID', + '\Swagger\Client\Model\AccessIdentifier', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -178,17 +178,17 @@ public function createAccessIDWithHttpInfo() } /** - * Operation createAccessIDAsync + * Operation createAccessIdentifierAsync * - * Create a new Access ID + * Create a new Access Identifier * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAccessIDAsync() + public function createAccessIdentifierAsync() { - return $this->createAccessIDAsyncWithHttpInfo() + return $this->createAccessIdentifierAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -197,18 +197,18 @@ function ($response) { } /** - * Operation createAccessIDAsyncWithHttpInfo + * Operation createAccessIdentifierAsyncWithHttpInfo * - * Create a new Access ID + * Create a new Access Identifier * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAccessIDAsyncWithHttpInfo() + public function createAccessIdentifierAsyncWithHttpInfo() { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->createAccessIDRequest(); + $returnType = '\Swagger\Client\Model\AccessIdentifier'; + $request = $this->createAccessIdentifierRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -248,13 +248,13 @@ function ($exception) { } /** - * Create request for operation 'createAccessID' + * Create request for operation 'createAccessIdentifier' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createAccessIDRequest() + protected function createAccessIdentifierRequest() { $resourcePath = '/accessids'; @@ -335,7 +335,7 @@ protected function createAccessIDRequest() } /** - * Operation deleteAccessID + * Operation deleteAccessIdentifier * * Delete Access Identifier * @@ -345,13 +345,13 @@ protected function createAccessIDRequest() * @throws \InvalidArgumentException * @return void */ - public function deleteAccessID($id) + public function deleteAccessIdentifier($id) { - $this->deleteAccessIDWithHttpInfo($id); + $this->deleteAccessIdentifierWithHttpInfo($id); } /** - * Operation deleteAccessIDWithHttpInfo + * Operation deleteAccessIdentifierWithHttpInfo * * Delete Access Identifier * @@ -361,10 +361,10 @@ public function deleteAccessID($id) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAccessIDWithHttpInfo($id) + public function deleteAccessIdentifierWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteAccessIDRequest($id); + $request = $this->deleteAccessIdentifierRequest($id); try { $options = $this->createHttpClientOption(); @@ -404,7 +404,7 @@ public function deleteAccessIDWithHttpInfo($id) } /** - * Operation deleteAccessIDAsync + * Operation deleteAccessIdentifierAsync * * Delete Access Identifier * @@ -413,9 +413,9 @@ public function deleteAccessIDWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccessIDAsync($id) + public function deleteAccessIdentifierAsync($id) { - return $this->deleteAccessIDAsyncWithHttpInfo($id) + return $this->deleteAccessIdentifierAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -424,7 +424,7 @@ function ($response) { } /** - * Operation deleteAccessIDAsyncWithHttpInfo + * Operation deleteAccessIdentifierAsyncWithHttpInfo * * Delete Access Identifier * @@ -433,10 +433,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccessIDAsyncWithHttpInfo($id) + public function deleteAccessIdentifierAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->deleteAccessIDRequest($id); + $request = $this->deleteAccessIdentifierRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -462,19 +462,19 @@ function ($exception) { } /** - * Create request for operation 'deleteAccessID' + * Create request for operation 'deleteAccessIdentifier' * * @param int $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAccessIDRequest($id) + protected function deleteAccessIdentifierRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteAccessID' + 'Missing the required parameter $id when calling deleteAccessIdentifier' ); } @@ -564,37 +564,39 @@ protected function deleteAccessIDRequest($id) } /** - * Operation getAccessID + * Operation getAccessIdentifier * - * Get Access IDs list + * Get Access Identifier * + * @param int $id id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AccessID[] + * @return \Swagger\Client\Model\AccessIdentifier */ - public function getAccessID($include = null) + public function getAccessIdentifier($id, $include = null) { - list($response) = $this->getAccessIDWithHttpInfo($include); + list($response) = $this->getAccessIdentifierWithHttpInfo($id, $include); return $response; } /** - * Operation getAccessIDWithHttpInfo + * Operation getAccessIdentifierWithHttpInfo * - * Get Access IDs list + * Get Access Identifier * + * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AccessID[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\AccessIdentifier, HTTP status code, HTTP response headers (array of strings) */ - public function getAccessIDWithHttpInfo($include = null) + public function getAccessIdentifierWithHttpInfo($id, $include = null) { - $returnType = '\Swagger\Client\Model\AccessID[]'; - $request = $this->getAccessIDRequest($include); + $returnType = '\Swagger\Client\Model\AccessIdentifier'; + $request = $this->getAccessIdentifierRequest($id, $include); try { $options = $this->createHttpClientOption(); @@ -645,7 +647,7 @@ public function getAccessIDWithHttpInfo($include = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\AccessID[]', + '\Swagger\Client\Model\AccessIdentifier', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -656,18 +658,19 @@ public function getAccessIDWithHttpInfo($include = null) } /** - * Operation getAccessIDAsync + * Operation getAccessIdentifierAsync * - * Get Access IDs list + * Get Access Identifier * + * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessIDAsync($include = null) + public function getAccessIdentifierAsync($id, $include = null) { - return $this->getAccessIDAsyncWithHttpInfo($include) + return $this->getAccessIdentifierAsyncWithHttpInfo($id, $include) ->then( function ($response) { return $response[0]; @@ -676,19 +679,20 @@ function ($response) { } /** - * Operation getAccessIDAsyncWithHttpInfo + * Operation getAccessIdentifierAsyncWithHttpInfo * - * Get Access IDs list + * Get Access Identifier * + * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessIDAsyncWithHttpInfo($include = null) + public function getAccessIdentifierAsyncWithHttpInfo($id, $include = null) { - $returnType = '\Swagger\Client\Model\AccessID[]'; - $request = $this->getAccessIDRequest($include); + $returnType = '\Swagger\Client\Model\AccessIdentifier'; + $request = $this->getAccessIdentifierRequest($id, $include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -728,17 +732,24 @@ function ($exception) { } /** - * Create request for operation 'getAccessID' + * Create request for operation 'getAccessIdentifier' * + * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccessIDRequest($include = null) + protected function getAccessIdentifierRequest($id, $include = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getAccessIdentifier' + ); + } - $resourcePath = '/accessids'; + $resourcePath = '/accessids/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -753,6 +764,14 @@ protected function getAccessIDRequest($include = null) $queryParams['include'] = ObjectSerializer::toQueryValue($include); } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; @@ -823,39 +842,37 @@ protected function getAccessIDRequest($include = null) } /** - * Operation getAccessID_0 + * Operation getAccessIdentifiers * - * Get Access ID + * Get Access Identifiers list * - * @param int $id id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AccessID + * @return \Swagger\Client\Model\AccessIdentifier[] */ - public function getAccessID_0($id, $include = null) + public function getAccessIdentifiers($include = null) { - list($response) = $this->getAccessID_0WithHttpInfo($id, $include); + list($response) = $this->getAccessIdentifiersWithHttpInfo($include); return $response; } /** - * Operation getAccessID_0WithHttpInfo + * Operation getAccessIdentifiersWithHttpInfo * - * Get Access ID + * Get Access Identifiers list * - * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\AccessIdentifier[], HTTP status code, HTTP response headers (array of strings) */ - public function getAccessID_0WithHttpInfo($id, $include = null) + public function getAccessIdentifiersWithHttpInfo($include = null) { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->getAccessID_0Request($id, $include); + $returnType = '\Swagger\Client\Model\AccessIdentifier[]'; + $request = $this->getAccessIdentifiersRequest($include); try { $options = $this->createHttpClientOption(); @@ -906,7 +923,7 @@ public function getAccessID_0WithHttpInfo($id, $include = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\AccessID', + '\Swagger\Client\Model\AccessIdentifier[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -917,19 +934,18 @@ public function getAccessID_0WithHttpInfo($id, $include = null) } /** - * Operation getAccessID_0Async + * Operation getAccessIdentifiersAsync * - * Get Access ID + * Get Access Identifiers list * - * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessID_0Async($id, $include = null) + public function getAccessIdentifiersAsync($include = null) { - return $this->getAccessID_0AsyncWithHttpInfo($id, $include) + return $this->getAccessIdentifiersAsyncWithHttpInfo($include) ->then( function ($response) { return $response[0]; @@ -938,20 +954,19 @@ function ($response) { } /** - * Operation getAccessID_0AsyncWithHttpInfo + * Operation getAccessIdentifiersAsyncWithHttpInfo * - * Get Access ID + * Get Access Identifiers list * - * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessID_0AsyncWithHttpInfo($id, $include = null) + public function getAccessIdentifiersAsyncWithHttpInfo($include = null) { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->getAccessID_0Request($id, $include); + $returnType = '\Swagger\Client\Model\AccessIdentifier[]'; + $request = $this->getAccessIdentifiersRequest($include); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -991,24 +1006,17 @@ function ($exception) { } /** - * Create request for operation 'getAccessID_0' + * Create request for operation 'getAccessIdentifiers' * - * @param int $id (required) * @param string[] $include Specify what extra fields to include in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccessID_0Request($id, $include = null) + protected function getAccessIdentifiersRequest($include = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getAccessID_0' - ); - } - $resourcePath = '/accessids/{id}'; + $resourcePath = '/accessids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1023,14 +1031,6 @@ protected function getAccessID_0Request($id, $include = null) $queryParams['include'] = ObjectSerializer::toQueryValue($include); } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -1101,39 +1101,39 @@ protected function getAccessID_0Request($id, $include = null) } /** - * Operation updateAccessID + * Operation updateAccessIdentifier * - * Update Access ID + * Update Access Identifier * * @param int $id id (required) - * @param \Swagger\Client\Model\AccessIDUpdateRequest $body body (required) + * @param \Swagger\Client\Model\AccessIdentifierUpdateRequest $body body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AccessID + * @return \Swagger\Client\Model\AccessIdentifier */ - public function updateAccessID($id, $body) + public function updateAccessIdentifier($id, $body) { - list($response) = $this->updateAccessIDWithHttpInfo($id, $body); + list($response) = $this->updateAccessIdentifierWithHttpInfo($id, $body); return $response; } /** - * Operation updateAccessIDWithHttpInfo + * Operation updateAccessIdentifierWithHttpInfo * - * Update Access ID + * Update Access Identifier * * @param int $id (required) - * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) + * @param \Swagger\Client\Model\AccessIdentifierUpdateRequest $body (required) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AccessID, HTTP status code, HTTP response headers (array of strings) + * @return array of \Swagger\Client\Model\AccessIdentifier, HTTP status code, HTTP response headers (array of strings) */ - public function updateAccessIDWithHttpInfo($id, $body) + public function updateAccessIdentifierWithHttpInfo($id, $body) { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->updateAccessIDRequest($id, $body); + $returnType = '\Swagger\Client\Model\AccessIdentifier'; + $request = $this->updateAccessIdentifierRequest($id, $body); try { $options = $this->createHttpClientOption(); @@ -1184,7 +1184,7 @@ public function updateAccessIDWithHttpInfo($id, $body) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Swagger\Client\Model\AccessID', + '\Swagger\Client\Model\AccessIdentifier', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1195,19 +1195,19 @@ public function updateAccessIDWithHttpInfo($id, $body) } /** - * Operation updateAccessIDAsync + * Operation updateAccessIdentifierAsync * - * Update Access ID + * Update Access Identifier * * @param int $id (required) - * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) + * @param \Swagger\Client\Model\AccessIdentifierUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccessIDAsync($id, $body) + public function updateAccessIdentifierAsync($id, $body) { - return $this->updateAccessIDAsyncWithHttpInfo($id, $body) + return $this->updateAccessIdentifierAsyncWithHttpInfo($id, $body) ->then( function ($response) { return $response[0]; @@ -1216,20 +1216,20 @@ function ($response) { } /** - * Operation updateAccessIDAsyncWithHttpInfo + * Operation updateAccessIdentifierAsyncWithHttpInfo * - * Update Access ID + * Update Access Identifier * * @param int $id (required) - * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) + * @param \Swagger\Client\Model\AccessIdentifierUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccessIDAsyncWithHttpInfo($id, $body) + public function updateAccessIdentifierAsyncWithHttpInfo($id, $body) { - $returnType = '\Swagger\Client\Model\AccessID'; - $request = $this->updateAccessIDRequest($id, $body); + $returnType = '\Swagger\Client\Model\AccessIdentifier'; + $request = $this->updateAccessIdentifierRequest($id, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1269,26 +1269,26 @@ function ($exception) { } /** - * Create request for operation 'updateAccessID' + * Create request for operation 'updateAccessIdentifier' * * @param int $id (required) - * @param \Swagger\Client\Model\AccessIDUpdateRequest $body (required) + * @param \Swagger\Client\Model\AccessIdentifierUpdateRequest $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAccessIDRequest($id, $body) + protected function updateAccessIdentifierRequest($id, $body) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateAccessID' + 'Missing the required parameter $id when calling updateAccessIdentifier' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling updateAccessID' + 'Missing the required parameter $body when calling updateAccessIdentifier' ); } diff --git a/lib/Model/AccessID.php b/lib/Model/AccessIdentifier.php similarity index 97% rename from lib/Model/AccessID.php rename to lib/Model/AccessIdentifier.php index 1b022a2..194d4dc 100644 --- a/lib/Model/AccessID.php +++ b/lib/Model/AccessIdentifier.php @@ -1,6 +1,6 @@ 'int', 'accessIdId' => 'int', 'connected' => 'bool', - 'accessId' => '\Swagger\Client\Model\AccessID' + 'accessId' => '\Swagger\Client\Model\AccessIdentifier' ]; /** @@ -567,7 +567,7 @@ public function setConnected($connected) /** * Gets accessId * - * @return \Swagger\Client\Model\AccessID + * @return \Swagger\Client\Model\AccessIdentifier */ public function getAccessId() { @@ -577,7 +577,7 @@ public function getAccessId() /** * Sets accessId * - * @param \Swagger\Client\Model\AccessID $accessId accessId + * @param \Swagger\Client\Model\AccessIdentifier $accessId accessId * * @return $this */ diff --git a/lib/Model/Location.php b/lib/Model/Location.php index 7065153..847b451 100644 --- a/lib/Model/Location.php +++ b/lib/Model/Location.php @@ -67,7 +67,7 @@ class Location implements ModelInterface, ArrayAccess 'password' => 'string', 'iodevices' => '\Swagger\Client\Model\Device[]', 'channelGroups' => '\Swagger\Client\Model\ChannelGroup[]', - 'accessIds' => '\Swagger\Client\Model\AccessID[]', + 'accessIds' => '\Swagger\Client\Model\AccessIdentifier[]', 'channels' => '\Swagger\Client\Model\Channel[]' ]; @@ -513,7 +513,7 @@ public function setChannelGroups($channelGroups) /** * Gets accessIds * - * @return \Swagger\Client\Model\AccessID[] + * @return \Swagger\Client\Model\AccessIdentifier[] */ public function getAccessIds() { @@ -523,7 +523,7 @@ public function getAccessIds() /** * Sets accessIds * - * @param \Swagger\Client\Model\AccessID[] $accessIds Returned only if requested by the `include` parameter. + * @param \Swagger\Client\Model\AccessIdentifier[] $accessIds Returned only if requested by the `include` parameter. * * @return $this */ diff --git a/src/SuplaApi.php b/src/SuplaApi.php index af38353..90dc7b5 100644 --- a/src/SuplaApi.php +++ b/src/SuplaApi.php @@ -20,7 +20,7 @@ use GuzzleHttp\Client; /** - * @method \Swagger\Client\Api\AccessIDsApi accessIds() + * @method \Swagger\Client\Api\AccessIdentifiersApi accessIdentifiers() * @method \Swagger\Client\Api\ChannelGroupsApi channelGroups() * @method \Swagger\Client\Api\ChannelsApi channels() * @method \Swagger\Client\Api\ClientAppsApi clientApps() diff --git a/swagger.json b/swagger.json index d4c9807..9f41ab4 100644 --- a/swagger.json +++ b/swagger.json @@ -15,9 +15,9 @@ "paths" : { "/accessids" : { "get" : { - "tags" : [ "Access IDs" ], - "summary" : "Get Access IDs list", - "operationId" : "getAccessID", + "tags" : [ "Access Identifiers" ], + "summary" : "Get Access Identifiers list", + "operationId" : "getAccessIdentifiers", "parameters" : [ { "name" : "include", "in" : "query", @@ -32,26 +32,26 @@ } ], "responses" : { "200" : { - "description" : "List of Access IDs owned by the current user.", + "description" : "List of Access Identifiers owned by the current user.", "schema" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AccessID" + "$ref" : "#/definitions/AccessIdentifier" } } } } }, "post" : { - "tags" : [ "Access IDs" ], - "summary" : "Create a new Access ID", - "operationId" : "createAccessID", + "tags" : [ "Access Identifiers" ], + "summary" : "Create a new Access Identifier", + "operationId" : "createAccessIdentifier", "parameters" : [ ], "responses" : { "201" : { - "description" : "Newely created AccessID with automatic name", + "description" : "Newely created AccessIdentifier with automatic name", "schema" : { - "$ref" : "#/definitions/AccessID" + "$ref" : "#/definitions/AccessIdentifier" } } } @@ -59,9 +59,9 @@ }, "/accessids/{id}" : { "get" : { - "tags" : [ "Access IDs" ], - "summary" : "Get Access ID", - "operationId" : "getAccessID", + "tags" : [ "Access Identifiers" ], + "summary" : "Get Access Identifier", + "operationId" : "getAccessIdentifier", "parameters" : [ { "name" : "id", "in" : "path", @@ -81,17 +81,17 @@ } ], "responses" : { "200" : { - "description" : "Get Access ID", + "description" : "Get Access Identifier", "schema" : { - "$ref" : "#/definitions/AccessID" + "$ref" : "#/definitions/AccessIdentifier" } } } }, "put" : { - "tags" : [ "Access IDs" ], - "summary" : "Update Access ID", - "operationId" : "updateAccessID", + "tags" : [ "Access Identifiers" ], + "summary" : "Update Access Identifier", + "operationId" : "updateAccessIdentifier", "parameters" : [ { "name" : "id", "in" : "path", @@ -102,22 +102,22 @@ "name" : "body", "required" : true, "schema" : { - "$ref" : "#/definitions/Access ID update request" + "$ref" : "#/definitions/Access Identifier update request" } } ], "responses" : { "200" : { "description" : "Definition generated from Swagger Inspector", "schema" : { - "$ref" : "#/definitions/AccessID" + "$ref" : "#/definitions/AccessIdentifier" } } } }, "delete" : { - "tags" : [ "Access IDs" ], + "tags" : [ "Access Identifiers" ], "summary" : "Delete Access Identifier", - "operationId" : "deleteAccessID", + "operationId" : "deleteAccessIdentifier", "parameters" : [ { "name" : "id", "in" : "path", @@ -1127,11 +1127,11 @@ } }, "definitions" : { - "AccessID" : { + "AccessIdentifier" : { "properties" : { "id" : { "type" : "integer", - "description" : "Access ID identifier" + "description" : "Access Identifier identifier" }, "caption" : { "type" : "string", @@ -3172,7 +3172,7 @@ "type" : "boolean" }, "accessId" : { - "$ref" : "#/definitions/AccessID" + "$ref" : "#/definitions/AccessIdentifier" } }, "example" : { @@ -5201,7 +5201,7 @@ "type" : "array", "description" : "Returned only if requested by the `include` parameter.", "items" : { - "$ref" : "#/definitions/AccessID" + "$ref" : "#/definitions/AccessIdentifier" } }, "channels" : { @@ -6399,7 +6399,7 @@ "retry" : true } }, - "Access ID update request" : { + "Access Identifier update request" : { "properties" : { "enabled" : { "type" : "boolean" @@ -6413,20 +6413,20 @@ }, "locationsIds" : { "type" : "array", - "description" : "Locations identifiers to assign to this Access ID.", + "description" : "Locations identifiers to assign to this Access Identifier.", "items" : { "type" : "integer" } }, "clientAppsIds" : { "type" : "array", - "description" : "Client Apps identifiers to assign to this Access ID. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning.", + "description" : "Client Apps identifiers to assign to this Access Identifier. If client app is connected to any other Client ID, it will be disconnected from the old one before assigning.", "items" : { "type" : "integer" } } }, - "title" : "Access ID update request", + "title" : "Access Identifier update request", "example" : { "password" : "password", "caption" : "caption",