From 01da151ce8ec5e72f6a8a1655a7b7b1c09ed97d1 Mon Sep 17 00:00:00 2001 From: siebe Date: Wed, 20 Nov 2019 13:35:35 +0100 Subject: [PATCH] Release of version 1.1.12 --- README.md | 28 +- autoload.php | 54 - docs/Api/BlockApi.md | 56 +- docs/Api/BroadcastApi.md | 183 +- docs/Api/CampaignApi.md | 75 +- docs/Api/ContactApi.md | 75 +- docs/Api/GenreApi.md | 30 +- docs/Api/ItemApi.md | 262 +- docs/Api/ModelTypeApi.md | 30 +- docs/Api/PresenterApi.md | 75 +- docs/Api/ProgramApi.md | 79 +- docs/Api/StationApi.md | 13 +- docs/Api/StoryApi.md | 75 +- docs/Api/StringApi.md | 15 +- docs/Api/TagApi.md | 75 +- docs/Api/UserApi.md | 60 +- docs/Api/VisualSlideApi.md | 13 +- docs/Model/BroadcastEPGDay.md | 2 +- docs/Model/BroadcastRelations.md | 1 + docs/Model/BroadcastResult.md | 1 + docs/Model/CampaignOutputOnly.md | 2 +- docs/Model/CampaignResult.md | 2 +- docs/Model/CampaignTemplateItem.md | 17 + docs/Model/ContactRelations.md | 2 +- docs/Model/ContactResult.md | 2 +- docs/Model/Data.md | 1 + docs/Model/Data1.md | 1 + docs/Model/Data2.md | 14 + docs/Model/Data3.md | 10 + docs/Model/ProgramRelations.md | 1 + docs/Model/ProgramResult.md | 1 + docs/Model/StationResultStation.md | 3 + docs/Model/StoryRelations.md | 2 +- docs/Model/StoryResult.md | 2 +- lib/Api/BlockApi.php | 1284 ++++-- lib/Api/BroadcastApi.php | 3525 ++++++++++++--- lib/Api/CampaignApi.php | 1614 +++++-- lib/Api/ContactApi.php | 1605 +++++-- lib/Api/GenreApi.php | 732 +++- lib/Api/ItemApi.php | 3782 ++++++++++++++--- lib/Api/ModelTypeApi.php | 768 +++- lib/Api/PresenterApi.php | 1605 +++++-- lib/Api/ProgramApi.php | 1657 ++++++-- lib/Api/StationApi.php | 341 +- lib/Api/StoryApi.php | 1595 +++++-- lib/Api/StringApi.php | 377 +- lib/Api/TagApi.php | 1614 +++++-- lib/Api/UserApi.php | 1268 ++++-- lib/Api/VisualSlideApi.php | 341 +- lib/ApiClient.php | 371 -- lib/ApiException.php | 14 +- lib/Configuration.php | 358 +- lib/HeaderSelector.php | 110 + lib/Model/Block.php | 141 +- lib/Model/BlockRelations.php | 116 +- lib/Model/BlockRelationsBroadcast.php | 121 +- lib/Model/BlockRelationsBroadcastParams.php | 106 +- lib/Model/BlockRelationsItems.php | 121 +- lib/Model/BlockRelationsItemsParams.php | 106 +- lib/Model/BlockRelationsProgram.php | 121 +- lib/Model/BlockResult.php | 156 +- lib/Model/BlockResults.php | 151 +- lib/Model/Broadcast.php | 250 +- lib/Model/BroadcastDataInput.php | 260 +- lib/Model/BroadcastEPGDay.php | 113 +- lib/Model/BroadcastEPGRelations.php | 131 +- lib/Model/BroadcastEPGResult.php | 313 +- lib/Model/BroadcastInputOnly.php | 111 +- lib/Model/BroadcastOutputOnly.php | 134 +- lib/Model/BroadcastRelations.php | 161 +- lib/Model/BroadcastRelationsBlocks.php | 121 +- lib/Model/BroadcastRelationsGenre.php | 121 +- lib/Model/BroadcastRelationsItems.php | 121 +- lib/Model/BroadcastRelationsItemsParams.php | 106 +- lib/Model/BroadcastRelationsModelType.php | 121 +- lib/Model/BroadcastRelationsPresenters.php | 121 +- lib/Model/BroadcastRelationsTags.php | 121 +- lib/Model/BroadcastResult.php | 341 +- lib/Model/BroadcastResults.php | 151 +- lib/Model/Campaign.php | 142 +- lib/Model/CampaignDataInput.php | 142 +- lib/Model/CampaignOutputOnly.php | 143 +- lib/Model/CampaignRelations.php | 111 +- lib/Model/CampaignRelationsItems.php | 121 +- lib/Model/CampaignRelationsItemsParams.php | 106 +- lib/Model/CampaignResult.php | 194 +- lib/Model/CampaignResults.php | 151 +- lib/Model/CampaignTemplateItem.php | 512 +++ lib/Model/Contact.php | 137 +- lib/Model/ContactDataInput.php | 137 +- lib/Model/ContactOutputOnly.php | 126 +- lib/Model/ContactRelations.php | 122 +- lib/Model/ContactRelationsItems.php | 121 +- lib/Model/ContactRelationsTags.php | 121 +- lib/Model/ContactRelationsTagsParams.php | 106 +- lib/Model/ContactResult.php | 183 +- lib/Model/ContactResults.php | 151 +- lib/Model/Data.php | 141 +- lib/Model/Data1.php | 141 +- lib/Model/Data2.php | 422 ++ lib/Model/Data3.php | 302 ++ lib/Model/EPGResults.php | 122 +- lib/Model/Forbidden.php | 111 +- lib/Model/Genre.php | 125 +- lib/Model/GenreOutputOnly.php | 106 +- lib/Model/GenreRelations.php | 111 +- lib/Model/GenreRelationsBroadcasts.php | 121 +- lib/Model/GenreRelationsBroadcastsParams.php | 106 +- lib/Model/GenreRelationsPrograms.php | 121 +- lib/Model/GenreResult.php | 140 +- lib/Model/GenreResults.php | 151 +- lib/Model/ImportItem.php | 160 +- lib/Model/InlineResponse202.php | 106 +- lib/Model/InternalServerError.php | 111 +- lib/Model/InviteUserData.php | 115 +- lib/Model/InviteUserSuccess.php | 106 +- lib/Model/Item.php | 202 +- lib/Model/ItemDataInput.php | 222 +- lib/Model/ItemInputOnly.php | 121 +- lib/Model/ItemOutputOnly.php | 146 +- lib/Model/ItemRelations.php | 136 +- lib/Model/ItemRelationsBlock.php | 121 +- lib/Model/ItemRelationsCampaign.php | 121 +- lib/Model/ItemRelationsContacts.php | 121 +- lib/Model/ItemRelationsContactsParams.php | 106 +- lib/Model/ItemRelationsProgram.php | 121 +- lib/Model/ItemRelationsTags.php | 121 +- lib/Model/ItemResult.php | 282 +- lib/Model/ItemResults.php | 146 +- lib/Model/ModelInterface.php | 96 + lib/Model/ModelType.php | 162 +- lib/Model/ModelTypeOptions.php | 111 +- lib/Model/ModelTypeOutputOnly.php | 106 +- lib/Model/ModelTypeRelations.php | 131 +- lib/Model/ModelTypeRelationsBroadcasts.php | 121 +- lib/Model/ModelTypeRelationsCampaigns.php | 121 +- .../ModelTypeRelationsCampaignsParams.php | 106 +- lib/Model/ModelTypeRelationsContacts.php | 121 +- lib/Model/ModelTypeRelationsItems.php | 121 +- lib/Model/ModelTypeRelationsPresenters.php | 121 +- lib/Model/ModelTypeRelationsPrograms.php | 121 +- lib/Model/ModelTypeResult.php | 197 +- lib/Model/ModelTypeResults.php | 151 +- lib/Model/NotFound.php | 111 +- lib/Model/PostSuccess.php | 109 +- lib/Model/Presenter.php | 133 +- lib/Model/PresenterDataInput.php | 133 +- lib/Model/PresenterEPGResult.php | 166 +- lib/Model/PresenterOutputOnly.php | 134 +- lib/Model/PresenterRelations.php | 116 +- lib/Model/PresenterRelationsBroadcasts.php | 121 +- lib/Model/PresenterRelationsPrograms.php | 121 +- .../PresenterRelationsProgramsParams.php | 106 +- lib/Model/PresenterResult.php | 181 +- lib/Model/PresenterResults.php | 151 +- lib/Model/Program.php | 170 +- lib/Model/ProgramDataInput.php | 180 +- lib/Model/ProgramInputOnly.php | 111 +- lib/Model/ProgramOutputOnly.php | 134 +- lib/Model/ProgramRelations.php | 161 +- lib/Model/ProgramRelationsBlocks.php | 121 +- lib/Model/ProgramRelationsBroadcasts.php | 121 +- lib/Model/ProgramRelationsItems.php | 121 +- lib/Model/ProgramRelationsItemsParams.php | 106 +- lib/Model/ProgramRelationsPresenters.php | 121 +- lib/Model/ProgramRelationsTags.php | 121 +- lib/Model/ProgramResult.php | 263 +- lib/Model/ProgramResults.php | 151 +- lib/Model/ReadOnly.php | 111 +- lib/Model/RelationsPlaceholder.php | 121 +- lib/Model/StationResult.php | 106 +- lib/Model/StationResultStation.php | 326 +- lib/Model/StationResultStationStartDays.php | 136 +- lib/Model/Story.php | 130 +- lib/Model/StoryDataInput.php | 135 +- lib/Model/StoryInputOnly.php | 106 +- lib/Model/StoryOutputOnly.php | 126 +- lib/Model/StoryRelations.php | 122 +- lib/Model/StoryRelationsItems.php | 121 +- lib/Model/StoryRelationsTags.php | 121 +- lib/Model/StoryRelationsTagsParams.php | 106 +- lib/Model/StoryResult.php | 176 +- lib/Model/StoryResults.php | 151 +- lib/Model/Success.php | 106 +- lib/Model/Tag.php | 108 +- lib/Model/TagDataInput.php | 108 +- lib/Model/TagOutputOnly.php | 128 +- lib/Model/TagRelations.php | 121 +- lib/Model/TagRelationsBroadcasts.php | 121 +- lib/Model/TagRelationsBroadcastsParams.php | 106 +- lib/Model/TagRelationsContacts.php | 121 +- lib/Model/TagRelationsItems.php | 121 +- lib/Model/TagRelationsPrograms.php | 121 +- lib/Model/TagResult.php | 155 +- lib/Model/TagResults.php | 146 +- lib/Model/TextString.php | 132 +- lib/Model/TooManyRequests.php | 108 +- lib/Model/UnprocessableEntity.php | 106 +- lib/Model/UserResult.php | 169 +- lib/Model/UserResultRoles.php | 121 +- lib/Model/UserResultSettings.php | 131 +- lib/Model/UserResults.php | 151 +- lib/Model/VisualResult.php | 106 +- lib/ObjectSerializer.php | 39 +- test/Api/BlockApiTest.php | 3 +- test/Api/BroadcastApiTest.php | 5 +- test/Api/CampaignApiTest.php | 3 +- test/Api/ContactApiTest.php | 3 +- test/Api/GenreApiTest.php | 3 +- test/Api/ItemApiTest.php | 33 +- test/Api/ModelTypeApiTest.php | 3 +- test/Api/PresenterApiTest.php | 3 +- test/Api/ProgramApiTest.php | 3 +- test/Api/StationApiTest.php | 3 +- test/Api/StoryApiTest.php | 3 +- test/Api/StringApiTest.php | 3 +- test/Api/TagApiTest.php | 3 +- test/Api/UserApiTest.php | 3 +- test/Api/VisualSlideApiTest.php | 3 +- .../BlockRelationsBroadcastParamsTest.php | 2 +- test/Model/BlockRelationsBroadcastTest.php | 2 +- test/Model/BlockRelationsItemsParamsTest.php | 2 +- test/Model/BlockRelationsItemsTest.php | 2 +- test/Model/BlockRelationsProgramTest.php | 2 +- test/Model/BlockRelationsTest.php | 2 +- test/Model/BlockResultTest.php | 2 +- test/Model/BlockResultsTest.php | 2 +- test/Model/BlockTest.php | 2 +- test/Model/BroadcastDataInputTest.php | 2 +- test/Model/BroadcastEPGDayTest.php | 2 +- test/Model/BroadcastEPGRelationsTest.php | 2 +- test/Model/BroadcastEPGResultTest.php | 2 +- test/Model/BroadcastInputOnlyTest.php | 2 +- test/Model/BroadcastOutputOnlyTest.php | 2 +- test/Model/BroadcastRelationsBlocksTest.php | 2 +- test/Model/BroadcastRelationsGenreTest.php | 2 +- .../BroadcastRelationsItemsParamsTest.php | 2 +- test/Model/BroadcastRelationsItemsTest.php | 2 +- .../Model/BroadcastRelationsModelTypeTest.php | 2 +- .../BroadcastRelationsPresentersTest.php | 2 +- test/Model/BroadcastRelationsTagsTest.php | 2 +- test/Model/BroadcastRelationsTest.php | 9 +- test/Model/BroadcastResultTest.php | 9 +- test/Model/BroadcastResultsTest.php | 2 +- test/Model/BroadcastTest.php | 2 +- test/Model/CampaignDataInputTest.php | 2 +- test/Model/CampaignOutputOnlyTest.php | 2 +- .../CampaignRelationsItemsParamsTest.php | 2 +- test/Model/CampaignRelationsItemsTest.php | 2 +- test/Model/CampaignRelationsTest.php | 2 +- test/Model/CampaignResultTest.php | 2 +- test/Model/CampaignResultsTest.php | 2 +- test/Model/CampaignTemplateItemTest.php | 135 + test/Model/CampaignTest.php | 2 +- test/Model/ContactDataInputTest.php | 2 +- test/Model/ContactOutputOnlyTest.php | 2 +- test/Model/ContactRelationsItemsTest.php | 2 +- test/Model/ContactRelationsTagsParamsTest.php | 2 +- test/Model/ContactRelationsTagsTest.php | 2 +- test/Model/ContactRelationsTest.php | 2 +- test/Model/ContactResultTest.php | 2 +- test/Model/ContactResultsTest.php | 2 +- test/Model/ContactTest.php | 2 +- test/Model/Data1Test.php | 9 +- test/Model/Data2Test.php | 114 + test/Model/Data3Test.php | 86 + test/Model/DataTest.php | 9 +- test/Model/EPGResultsTest.php | 2 +- test/Model/ForbiddenTest.php | 2 +- test/Model/GenreOutputOnlyTest.php | 2 +- .../GenreRelationsBroadcastsParamsTest.php | 2 +- test/Model/GenreRelationsBroadcastsTest.php | 2 +- test/Model/GenreRelationsProgramsTest.php | 2 +- test/Model/GenreRelationsTest.php | 2 +- test/Model/GenreResultTest.php | 2 +- test/Model/GenreResultsTest.php | 2 +- test/Model/GenreTest.php | 2 +- test/Model/ImportItemTest.php | 2 +- test/Model/InlineResponse202Test.php | 2 +- test/Model/InternalServerErrorTest.php | 2 +- test/Model/InviteUserDataTest.php | 2 +- test/Model/InviteUserSuccessTest.php | 2 +- test/Model/ItemDataInputTest.php | 2 +- test/Model/ItemInputOnlyTest.php | 2 +- test/Model/ItemOutputOnlyTest.php | 2 +- test/Model/ItemRelationsBlockTest.php | 2 +- test/Model/ItemRelationsCampaignTest.php | 2 +- .../Model/ItemRelationsContactsParamsTest.php | 2 +- test/Model/ItemRelationsContactsTest.php | 2 +- test/Model/ItemRelationsProgramTest.php | 2 +- test/Model/ItemRelationsTagsTest.php | 2 +- test/Model/ItemRelationsTest.php | 2 +- test/Model/ItemResultTest.php | 2 +- test/Model/ItemResultsTest.php | 2 +- test/Model/ItemTest.php | 2 +- test/Model/ModelTypeOptionsTest.php | 2 +- test/Model/ModelTypeOutputOnlyTest.php | 2 +- .../ModelTypeRelationsBroadcastsTest.php | 2 +- .../ModelTypeRelationsCampaignsParamsTest.php | 2 +- .../Model/ModelTypeRelationsCampaignsTest.php | 2 +- test/Model/ModelTypeRelationsContactsTest.php | 2 +- test/Model/ModelTypeRelationsItemsTest.php | 2 +- .../ModelTypeRelationsPresentersTest.php | 2 +- test/Model/ModelTypeRelationsProgramsTest.php | 2 +- test/Model/ModelTypeRelationsTest.php | 2 +- test/Model/ModelTypeResultTest.php | 2 +- test/Model/ModelTypeResultsTest.php | 2 +- test/Model/ModelTypeTest.php | 2 +- test/Model/NotFoundTest.php | 2 +- test/Model/PostSuccessTest.php | 2 +- test/Model/PresenterDataInputTest.php | 2 +- test/Model/PresenterEPGResultTest.php | 2 +- test/Model/PresenterOutputOnlyTest.php | 2 +- .../PresenterRelationsBroadcastsTest.php | 2 +- .../PresenterRelationsProgramsParamsTest.php | 2 +- test/Model/PresenterRelationsProgramsTest.php | 2 +- test/Model/PresenterRelationsTest.php | 2 +- test/Model/PresenterResultTest.php | 2 +- test/Model/PresenterResultsTest.php | 2 +- test/Model/PresenterTest.php | 2 +- test/Model/ProgramDataInputTest.php | 2 +- test/Model/ProgramInputOnlyTest.php | 2 +- test/Model/ProgramOutputOnlyTest.php | 2 +- test/Model/ProgramRelationsBlocksTest.php | 2 +- test/Model/ProgramRelationsBroadcastsTest.php | 2 +- .../Model/ProgramRelationsItemsParamsTest.php | 2 +- test/Model/ProgramRelationsItemsTest.php | 2 +- test/Model/ProgramRelationsPresentersTest.php | 2 +- test/Model/ProgramRelationsTagsTest.php | 2 +- test/Model/ProgramRelationsTest.php | 9 +- test/Model/ProgramResultTest.php | 9 +- test/Model/ProgramResultsTest.php | 2 +- test/Model/ProgramTest.php | 2 +- test/Model/ReadOnlyTest.php | 2 +- test/Model/RelationsPlaceholderTest.php | 2 +- .../StationResultStationStartDaysTest.php | 2 +- test/Model/StationResultStationTest.php | 23 +- test/Model/StationResultTest.php | 2 +- test/Model/StoryDataInputTest.php | 2 +- test/Model/StoryInputOnlyTest.php | 2 +- test/Model/StoryOutputOnlyTest.php | 2 +- test/Model/StoryRelationsItemsTest.php | 2 +- test/Model/StoryRelationsTagsParamsTest.php | 2 +- test/Model/StoryRelationsTagsTest.php | 2 +- test/Model/StoryRelationsTest.php | 2 +- test/Model/StoryResultTest.php | 2 +- test/Model/StoryResultsTest.php | 2 +- test/Model/StoryTest.php | 2 +- test/Model/SuccessTest.php | 2 +- test/Model/TagDataInputTest.php | 2 +- test/Model/TagOutputOnlyTest.php | 2 +- .../TagRelationsBroadcastsParamsTest.php | 2 +- test/Model/TagRelationsBroadcastsTest.php | 2 +- test/Model/TagRelationsContactsTest.php | 2 +- test/Model/TagRelationsItemsTest.php | 2 +- test/Model/TagRelationsProgramsTest.php | 2 +- test/Model/TagRelationsTest.php | 2 +- test/Model/TagResultTest.php | 2 +- test/Model/TagResultsTest.php | 2 +- test/Model/TagTest.php | 2 +- test/Model/TextStringTest.php | 2 +- test/Model/TooManyRequestsTest.php | 2 +- test/Model/UnprocessableEntityTest.php | 2 +- test/Model/UserResultRolesTest.php | 2 +- test/Model/UserResultSettingsTest.php | 2 +- test/Model/UserResultTest.php | 2 +- test/Model/UserResultsTest.php | 2 +- test/Model/VisualResultTest.php | 2 +- 368 files changed, 36555 insertions(+), 9849 deletions(-) delete mode 100644 autoload.php create mode 100644 docs/Model/CampaignTemplateItem.md create mode 100644 docs/Model/Data2.md create mode 100644 docs/Model/Data3.md delete mode 100644 lib/ApiClient.php create mode 100644 lib/HeaderSelector.php create mode 100644 lib/Model/CampaignTemplateItem.php create mode 100644 lib/Model/Data2.php create mode 100644 lib/Model/Data3.php create mode 100644 lib/Model/ModelInterface.php create mode 100644 test/Model/CampaignTemplateItemTest.php create mode 100644 test/Model/Data2Test.php create mode 100644 test/Model/Data3Test.php diff --git a/README.md b/README.md index 047dc5b..fc50a4e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ For more information, please visit [https://pluxbox.com](https://pluxbox.com) ## Requirements -PHP 5.4.0 and later +PHP 5.5 and later ## Installation & Usage ### Composer @@ -35,7 +35,7 @@ Then run `composer install` Download the files and include `autoload.php`: ```php - require_once('/path/to/RadioManager/autoload.php'); + require_once('/path/to/RadioManager/vendor/autoload.php'); ``` ## Tests @@ -56,16 +56,21 @@ Please follow the [installation procedure](#installation--usage) and then run th require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BlockApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BlockApi( + // 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 = 789; // int | ID of Block **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getBlockById($id, $_external_station_id); + $result = $apiInstance->getBlockById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BlockApi->getBlockById: ', $e->getMessage(), PHP_EOL; @@ -93,7 +98,7 @@ Class | Method | HTTP request | Description *BroadcastApi* | [**getNextBroadcast**](docs/Api/BroadcastApi.md#getnextbroadcast) | **GET** /broadcasts/next | Get next Broadcast *BroadcastApi* | [**getWeeklyEPG**](docs/Api/BroadcastApi.md#getweeklyepg) | **GET** /broadcasts/epg/weekly | Get weekly EPG *BroadcastApi* | [**listBroadcasts**](docs/Api/BroadcastApi.md#listbroadcasts) | **GET** /broadcasts | Get all broadcasts. -*BroadcastApi* | [**printBroadcastById**](docs/Api/BroadcastApi.md#printbroadcastbyid) | **GET** /broadcasts/print/{id} | Print Broadcast by id +*BroadcastApi* | [**printBroadcastById**](docs/Api/BroadcastApi.md#printbroadcastbyid) | **GET** /broadcasts/print/{id} | Print broadcast by id with template *BroadcastApi* | [**updateBroadcastByID**](docs/Api/BroadcastApi.md#updatebroadcastbyid) | **PATCH** /broadcasts/{id} | Update broadcast by id *CampaignApi* | [**createCampaign**](docs/Api/CampaignApi.md#createcampaign) | **POST** /campaigns | Create campaign. *CampaignApi* | [**deleteCampaignById**](docs/Api/CampaignApi.md#deletecampaignbyid) | **DELETE** /campaigns/{id} | Delete campaign by id @@ -114,8 +119,10 @@ Class | Method | HTTP request | Description *ItemApi* | [**getCurrentItem**](docs/Api/ItemApi.md#getcurrentitem) | **GET** /items/current | Get current Item *ItemApi* | [**getItemById**](docs/Api/ItemApi.md#getitembyid) | **GET** /items/{id} | Get extended item details by ID. *ItemApi* | [**listItems**](docs/Api/ItemApi.md#listitems) | **GET** /items | Get a list of all the items currently in your station. +*ItemApi* | [**playlistPostMerge**](docs/Api/ItemApi.md#playlistpostmerge) | **POST** /items/playlist/merge | Post a playlist, do not remove previously imported items *ItemApi* | [**playlistPostStructure**](docs/Api/ItemApi.md#playlistpoststructure) | **POST** /items/playlist/structure | Post a playlist, keep current structure *ItemApi* | [**playlistPostTiming**](docs/Api/ItemApi.md#playlistposttiming) | **POST** /items/playlist/timing | Post a playlist +*ItemApi* | [**stopCurrentItem**](docs/Api/ItemApi.md#stopcurrentitem) | **POST** /items/stopcurrent | Stop an Item *ItemApi* | [**updateItemById**](docs/Api/ItemApi.md#updateitembyid) | **PATCH** /items/{id} | Update extended item details by ID. *ModelTypeApi* | [**getModelTypeById**](docs/Api/ModelTypeApi.md#getmodeltypebyid) | **GET** /model_types/{id} | Get modelType by id *ModelTypeApi* | [**listModelTypes**](docs/Api/ModelTypeApi.md#listmodeltypes) | **GET** /model_types | Get all modelTypes. @@ -165,6 +172,7 @@ Class | Method | HTTP request | Description - [BroadcastOutputOnly](docs/Model/BroadcastOutputOnly.md) - [BroadcastRelations](docs/Model/BroadcastRelations.md) - [BroadcastRelationsBlocks](docs/Model/BroadcastRelationsBlocks.md) + - [BroadcastRelationsGenre](docs/Model/BroadcastRelationsGenre.md) - [BroadcastRelationsItems](docs/Model/BroadcastRelationsItems.md) - [BroadcastRelationsItemsParams](docs/Model/BroadcastRelationsItemsParams.md) - [BroadcastRelationsModelType](docs/Model/BroadcastRelationsModelType.md) @@ -177,6 +185,7 @@ Class | Method | HTTP request | Description - [CampaignRelationsItems](docs/Model/CampaignRelationsItems.md) - [CampaignRelationsItemsParams](docs/Model/CampaignRelationsItemsParams.md) - [CampaignResults](docs/Model/CampaignResults.md) + - [CampaignTemplateItem](docs/Model/CampaignTemplateItem.md) - [Contact](docs/Model/Contact.md) - [ContactOutputOnly](docs/Model/ContactOutputOnly.md) - [ContactRelations](docs/Model/ContactRelations.md) @@ -186,6 +195,8 @@ Class | Method | HTTP request | Description - [ContactResults](docs/Model/ContactResults.md) - [Data](docs/Model/Data.md) - [Data1](docs/Model/Data1.md) + - [Data2](docs/Model/Data2.md) + - [Data3](docs/Model/Data3.md) - [EPGResults](docs/Model/EPGResults.md) - [Forbidden](docs/Model/Forbidden.md) - [Genre](docs/Model/Genre.md) @@ -247,6 +258,7 @@ Class | Method | HTTP request | Description - [RelationsPlaceholder](docs/Model/RelationsPlaceholder.md) - [StationResult](docs/Model/StationResult.md) - [StationResultStation](docs/Model/StationResultStation.md) + - [StationResultStationStartDays](docs/Model/StationResultStationStartDays.md) - [Story](docs/Model/Story.md) - [StoryInputOnly](docs/Model/StoryInputOnly.md) - [StoryOutputOnly](docs/Model/StoryOutputOnly.md) diff --git a/autoload.php b/autoload.php deleted file mode 100644 index b10ef87..0000000 --- a/autoload.php +++ /dev/null @@ -1,54 +0,0 @@ -setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BlockApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BlockApi( + // 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 = 789; // int | ID of Block **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getBlockById($id, $_external_station_id); + $result = $apiInstance->getBlockById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BlockApi->getBlockById: ', $e->getMessage(), PHP_EOL; @@ -75,14 +80,19 @@ Get current Block require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); -$api_instance = new RadioManager\Api\BlockApi(); +$apiInstance = new RadioManager\Api\BlockApi( + // 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 +); try { - $result = $api_instance->getCurrentBlock(); + $result = $apiInstance->getCurrentBlock(); print_r($result); } catch (Exception $e) { echo 'Exception when calling BlockApi->getCurrentBlock: ', $e->getMessage(), PHP_EOL; @@ -121,14 +131,19 @@ Get upcoming Block require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); -$api_instance = new RadioManager\Api\BlockApi(); +$apiInstance = new RadioManager\Api\BlockApi( + // 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 +); try { - $result = $api_instance->getNextBlock(); + $result = $apiInstance->getNextBlock(); print_r($result); } catch (Exception $e) { echo 'Exception when calling BlockApi->getNextBlock: ', $e->getMessage(), PHP_EOL; @@ -167,11 +182,16 @@ Get a list of all blocks currently in your station. This feature supports pagina require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BlockApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BlockApi( + // 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 +); $page = 1; // int | Current page *(Optional)* $broadcast_id = 789; // int | Search on Broadcast ID *(Optional)* `(Relation)` $item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)` @@ -184,7 +204,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listBlocks($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listBlocks($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BlockApi->listBlocks: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/BroadcastApi.md b/docs/Api/BroadcastApi.md index 8d8bd45..05c2df1 100644 --- a/docs/Api/BroadcastApi.md +++ b/docs/Api/BroadcastApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description [**getNextBroadcast**](BroadcastApi.md#getNextBroadcast) | **GET** /broadcasts/next | Get next Broadcast [**getWeeklyEPG**](BroadcastApi.md#getWeeklyEPG) | **GET** /broadcasts/epg/weekly | Get weekly EPG [**listBroadcasts**](BroadcastApi.md#listBroadcasts) | **GET** /broadcasts | Get all broadcasts. -[**printBroadcastById**](BroadcastApi.md#printBroadcastById) | **GET** /broadcasts/print/{id} | Print Broadcast by id +[**printBroadcastById**](BroadcastApi.md#printBroadcastById) | **GET** /broadcasts/print/{id} | Print broadcast by id with template [**updateBroadcastByID**](BroadcastApi.md#updateBroadcastByID) | **PATCH** /broadcasts/{id} | Update broadcast by id @@ -30,15 +30,20 @@ Create broadcast. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $data = new \RadioManager\Model\BroadcastDataInput(); // \RadioManager\Model\BroadcastDataInput | Data **(Required)** try { - $result = $api_instance->createBroadcast($data); + $result = $apiInstance->createBroadcast($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->createBroadcast: ', $e->getMessage(), PHP_EOL; @@ -80,15 +85,20 @@ Delete broadcast by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 = 789; // int | ID of Broadcast **(Required)** try { - $result = $api_instance->deleteBroadcastById($id); + $result = $apiInstance->deleteBroadcastById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->deleteBroadcastById: ', $e->getMessage(), PHP_EOL; @@ -130,16 +140,21 @@ Get broadcast by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 = 789; // int | ID of Broadcast **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getBroadcastById($id, $_external_station_id); + $result = $apiInstance->getBroadcastById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->getBroadcastById: ', $e->getMessage(), PHP_EOL; @@ -182,15 +197,20 @@ Get current Broadcast require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $withunpublished = true; // bool | Show Unpublished *(Optional)* try { - $result = $api_instance->getCurrentBroadcast($withunpublished); + $result = $apiInstance->getCurrentBroadcast($withunpublished); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->getCurrentBroadcast: ', $e->getMessage(), PHP_EOL; @@ -232,16 +252,21 @@ Get current Broadcast require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date *(Optional)* $withunpublished = true; // bool | Show Unpublished *(Optional)* try { - $result = $api_instance->getDailyEPG($date, $withunpublished); + $result = $apiInstance->getDailyEPG($date, $withunpublished); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->getDailyEPG: ', $e->getMessage(), PHP_EOL; @@ -284,16 +309,21 @@ Get EPG by date require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date *(Optional)* $withunpublished = true; // bool | Show Unpublished *(Optional)* try { - $result = $api_instance->getEPGByDate($date, $withunpublished); + $result = $apiInstance->getEPGByDate($date, $withunpublished); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->getEPGByDate: ', $e->getMessage(), PHP_EOL; @@ -336,15 +366,20 @@ Get next Broadcast require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $withunpublished = true; // bool | Show Unpublished *(Optional)* try { - $result = $api_instance->getNextBroadcast($withunpublished); + $result = $apiInstance->getNextBroadcast($withunpublished); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->getNextBroadcast: ', $e->getMessage(), PHP_EOL; @@ -386,16 +421,21 @@ Get weekly EPG require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $date = "date_example"; // string | Date *(Optional)* $withunpublished = true; // bool | Show Unpublished *(Optional)* try { - $result = $api_instance->getWeeklyEPG($date, $withunpublished); + $result = $apiInstance->getWeeklyEPG($date, $withunpublished); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->getWeeklyEPG: ', $e->getMessage(), PHP_EOL; @@ -438,11 +478,16 @@ List all broadcasts. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 +); $page = 1; // int | Current page *(Optional)* $program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)` $block_id = 789; // int | Search on Block ID *(Optional)* `(Relation)` @@ -459,7 +504,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listBroadcasts($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listBroadcasts($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->listBroadcasts: ', $e->getMessage(), PHP_EOL; @@ -502,11 +547,11 @@ 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) # **printBroadcastById** -> \RadioManager\Model\EPGResults printBroadcastById($id, $program_id, $presenter_id, $tag_id) +> string printBroadcastById($id, $template_id) -Print Broadcast by id +Print broadcast by id with template -Print Broadcast by id +Print broadcast by id with template ### Example ```php @@ -514,18 +559,21 @@ Print Broadcast by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 = 789; // int | ID of Broadcast **(Required)** -$program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)` -$presenter_id = 789; // int | Search on Presenter ID *(Optional)* `(Relation)` -$tag_id = 789; // int | Search on Tag ID *(Optional)* `(Relation)` +$template_id = 789; // int | Search on template ID *(Optional)* try { - $result = $api_instance->printBroadcastById($id, $program_id, $presenter_id, $tag_id); + $result = $apiInstance->printBroadcastById($id, $template_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->printBroadcastById: ', $e->getMessage(), PHP_EOL; @@ -538,13 +586,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| ID of Broadcast **(Required)** | - **program_id** | **int**| Search on Program ID *(Optional)* `(Relation)` | [optional] - **presenter_id** | **int**| Search on Presenter ID *(Optional)* `(Relation)` | [optional] - **tag_id** | **int**| Search on Tag ID *(Optional)* `(Relation)` | [optional] + **template_id** | **int**| Search on template ID *(Optional)* | [optional] ### Return type -[**\RadioManager\Model\EPGResults**](../Model/EPGResults.md) +**string** ### Authorization @@ -570,16 +616,21 @@ Update broadcast by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\BroadcastApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\BroadcastApi( + // 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 = 789; // int | ID of Broadcast **(Required)** $data = new \RadioManager\Model\BroadcastDataInput(); // \RadioManager\Model\BroadcastDataInput | Data *(Optional)* try { - $result = $api_instance->updateBroadcastByID($id, $data); + $result = $apiInstance->updateBroadcastByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling BroadcastApi->updateBroadcastByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/CampaignApi.md b/docs/Api/CampaignApi.md index db235fb..a5ff509 100644 --- a/docs/Api/CampaignApi.md +++ b/docs/Api/CampaignApi.md @@ -24,15 +24,20 @@ Create campaign. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\CampaignApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\CampaignApi( + // 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 +); $data = new \RadioManager\Model\CampaignDataInput(); // \RadioManager\Model\CampaignDataInput | Data **(Required)** try { - $result = $api_instance->createCampaign($data); + $result = $apiInstance->createCampaign($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->createCampaign: ', $e->getMessage(), PHP_EOL; @@ -74,15 +79,20 @@ Delete campaign by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\CampaignApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\CampaignApi( + // 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 = 789; // int | ID of Campaign **(Required)** try { - $result = $api_instance->deleteCampaignById($id); + $result = $apiInstance->deleteCampaignById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->deleteCampaignById: ', $e->getMessage(), PHP_EOL; @@ -124,16 +134,21 @@ Get campaign by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\CampaignApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\CampaignApi( + // 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 = 789; // int | ID of Campaign **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getCampaignById($id, $_external_station_id); + $result = $apiInstance->getCampaignById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->getCampaignById: ', $e->getMessage(), PHP_EOL; @@ -176,11 +191,16 @@ List all campaigns. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\CampaignApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\CampaignApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)` $model_type_id = 789; // int | Search on ModelType ID *(Optional)* `(Relation)` @@ -192,7 +212,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listCampaigns($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listCampaigns($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->listCampaigns: ', $e->getMessage(), PHP_EOL; @@ -242,16 +262,21 @@ Update campaign by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\CampaignApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\CampaignApi( + // 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 = 789; // int | ID of Campaign **(Required)** $data = new \RadioManager\Model\CampaignDataInput(); // \RadioManager\Model\CampaignDataInput | Data *(Optional)* try { - $result = $api_instance->updateCampaignByID($id, $data); + $result = $apiInstance->updateCampaignByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->updateCampaignByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/ContactApi.md b/docs/Api/ContactApi.md index 8597aa6..c905233 100644 --- a/docs/Api/ContactApi.md +++ b/docs/Api/ContactApi.md @@ -24,15 +24,20 @@ Create contact. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ContactApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ContactApi( + // 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 +); $data = new \RadioManager\Model\ContactDataInput(); // \RadioManager\Model\ContactDataInput | Data **(Required)** try { - $result = $api_instance->createContact($data); + $result = $apiInstance->createContact($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactApi->createContact: ', $e->getMessage(), PHP_EOL; @@ -74,15 +79,20 @@ Delete contact by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ContactApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ContactApi( + // 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 = 789; // int | ID of Contact **(Required)** try { - $result = $api_instance->deleteContactById($id); + $result = $apiInstance->deleteContactById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactApi->deleteContactById: ', $e->getMessage(), PHP_EOL; @@ -124,16 +134,21 @@ Get contact by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ContactApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ContactApi( + // 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 = 789; // int | ID of Contact **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getContactById($id, $_external_station_id); + $result = $apiInstance->getContactById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactApi->getContactById: ', $e->getMessage(), PHP_EOL; @@ -176,11 +191,16 @@ List all contacts. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ContactApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ContactApi( + // 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 +); $page = 1; // int | Current page *(Optional)* $item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)` $model_type_id = 789; // int | Search on ModelType ID *(Optional)* `(Relation)` @@ -191,7 +211,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listContacts($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listContacts($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactApi->listContacts: ', $e->getMessage(), PHP_EOL; @@ -240,16 +260,21 @@ Update contact by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ContactApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ContactApi( + // 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 = 789; // int | ID of Contact **(Required)** $data = new \RadioManager\Model\ContactDataInput(); // \RadioManager\Model\ContactDataInput | Data *(Optional)* try { - $result = $api_instance->updateContactByID($id, $data); + $result = $apiInstance->updateContactByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactApi->updateContactByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/GenreApi.md b/docs/Api/GenreApi.md index ba14ebb..38a2f6c 100644 --- a/docs/Api/GenreApi.md +++ b/docs/Api/GenreApi.md @@ -21,16 +21,21 @@ Get genre by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\GenreApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\GenreApi( + // 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 = 789; // int | ID of Genre **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getGenreById($id, $_external_station_id); + $result = $apiInstance->getGenreById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling GenreApi->getGenreById: ', $e->getMessage(), PHP_EOL; @@ -73,11 +78,16 @@ List all genres. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\GenreApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\GenreApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $parent_id = 789; // int | Search on Parent ID of Genre *(Optional)* $program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)` @@ -88,7 +98,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listGenres($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listGenres($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling GenreApi->listGenres: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/ItemApi.md b/docs/Api/ItemApi.md index db288c9..b5b40f5 100644 --- a/docs/Api/ItemApi.md +++ b/docs/Api/ItemApi.md @@ -11,8 +11,10 @@ Method | HTTP request | Description [**getCurrentItem**](ItemApi.md#getCurrentItem) | **GET** /items/current | Get current Item [**getItemById**](ItemApi.md#getItemById) | **GET** /items/{id} | Get extended item details by ID. [**listItems**](ItemApi.md#listItems) | **GET** /items | Get a list of all the items currently in your station. +[**playlistPostMerge**](ItemApi.md#playlistPostMerge) | **POST** /items/playlist/merge | Post a playlist, do not remove previously imported items [**playlistPostStructure**](ItemApi.md#playlistPostStructure) | **POST** /items/playlist/structure | Post a playlist, keep current structure [**playlistPostTiming**](ItemApi.md#playlistPostTiming) | **POST** /items/playlist/timing | Post a playlist +[**stopCurrentItem**](ItemApi.md#stopCurrentItem) | **POST** /items/stopcurrent | Stop an Item [**updateItemById**](ItemApi.md#updateItemById) | **PATCH** /items/{id} | Update extended item details by ID. @@ -29,15 +31,20 @@ Create item. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $data = new \RadioManager\Model\ItemDataInput(); // \RadioManager\Model\ItemDataInput | Data *(Optional)* try { - $result = $api_instance->createItem($data); + $result = $apiInstance->createItem($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->createItem: ', $e->getMessage(), PHP_EOL; @@ -79,15 +86,20 @@ Post a current playing item, keep structure require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $data = new \RadioManager\Model\ImportItem(); // \RadioManager\Model\ImportItem | Data *(Optional)* try { - $result = $api_instance->currentItemPostStructure($data); + $result = $apiInstance->currentItemPostStructure($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->currentItemPostStructure: ', $e->getMessage(), PHP_EOL; @@ -129,15 +141,20 @@ Post a current playing item require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $data = new \RadioManager\Model\ImportItem(); // \RadioManager\Model\ImportItem | Data *(Optional)* try { - $result = $api_instance->currentItemPostTiming($data); + $result = $apiInstance->currentItemPostTiming($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->currentItemPostTiming: ', $e->getMessage(), PHP_EOL; @@ -179,15 +196,20 @@ Delete item by id. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 = 789; // int | ID of Item **(Required)** try { - $result = $api_instance->deleteItemById($id); + $result = $apiInstance->deleteItemById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->deleteItemById: ', $e->getMessage(), PHP_EOL; @@ -229,15 +251,20 @@ Get current Item require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $lastplayed = true; // bool | Show last played item if there is no current item*(Optional)* try { - $result = $api_instance->getCurrentItem($lastplayed); + $result = $apiInstance->getCurrentItem($lastplayed); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->getCurrentItem: ', $e->getMessage(), PHP_EOL; @@ -279,16 +306,21 @@ Read item by id. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 = 789; // int | ID of Item **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getItemById($id, $_external_station_id); + $result = $apiInstance->getItemById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->getItemById: ', $e->getMessage(), PHP_EOL; @@ -331,11 +363,16 @@ Get a list of all the items currently in your station. This feature supports pag require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $block_id = 789; // int | Search on Block ID *(Optional)* `(Relation)` $broadcast_id = 789; // int | Search on Broadcast ID *(Optional)* `(Relation)` @@ -359,7 +396,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listItems($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listItems($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->listItems: ', $e->getMessage(), PHP_EOL; @@ -408,6 +445,61 @@ 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) +# **playlistPostMerge** +> \RadioManager\Model\InlineResponse202 playlistPostMerge($data) + +Post a playlist, do not remove previously imported items + +Post a playlist, do not remove previously imported items + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); +$data = new \RadioManager\Model\Data2(); // \RadioManager\Model\Data2 | Data *(Optional)* + +try { + $result = $apiInstance->playlistPostMerge($data); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ItemApi->playlistPostMerge: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **data** | [**\RadioManager\Model\Data2**](../Model/Data2.md)| Data *(Optional)* | [optional] + +### Return type + +[**\RadioManager\Model\InlineResponse202**](../Model/InlineResponse202.md) + +### Authorization + +[API Key](../../README.md#API Key) + +### 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) + # **playlistPostStructure** > \RadioManager\Model\InlineResponse202 playlistPostStructure($data) @@ -421,15 +513,20 @@ Post a playlist, keep current structure require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $data = new \RadioManager\Model\Data1(); // \RadioManager\Model\Data1 | Data *(Optional)* try { - $result = $api_instance->playlistPostStructure($data); + $result = $apiInstance->playlistPostStructure($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->playlistPostStructure: ', $e->getMessage(), PHP_EOL; @@ -471,15 +568,20 @@ Post a playlist require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); $data = new \RadioManager\Model\Data(); // \RadioManager\Model\Data | Data *(Optional)* try { - $result = $api_instance->playlistPostTiming($data); + $result = $apiInstance->playlistPostTiming($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->playlistPostTiming: ', $e->getMessage(), PHP_EOL; @@ -508,6 +610,61 @@ 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) +# **stopCurrentItem** +> \RadioManager\Model\Success stopCurrentItem($data) + +Stop an Item + +Set a current playing or specific item on played + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 +); +$data = new \RadioManager\Model\Data3(); // \RadioManager\Model\Data3 | Data *(Optional)* + +try { + $result = $apiInstance->stopCurrentItem($data); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ItemApi->stopCurrentItem: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **data** | [**\RadioManager\Model\Data3**](../Model/Data3.md)| Data *(Optional)* | [optional] + +### Return type + +[**\RadioManager\Model\Success**](../Model/Success.md) + +### Authorization + +[API Key](../../README.md#API Key) + +### 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) + # **updateItemById** > \RadioManager\Model\Success updateItemById($id, $data) @@ -521,16 +678,21 @@ Update item by id. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ItemApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ItemApi( + // 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 = 789; // int | ID of Item **(Required)** $data = new \RadioManager\Model\ItemDataInput(); // \RadioManager\Model\ItemDataInput | Data *(Optional)* try { - $result = $api_instance->updateItemById($id, $data); + $result = $apiInstance->updateItemById($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->updateItemById: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/ModelTypeApi.md b/docs/Api/ModelTypeApi.md index 4fe329e..1eda261 100644 --- a/docs/Api/ModelTypeApi.md +++ b/docs/Api/ModelTypeApi.md @@ -21,16 +21,21 @@ Get modelType by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ModelTypeApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ModelTypeApi( + // 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 = 789; // int | ID of ModelType **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getModelTypeById($id, $_external_station_id); + $result = $apiInstance->getModelTypeById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ModelTypeApi->getModelTypeById: ', $e->getMessage(), PHP_EOL; @@ -73,11 +78,16 @@ List all modelTypes. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ModelTypeApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ModelTypeApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $program_id = 789; // int | Search on Program ID *(Optional)* $broadcast_id = 789; // int | Search on Broadcast ID *(Optional)* @@ -92,7 +102,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listModelTypes($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listModelTypes($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ModelTypeApi->listModelTypes: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/PresenterApi.md b/docs/Api/PresenterApi.md index b9ba3b5..3f7acad 100644 --- a/docs/Api/PresenterApi.md +++ b/docs/Api/PresenterApi.md @@ -24,15 +24,20 @@ Create presenter. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\PresenterApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\PresenterApi( + // 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 +); $data = new \RadioManager\Model\PresenterDataInput(); // \RadioManager\Model\PresenterDataInput | Data **(Required)** try { - $result = $api_instance->createPresenter($data); + $result = $apiInstance->createPresenter($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PresenterApi->createPresenter: ', $e->getMessage(), PHP_EOL; @@ -74,15 +79,20 @@ Delete presenter by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\PresenterApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\PresenterApi( + // 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 = 789; // int | id of presenter try { - $result = $api_instance->deletePresenterById($id); + $result = $apiInstance->deletePresenterById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling PresenterApi->deletePresenterById: ', $e->getMessage(), PHP_EOL; @@ -124,16 +134,21 @@ Get presenter by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\PresenterApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\PresenterApi( + // 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 = 789; // int | id of Presenter $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getPresenterById($id, $_external_station_id); + $result = $apiInstance->getPresenterById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling PresenterApi->getPresenterById: ', $e->getMessage(), PHP_EOL; @@ -176,11 +191,16 @@ List all presenters. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\PresenterApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\PresenterApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)` $broadcast_id = 789; // int | Search on Broadcast ID *(Optional)* `(Relation)` @@ -191,7 +211,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listPresenters($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listPresenters($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling PresenterApi->listPresenters: ', $e->getMessage(), PHP_EOL; @@ -240,16 +260,21 @@ Update presenter by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\PresenterApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\PresenterApi( + // 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 = 789; // int | id of Presenter $data = new \RadioManager\Model\PresenterDataInput(); // \RadioManager\Model\PresenterDataInput | Data *(Optional)* try { - $result = $api_instance->updatePresenterByID($id, $data); + $result = $apiInstance->updatePresenterByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PresenterApi->updatePresenterByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/ProgramApi.md b/docs/Api/ProgramApi.md index 768d20a..c2d2269 100644 --- a/docs/Api/ProgramApi.md +++ b/docs/Api/ProgramApi.md @@ -24,15 +24,20 @@ Create program. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ProgramApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ProgramApi( + // 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 +); $data = new \RadioManager\Model\ProgramDataInput(); // \RadioManager\Model\ProgramDataInput | Data **(Required)** try { - $result = $api_instance->createProgram($data); + $result = $apiInstance->createProgram($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProgramApi->createProgram: ', $e->getMessage(), PHP_EOL; @@ -74,15 +79,20 @@ Delete program by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ProgramApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ProgramApi( + // 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 = 789; // int | ID of program **(Required)** try { - $result = $api_instance->deleteProgramById($id); + $result = $apiInstance->deleteProgramById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProgramApi->deleteProgramById: ', $e->getMessage(), PHP_EOL; @@ -124,16 +134,21 @@ Get program by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ProgramApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ProgramApi( + // 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 = 789; // int | ID of Program **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getProgramById($id, $_external_station_id); + $result = $apiInstance->getProgramById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProgramApi->getProgramById: ', $e->getMessage(), PHP_EOL; @@ -164,7 +179,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) # **listPrograms** -> \RadioManager\Model\ProgramResults listPrograms($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $limit, $order_by, $order_direction, $_external_station_id) +> \RadioManager\Model\ProgramResults listPrograms($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $disabled, $limit, $order_by, $order_direction, $_external_station_id) Get all programs. @@ -176,11 +191,16 @@ List all programs. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ProgramApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ProgramApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $broadcast_id = 789; // int | Search on Broadcast ID *(Optional)* `(Relation)` $model_type_id = 789; // int | Search on ModelType ID *(Optional)* `(Relation)` @@ -189,13 +209,14 @@ $presenter_id = 789; // int | Search on Presenter ID *(Optional)* `(Relation)` $genre_id = 789; // int | Search on Genre ID *(Optional)* $block_id = 789; // int | Search on Block ID *(Optional)* `(Relation)` $item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)` +$disabled = 56; // int | Search on Disabled status *(Optional)* $limit = 789; // int | Results per page *(Optional)* $order_by = "order_by_example"; // string | Field to order the results *(Optional)* $order_direction = "order_direction_example"; // string | Direction of ordering *(Optional)* $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listPrograms($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listPrograms($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $disabled, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProgramApi->listPrograms: ', $e->getMessage(), PHP_EOL; @@ -215,6 +236,7 @@ Name | Type | Description | Notes **genre_id** | **int**| Search on Genre ID *(Optional)* | [optional] **block_id** | **int**| Search on Block ID *(Optional)* `(Relation)` | [optional] **item_id** | **int**| Search on Item ID *(Optional)* `(Relation)` | [optional] + **disabled** | **int**| Search on Disabled status *(Optional)* | [optional] **limit** | **int**| Results per page *(Optional)* | [optional] **order_by** | **string**| Field to order the results *(Optional)* | [optional] **order_direction** | **string**| Direction of ordering *(Optional)* | [optional] @@ -248,16 +270,21 @@ Update program by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\ProgramApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\ProgramApi( + // 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 = 789; // int | ID of Program **(Required)** $data = new \RadioManager\Model\ProgramDataInput(); // \RadioManager\Model\ProgramDataInput | Data *(Optional)* try { - $result = $api_instance->updateProgramByID($id, $data); + $result = $apiInstance->updateProgramByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProgramApi->updateProgramByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/StationApi.md b/docs/Api/StationApi.md index e4eaea1..a55742e 100644 --- a/docs/Api/StationApi.md +++ b/docs/Api/StationApi.md @@ -20,14 +20,19 @@ Get own station only require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); -$api_instance = new RadioManager\Api\StationApi(); +$apiInstance = new RadioManager\Api\StationApi( + // 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 +); try { - $result = $api_instance->getStation(); + $result = $apiInstance->getStation(); print_r($result); } catch (Exception $e) { echo 'Exception when calling StationApi->getStation: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/StoryApi.md b/docs/Api/StoryApi.md index d28b45c..9c327a3 100644 --- a/docs/Api/StoryApi.md +++ b/docs/Api/StoryApi.md @@ -24,15 +24,20 @@ Create story. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\StoryApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\StoryApi( + // 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 +); $data = new \RadioManager\Model\StoryDataInput(); // \RadioManager\Model\StoryDataInput | Data **(Required)** try { - $result = $api_instance->createStory($data); + $result = $apiInstance->createStory($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoryApi->createStory: ', $e->getMessage(), PHP_EOL; @@ -74,15 +79,20 @@ Delete story by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\StoryApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\StoryApi( + // 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 = 789; // int | ID of Story **(Required)** try { - $result = $api_instance->deleteStoryById($id); + $result = $apiInstance->deleteStoryById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoryApi->deleteStoryById: ', $e->getMessage(), PHP_EOL; @@ -124,16 +134,21 @@ Get story by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\StoryApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\StoryApi( + // 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 = 789; // int | ID of Story **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getStoryById($id, $_external_station_id); + $result = $apiInstance->getStoryById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoryApi->getStoryById: ', $e->getMessage(), PHP_EOL; @@ -176,11 +191,16 @@ List all stories. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\StoryApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\StoryApi( + // 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 +); $page = 1; // int | Current page *(Optional)* $item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)` $model_type_id = 789; // int | Search on ModelType ID *(Optional)* `(Relation)` @@ -191,7 +211,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listStories($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listStories($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoryApi->listStories: ', $e->getMessage(), PHP_EOL; @@ -240,16 +260,21 @@ Update story by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\StoryApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\StoryApi( + // 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 = 789; // int | ID of Story **(Required)** $data = new \RadioManager\Model\StoryDataInput(); // \RadioManager\Model\StoryDataInput | Data *(Optional)* try { - $result = $api_instance->updateStoryByID($id, $data); + $result = $apiInstance->updateStoryByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoryApi->updateStoryByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/StringApi.md b/docs/Api/StringApi.md index b4d541b..561611a 100644 --- a/docs/Api/StringApi.md +++ b/docs/Api/StringApi.md @@ -20,16 +20,21 @@ Get Strings (formatted) require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\StringApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\StringApi( + // 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 +); $name = "name_example"; // string | Name of Strings **(Required)** $full_model = true; // bool | Full model or content only **(Required)** try { - $result = $api_instance->getStringsByName($name, $full_model); + $result = $apiInstance->getStringsByName($name, $full_model); print_r($result); } catch (Exception $e) { echo 'Exception when calling StringApi->getStringsByName: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/TagApi.md b/docs/Api/TagApi.md index 88a96c0..f6a52d2 100644 --- a/docs/Api/TagApi.md +++ b/docs/Api/TagApi.md @@ -24,15 +24,20 @@ Create tag. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\TagApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\TagApi( + // 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 +); $data = new \RadioManager\Model\TagDataInput(); // \RadioManager\Model\TagDataInput | Data **(Required)** try { - $result = $api_instance->createTag($data); + $result = $apiInstance->createTag($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling TagApi->createTag: ', $e->getMessage(), PHP_EOL; @@ -74,15 +79,20 @@ Delete tag by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\TagApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\TagApi( + // 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 = 789; // int | ID of Tag **(Required)** try { - $result = $api_instance->deleteTagById($id); + $result = $apiInstance->deleteTagById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling TagApi->deleteTagById: ', $e->getMessage(), PHP_EOL; @@ -124,16 +134,21 @@ Get tags by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\TagApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\TagApi( + // 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 = 789; // int | ID of Tag **(Required)** $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->getTagById($id, $_external_station_id); + $result = $apiInstance->getTagById($id, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling TagApi->getTagById: ', $e->getMessage(), PHP_EOL; @@ -176,11 +191,16 @@ Get a list of all the tags currently in your station. This feature supports pagi require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\TagApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\TagApi( + // 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 +); $page = 789; // int | Current page *(Optional)* $program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)` $item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)` @@ -192,7 +212,7 @@ $order_direction = "order_direction_example"; // string | Direction of ordering $_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)* try { - $result = $api_instance->listTags($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_id); + $result = $apiInstance->listTags($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling TagApi->listTags: ', $e->getMessage(), PHP_EOL; @@ -242,16 +262,21 @@ Update tag by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\TagApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\TagApi( + // 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 = 789; // int | ID of Tag **(Required)** $data = new \RadioManager\Model\TagDataInput(); // \RadioManager\Model\TagDataInput | Data *(Optional)* try { - $result = $api_instance->updateTagByID($id, $data); + $result = $apiInstance->updateTagByID($id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling TagApi->updateTagByID: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/UserApi.md b/docs/Api/UserApi.md index 608283c..decd1ae 100644 --- a/docs/Api/UserApi.md +++ b/docs/Api/UserApi.md @@ -23,15 +23,20 @@ Remove user from station by Id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\UserApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\UserApi( + // 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 = 789; // int | id of User try { - $result = $api_instance->deleteUserById($id); + $result = $apiInstance->deleteUserById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserApi->deleteUserById: ', $e->getMessage(), PHP_EOL; @@ -73,15 +78,20 @@ Get user by id require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\UserApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\UserApi( + // 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 = 789; // int | id of User try { - $result = $api_instance->getUserById($id); + $result = $apiInstance->getUserById($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserApi->getUserById: ', $e->getMessage(), PHP_EOL; @@ -123,15 +133,20 @@ Invite user by mail require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\UserApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\UserApi( + // 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 +); $data = new \RadioManager\Model\InviteUserData(); // \RadioManager\Model\InviteUserData | Data **(Required)** try { - $result = $api_instance->inviteUserByMail($data); + $result = $apiInstance->inviteUserByMail($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserApi->inviteUserByMail: ', $e->getMessage(), PHP_EOL; @@ -173,11 +188,16 @@ List all users. require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); - -$api_instance = new RadioManager\Api\UserApi(); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); + +$apiInstance = new RadioManager\Api\UserApi( + // 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 +); $page = 1; // int | Current page *(Optional)* $role_id = 789; // int | Search on Role ID *(Optional)* $limit = 789; // int | Results per page *(Optional)* @@ -185,7 +205,7 @@ $order_by = "order_by_example"; // string | Field to order the results *(Optiona $order_direction = "order_direction_example"; // string | Direction of ordering *(Optional)* try { - $result = $api_instance->listUsers($page, $role_id, $limit, $order_by, $order_direction); + $result = $apiInstance->listUsers($page, $role_id, $limit, $order_by, $order_direction); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserApi->listUsers: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Api/VisualSlideApi.md b/docs/Api/VisualSlideApi.md index 112c056..57a81f2 100644 --- a/docs/Api/VisualSlideApi.md +++ b/docs/Api/VisualSlideApi.md @@ -20,14 +20,19 @@ Get Visual Slide Image as Base64 require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: API Key -RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); +$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); -$api_instance = new RadioManager\Api\VisualSlideApi(); +$apiInstance = new RadioManager\Api\VisualSlideApi( + // 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 +); try { - $result = $api_instance->getVisualSlide(); + $result = $apiInstance->getVisualSlide(); print_r($result); } catch (Exception $e) { echo 'Exception when calling VisualSlideApi->getVisualSlide: ', $e->getMessage(), PHP_EOL; diff --git a/docs/Model/BroadcastEPGDay.md b/docs/Model/BroadcastEPGDay.md index 557d39b..195e7eb 100644 --- a/docs/Model/BroadcastEPGDay.md +++ b/docs/Model/BroadcastEPGDay.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**day** | [**\DateTime**](Date.md) | | [optional] +**day** | [**\DateTime**](\DateTime.md) | | [optional] **results** | [**\RadioManager\Model\BroadcastEPGResult[]**](BroadcastEPGResult.md) | | [[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/BroadcastRelations.md b/docs/Model/BroadcastRelations.md index 4efee83..afd4446 100644 --- a/docs/Model/BroadcastRelations.md +++ b/docs/Model/BroadcastRelations.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**genre** | [**\RadioManager\Model\BroadcastRelationsGenre**](BroadcastRelationsGenre.md) | | [optional] **items** | [**\RadioManager\Model\BroadcastRelationsItems**](BroadcastRelationsItems.md) | | [optional] **blocks** | [**\RadioManager\Model\BroadcastRelationsBlocks**](BroadcastRelationsBlocks.md) | | [optional] **program** | [**\RadioManager\Model\BlockRelationsProgram**](BlockRelationsProgram.md) | | [optional] diff --git a/docs/Model/BroadcastResult.md b/docs/Model/BroadcastResult.md index 1cc764f..960c178 100644 --- a/docs/Model/BroadcastResult.md +++ b/docs/Model/BroadcastResult.md @@ -30,6 +30,7 @@ Name | Type | Description | Notes **repetition_start** | [**\DateTime**](\DateTime.md) | | [optional] **repetition_days** | **string** | | [optional] **pty_code_id** | **int** | | [optional] +**genre** | [**\RadioManager\Model\BroadcastRelationsGenre**](BroadcastRelationsGenre.md) | | [optional] **items** | [**\RadioManager\Model\BroadcastRelationsItems**](BroadcastRelationsItems.md) | | [optional] **blocks** | [**\RadioManager\Model\BroadcastRelationsBlocks**](BroadcastRelationsBlocks.md) | | [optional] **program** | [**\RadioManager\Model\BlockRelationsProgram**](BlockRelationsProgram.md) | | [optional] diff --git a/docs/Model/CampaignOutputOnly.md b/docs/Model/CampaignOutputOnly.md index eb336ce..8e8ecc4 100644 --- a/docs/Model/CampaignOutputOnly.md +++ b/docs/Model/CampaignOutputOnly.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **updated_at** | [**\DateTime**](\DateTime.md) | | **created_at** | [**\DateTime**](\DateTime.md) | | **deleted_at** | [**\DateTime**](\DateTime.md) | | -**item** | [**\RadioManager\Model\Item[]**](Item.md) | | [optional] +**item** | [**\RadioManager\Model\CampaignTemplateItem**](CampaignTemplateItem.md) | | [optional] **_external_station_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/CampaignResult.md b/docs/Model/CampaignResult.md index a3b09fa..7ebdba6 100644 --- a/docs/Model/CampaignResult.md +++ b/docs/Model/CampaignResult.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **updated_at** | [**\DateTime**](\DateTime.md) | | **created_at** | [**\DateTime**](\DateTime.md) | | **deleted_at** | [**\DateTime**](\DateTime.md) | | -**item** | [**\RadioManager\Model\Item[]**](Item.md) | | [optional] +**item** | [**\RadioManager\Model\CampaignTemplateItem**](CampaignTemplateItem.md) | | [optional] **_external_station_id** | **int** | | [optional] **model_type_id** | **int** | | **field_values** | **object** | | [optional] diff --git a/docs/Model/CampaignTemplateItem.md b/docs/Model/CampaignTemplateItem.md new file mode 100644 index 0000000..5a0f95b --- /dev/null +++ b/docs/Model/CampaignTemplateItem.md @@ -0,0 +1,17 @@ +# CampaignTemplateItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model_type_id** | **int** | | [optional] +**external_id** | **string** | | [optional] +**field_values** | **object** | | [optional] +**title** | **string** | | [optional] +**duration** | **int** | | [optional] +**recommended** | **bool** | | [optional] +**static_start** | **bool** | | [optional] +**_deltas** | **object** | | [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/ContactRelations.md b/docs/Model/ContactRelations.md index 4384474..8de243d 100644 --- a/docs/Model/ContactRelations.md +++ b/docs/Model/ContactRelations.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tags** | [**\RadioManager\Model\ContactRelationsTags**](ContactRelationsTags.md) | | [optional] +**tags** | [**\RadioManager\Model\ContactRelationsTags**](ContactRelationsTags.md) | | **items** | [**\RadioManager\Model\ContactRelationsItems**](ContactRelationsItems.md) | | [optional] **model_type** | [**\RadioManager\Model\BroadcastRelationsModelType**](BroadcastRelationsModelType.md) | | [optional] diff --git a/docs/Model/ContactResult.md b/docs/Model/ContactResult.md index ee6fde8..dcb7e7d 100644 --- a/docs/Model/ContactResult.md +++ b/docs/Model/ContactResult.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **firstname** | **string** | | **lastname** | **string** | | **phone** | **string** | | [optional] -**tags** | [**\RadioManager\Model\ContactRelationsTags**](ContactRelationsTags.md) | | [optional] +**tags** | [**\RadioManager\Model\ContactRelationsTags**](ContactRelationsTags.md) | | **items** | [**\RadioManager\Model\ContactRelationsItems**](ContactRelationsItems.md) | | [optional] **model_type** | [**\RadioManager\Model\BroadcastRelationsModelType**](BroadcastRelationsModelType.md) | | [optional] diff --git a/docs/Model/Data.md b/docs/Model/Data.md index e04fe71..2d86e17 100644 --- a/docs/Model/Data.md +++ b/docs/Model/Data.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **start** | [**\DateTime**](\DateTime.md) | | [optional] +**allow_playlist_past** | **int** | | [optional] **items** | [**\RadioManager\Model\ImportItem[]**](ImportItem.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/Data1.md b/docs/Model/Data1.md index 9938224..d44208a 100644 --- a/docs/Model/Data1.md +++ b/docs/Model/Data1.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **start** | [**\DateTime**](\DateTime.md) | | [optional] +**allow_playlist_past** | **int** | | [optional] **items** | [**\RadioManager\Model\ImportItem[]**](ImportItem.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/Data2.md b/docs/Model/Data2.md new file mode 100644 index 0000000..715b5ab --- /dev/null +++ b/docs/Model/Data2.md @@ -0,0 +1,14 @@ +# Data2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | [**\DateTime**](\DateTime.md) | | [optional] +**allow_playlist_past** | **int** | | [optional] +**before_id** | **int** | | [optional] +**previous_id** | **int** | | [optional] +**items** | [**\RadioManager\Model\ImportItem[]**](ImportItem.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/Data3.md b/docs/Model/Data3.md new file mode 100644 index 0000000..4ac50c4 --- /dev/null +++ b/docs/Model/Data3.md @@ -0,0 +1,10 @@ +# Data3 + +## 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/ProgramRelations.md b/docs/Model/ProgramRelations.md index 7298c6a..5d20a7c 100644 --- a/docs/Model/ProgramRelations.md +++ b/docs/Model/ProgramRelations.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**genre** | [**\RadioManager\Model\BroadcastRelationsGenre**](BroadcastRelationsGenre.md) | | [optional] **items** | [**\RadioManager\Model\ProgramRelationsItems**](ProgramRelationsItems.md) | | [optional] **blocks** | [**\RadioManager\Model\ProgramRelationsBlocks**](ProgramRelationsBlocks.md) | | [optional] **broadcasts** | [**\RadioManager\Model\ProgramRelationsBroadcasts**](ProgramRelationsBroadcasts.md) | | [optional] diff --git a/docs/Model/ProgramResult.md b/docs/Model/ProgramResult.md index e2570f1..1f6b3e4 100644 --- a/docs/Model/ProgramResult.md +++ b/docs/Model/ProgramResult.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **recommended** | **bool** | | [optional] **language** | **string** | | [optional] **pty_code_id** | **int** | | [optional] +**genre** | [**\RadioManager\Model\BroadcastRelationsGenre**](BroadcastRelationsGenre.md) | | [optional] **items** | [**\RadioManager\Model\ProgramRelationsItems**](ProgramRelationsItems.md) | | [optional] **blocks** | [**\RadioManager\Model\ProgramRelationsBlocks**](ProgramRelationsBlocks.md) | | [optional] **broadcasts** | [**\RadioManager\Model\ProgramRelationsBroadcasts**](ProgramRelationsBroadcasts.md) | | [optional] diff --git a/docs/Model/StationResultStation.md b/docs/Model/StationResultStation.md index 61f2993..21a0dfd 100644 --- a/docs/Model/StationResultStation.md +++ b/docs/Model/StationResultStation.md @@ -28,6 +28,9 @@ Name | Type | Description | Notes **pty_type** | **string** | | [optional] **station_key** | **string** | | [optional] **timezone** | **string** | | [optional] +**metadataradio_organisation** | **string** | | [optional] +**metadataradio_station_id** | **string** | | [optional] +**start_days** | [**\RadioManager\Model\StationResultStationStartDays**](StationResultStationStartDays.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/StoryRelations.md b/docs/Model/StoryRelations.md index e5e1db2..794cd35 100644 --- a/docs/Model/StoryRelations.md +++ b/docs/Model/StoryRelations.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tags** | [**\RadioManager\Model\StoryRelationsTags**](StoryRelationsTags.md) | | [optional] +**tags** | [**\RadioManager\Model\StoryRelationsTags**](StoryRelationsTags.md) | | **items** | [**\RadioManager\Model\StoryRelationsItems**](StoryRelationsItems.md) | | [optional] **model_type** | [**\RadioManager\Model\BroadcastRelationsModelType**](BroadcastRelationsModelType.md) | | [optional] diff --git a/docs/Model/StoryResult.md b/docs/Model/StoryResult.md index 9fae75d..2bfb3b2 100644 --- a/docs/Model/StoryResult.md +++ b/docs/Model/StoryResult.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **field_values** | **object** | | [optional] **name** | **string** | | **description** | **string** | | [optional] -**tags** | [**\RadioManager\Model\StoryRelationsTags**](StoryRelationsTags.md) | | [optional] +**tags** | [**\RadioManager\Model\StoryRelationsTags**](StoryRelationsTags.md) | | **items** | [**\RadioManager\Model\StoryRelationsItems**](StoryRelationsItems.md) | | [optional] **model_type** | [**\RadioManager\Model\BroadcastRelationsModelType**](BroadcastRelationsModelType.md) | | [optional] diff --git a/lib/Api/BlockApi.php b/lib/Api/BlockApi.php index 8fca480..7052ca7 100644 --- a/lib/Api/BlockApi.php +++ b/lib/Api/BlockApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * BlockApi Class Doc Comment @@ -44,47 +50,36 @@ class BlockApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return BlockApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,9 +87,11 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Get block by id * - * @param int $id ID of Block **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of Block **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\BlockResult */ public function getBlockById($id, $_external_station_id = null) @@ -108,417 +105,1220 @@ public function getBlockById($id, $_external_station_id = null) * * Get block by id * - * @param int $id ID of Block **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of Block **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\BlockResult, HTTP status code, HTTP response headers (array of strings) */ public function getBlockByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\BlockResult'; + $request = $this->getBlockByIdRequest($id, $_external_station_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BlockResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBlockByIdAsync + * + * Get block by id + * + * @param int $id ID of Block **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBlockByIdAsync($id, $_external_station_id = null) + { + return $this->getBlockByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBlockByIdAsyncWithHttpInfo + * + * Get block by id + * + * @param int $id ID of Block **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBlockByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\BlockResult'; + $request = $this->getBlockByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getBlockById' + * + * @param int $id ID of Block **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getBlockByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getBlockById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getBlockById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling BlockApi.getBlockById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/blocks/{id}"; - $httpBody = ''; + + $resourcePath = '/blocks/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 getCurrentBlock + * + * Get current Block + * + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\BlockResult + */ + public function getCurrentBlock() + { + list($response) = $this->getCurrentBlockWithHttpInfo(); + return $response; + } + + /** + * Operation getCurrentBlockWithHttpInfo + * + * Get current Block + * + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\BlockResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getCurrentBlockWithHttpInfo() + { + $returnType = '\RadioManager\Model\BlockResult'; + $request = $this->getCurrentBlockRequest(); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BlockResult', - '/blocks/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BlockResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BlockResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BlockResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getCurrentBlock + * Operation getCurrentBlockAsync * * Get current Block * - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\BlockResult + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentBlock() + public function getCurrentBlockAsync() { - list($response) = $this->getCurrentBlockWithHttpInfo(); - return $response; + return $this->getCurrentBlockAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getCurrentBlockWithHttpInfo + * Operation getCurrentBlockAsyncWithHttpInfo * * Get current Block * - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\BlockResult, HTTP status code, HTTP response headers (array of strings) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCurrentBlockWithHttpInfo() + public function getCurrentBlockAsyncWithHttpInfo() { - // parse inputs - $resourcePath = "/blocks/current"; - $httpBody = ''; + $returnType = '\RadioManager\Model\BlockResult'; + $request = $this->getCurrentBlockRequest(); + + 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 'getCurrentBlock' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCurrentBlockRequest() + { + + $resourcePath = '/blocks/current'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 getNextBlock + * + * Get upcoming Block + * + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\BlockResult + */ + public function getNextBlock() + { + list($response) = $this->getNextBlockWithHttpInfo(); + return $response; + } + + /** + * Operation getNextBlockWithHttpInfo + * + * Get upcoming Block + * + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\BlockResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getNextBlockWithHttpInfo() + { + $returnType = '\RadioManager\Model\BlockResult'; + $request = $this->getNextBlockRequest(); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BlockResult', - '/blocks/current' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BlockResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BlockResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BlockResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getNextBlock + * Operation getNextBlockAsync * * Get upcoming Block * - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\BlockResult + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNextBlock() + public function getNextBlockAsync() { - list($response) = $this->getNextBlockWithHttpInfo(); - return $response; + return $this->getNextBlockAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getNextBlockWithHttpInfo + * Operation getNextBlockAsyncWithHttpInfo * * Get upcoming Block * - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\BlockResult, HTTP status code, HTTP response headers (array of strings) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNextBlockWithHttpInfo() + public function getNextBlockAsyncWithHttpInfo() { - // parse inputs - $resourcePath = "/blocks/next"; - $httpBody = ''; + $returnType = '\RadioManager\Model\BlockResult'; + $request = $this->getNextBlockRequest(); + + 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 'getNextBlock' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getNextBlockRequest() + { + + $resourcePath = '/blocks/next'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listBlocks + * + * Get a list of all blocks currently in your station. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\BlockResults + */ + public function listBlocks($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listBlocksWithHttpInfo($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listBlocksWithHttpInfo + * + * Get a list of all blocks currently in your station. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\BlockResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listBlocksWithHttpInfo($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\BlockResults'; + $request = $this->listBlocksRequest($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BlockResult', - '/blocks/next' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BlockResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BlockResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BlockResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listBlocks + * Operation listBlocksAsync * * Get a list of all blocks currently in your station. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\BlockResults + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listBlocks($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listBlocksAsync($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listBlocksWithHttpInfo($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listBlocksAsyncWithHttpInfo($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listBlocksWithHttpInfo + * Operation listBlocksAsyncWithHttpInfo * * Get a list of all blocks currently in your station. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\BlockResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listBlocksWithHttpInfo($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listBlocksAsyncWithHttpInfo($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\BlockResults'; + $request = $this->listBlocksRequest($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listBlocks' + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listBlocksRequest($page = '1', $broadcast_id = null, $item_id = null, $program_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling BlockApi.listBlocks, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling BlockApi.listBlocks, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling BlockApi.listBlocks, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/blocks"; - $httpBody = ''; + + $resourcePath = '/blocks'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($start_min !== null) { - $queryParams['start-min'] = $this->apiClient->getSerializer()->toQueryValue($start_min); + $queryParams['start-min'] = ObjectSerializer::toQueryValue($start_min); } // query params if ($start_max !== null) { - $queryParams['start-max'] = $this->apiClient->getSerializer()->toQueryValue($start_max); + $queryParams['start-max'] = ObjectSerializer::toQueryValue($start_max); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BlockResults', - '/blocks' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BlockResults', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BlockResults', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $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/BroadcastApi.php b/lib/Api/BroadcastApi.php index 16a1424..b1dc6b1 100644 --- a/lib/Api/BroadcastApi.php +++ b/lib/Api/BroadcastApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * BroadcastApi Class Doc Comment @@ -44,47 +50,36 @@ class BroadcastApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return BroadcastApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create broadcast. * - * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createBroadcast($data) @@ -107,1179 +104,3341 @@ public function createBroadcast($data) * * Create broadcast. * - * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createBroadcastWithHttpInfo($data) { - // verify the required parameter 'data' is set - if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createBroadcast'); - } - // parse inputs - $resourcePath = "/broadcasts"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - - // body params - $_tempBody = null; - if (isset($data)) { - $_tempBody = $data; - } + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createBroadcastRequest($data); - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/broadcasts' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteBroadcastById + * Operation createBroadcastAsync * - * Delete broadcast by id + * Create broadcast. * - * @param int $id ID of Broadcast **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteBroadcastById($id) + public function createBroadcastAsync($data) { - list($response) = $this->deleteBroadcastByIdWithHttpInfo($id); - return $response; + return $this->createBroadcastAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteBroadcastByIdWithHttpInfo + * Operation createBroadcastAsyncWithHttpInfo * - * Delete broadcast by id + * Create broadcast. * - * @param int $id ID of Broadcast **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteBroadcastByIdWithHttpInfo($id) + public function createBroadcastAsyncWithHttpInfo($data) { - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteBroadcastById'); - } - if (($id < 0)) { - throw new \InvalidArgumentException('invalid value for "$id" when calling BroadcastApi.deleteBroadcastById, must be bigger than or equal to 0.'); + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createBroadcastRequest($data); + + 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 'createBroadcast' + * + * @param \RadioManager\Model\BroadcastDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createBroadcastRequest($data) + { + // verify the required parameter 'data' is set + if ($data === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createBroadcast' + ); } - // parse inputs - $resourcePath = "/broadcasts/{id}"; - $httpBody = ''; + $resourcePath = '/broadcasts'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($data)) { + $_tempBody = $data; } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - // path params - if ($id !== null) { - $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), - $resourcePath + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 deleteBroadcastById + * + * Delete broadcast by id + * + * @param int $id ID of Broadcast **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteBroadcastById($id) + { + list($response) = $this->deleteBroadcastByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteBroadcastByIdWithHttpInfo + * + * Delete broadcast by id + * + * @param int $id ID of Broadcast **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteBroadcastByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteBroadcastByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/broadcasts/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getBroadcastById + * Operation deleteBroadcastByIdAsync * - * Get broadcast by id + * Delete broadcast by id * - * @param int $id ID of Broadcast **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\BroadcastResult + * @param int $id ID of Broadcast **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBroadcastById($id, $_external_station_id = null) + public function deleteBroadcastByIdAsync($id) { - list($response) = $this->getBroadcastByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->deleteBroadcastByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getBroadcastByIdWithHttpInfo + * Operation deleteBroadcastByIdAsyncWithHttpInfo * - * Get broadcast by id + * Delete broadcast by id * - * @param int $id ID of Broadcast **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\BroadcastResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Broadcast **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBroadcastByIdWithHttpInfo($id, $_external_station_id = null) + public function deleteBroadcastByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteBroadcastByIdRequest($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() + ]; + }, + 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 'deleteBroadcastById' + * + * @param int $id ID of Broadcast **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteBroadcastByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getBroadcastById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteBroadcastById' + ); } - if (($id < 0)) { - throw new \InvalidArgumentException('invalid value for "$id" when calling BroadcastApi.getBroadcastById, must be bigger than or equal to 0.'); + if ($id < 0) { + throw new \InvalidArgumentException('invalid value for "$id" when calling BroadcastApi.deleteBroadcastById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/broadcasts/{id}"; - $httpBody = ''; + + $resourcePath = '/broadcasts/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + - // query params - if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); - } // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BroadcastResult', - '/broadcasts/{id}' - ); - - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BroadcastResult', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BroadcastResult', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; + $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 getCurrentBroadcast + * Operation getBroadcastById * - * Get current Broadcast + * Get broadcast by id + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) * - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\BroadcastResult */ - public function getCurrentBroadcast($withunpublished = null) + public function getBroadcastById($id, $_external_station_id = null) { - list($response) = $this->getCurrentBroadcastWithHttpInfo($withunpublished); + list($response) = $this->getBroadcastByIdWithHttpInfo($id, $_external_station_id); return $response; } /** - * Operation getCurrentBroadcastWithHttpInfo + * Operation getBroadcastByIdWithHttpInfo * - * Get current Broadcast + * Get broadcast by id + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) * - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\BroadcastResult, HTTP status code, HTTP response headers (array of strings) */ - public function getCurrentBroadcastWithHttpInfo($withunpublished = null) + public function getBroadcastByIdWithHttpInfo($id, $_external_station_id = null) { - // parse inputs - $resourcePath = "/broadcasts/current"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - - // query params - if ($withunpublished !== null) { - $queryParams['withunpublished'] = $this->apiClient->getSerializer()->toQueryValue($withunpublished); - } + $returnType = '\RadioManager\Model\BroadcastResult'; + $request = $this->getBroadcastByIdRequest($id, $_external_station_id); - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BroadcastResult', - '/broadcasts/current' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BroadcastResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BroadcastResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BroadcastResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getDailyEPG + * Operation getBroadcastByIdAsync * - * Get daily EPG + * Get broadcast by id * - * @param \DateTime $date Date *(Optional)* (optional) - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\EPGResults + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDailyEPG($date = null, $withunpublished = null) + public function getBroadcastByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getDailyEPGWithHttpInfo($date, $withunpublished); - return $response; + return $this->getBroadcastByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getDailyEPGWithHttpInfo + * Operation getBroadcastByIdAsyncWithHttpInfo * - * Get daily EPG + * Get broadcast by id * - * @param \DateTime $date Date *(Optional)* (optional) - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDailyEPGWithHttpInfo($date = null, $withunpublished = null) + public function getBroadcastByIdAsyncWithHttpInfo($id, $_external_station_id = null) { - // parse inputs - $resourcePath = "/broadcasts/epg/daily"; - $httpBody = ''; + $returnType = '\RadioManager\Model\BroadcastResult'; + $request = $this->getBroadcastByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getBroadcastById' + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getBroadcastByIdRequest($id, $_external_station_id = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getBroadcastById' + ); + } + if ($id < 0) { + throw new \InvalidArgumentException('invalid value for "$id" when calling BroadcastApi.getBroadcastById, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/broadcasts/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($_external_station_id !== null) { + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + // 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 getCurrentBroadcast + * + * Get current Broadcast + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\BroadcastResult + */ + public function getCurrentBroadcast($withunpublished = null) + { + list($response) = $this->getCurrentBroadcastWithHttpInfo($withunpublished); + return $response; + } + + /** + * Operation getCurrentBroadcastWithHttpInfo + * + * Get current Broadcast + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\BroadcastResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getCurrentBroadcastWithHttpInfo($withunpublished = null) + { + $returnType = '\RadioManager\Model\BroadcastResult'; + $request = $this->getCurrentBroadcastRequest($withunpublished); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BroadcastResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCurrentBroadcastAsync + * + * Get current Broadcast + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCurrentBroadcastAsync($withunpublished = null) + { + return $this->getCurrentBroadcastAsyncWithHttpInfo($withunpublished) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCurrentBroadcastAsyncWithHttpInfo + * + * Get current Broadcast + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCurrentBroadcastAsyncWithHttpInfo($withunpublished = null) + { + $returnType = '\RadioManager\Model\BroadcastResult'; + $request = $this->getCurrentBroadcastRequest($withunpublished); + + 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 'getCurrentBroadcast' + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCurrentBroadcastRequest($withunpublished = null) + { + + $resourcePath = '/broadcasts/current'; $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($withunpublished !== null) { + $queryParams['withunpublished'] = ObjectSerializer::toQueryValue($withunpublished); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 getDailyEPG + * + * Get daily EPG + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\EPGResults + */ + public function getDailyEPG($date = null, $withunpublished = null) + { + list($response) = $this->getDailyEPGWithHttpInfo($date, $withunpublished); + return $response; + } + + /** + * Operation getDailyEPGWithHttpInfo + * + * Get daily EPG + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + */ + public function getDailyEPGWithHttpInfo($date = null, $withunpublished = null) + { + $returnType = '\RadioManager\Model\EPGResults'; + $request = $this->getDailyEPGRequest($date, $withunpublished); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\EPGResults', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDailyEPGAsync + * + * Get daily EPG + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDailyEPGAsync($date = null, $withunpublished = null) + { + return $this->getDailyEPGAsyncWithHttpInfo($date, $withunpublished) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDailyEPGAsyncWithHttpInfo + * + * Get daily EPG + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDailyEPGAsyncWithHttpInfo($date = null, $withunpublished = null) + { + $returnType = '\RadioManager\Model\EPGResults'; + $request = $this->getDailyEPGRequest($date, $withunpublished); + + 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 'getDailyEPG' + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getDailyEPGRequest($date = null, $withunpublished = null) + { + + $resourcePath = '/broadcasts/epg/daily'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; // query params if ($date !== null) { - $queryParams['date'] = $this->apiClient->getSerializer()->toQueryValue($date); + $queryParams['date'] = ObjectSerializer::toQueryValue($date); } // query params if ($withunpublished !== null) { - $queryParams['withunpublished'] = $this->apiClient->getSerializer()->toQueryValue($withunpublished); + $queryParams['withunpublished'] = ObjectSerializer::toQueryValue($withunpublished); + } + + + // 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call + $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 getEPGByDate + * + * Get EPG by date + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\EPGResults + */ + public function getEPGByDate($date = null, $withunpublished = null) + { + list($response) = $this->getEPGByDateWithHttpInfo($date, $withunpublished); + return $response; + } + + /** + * Operation getEPGByDateWithHttpInfo + * + * Get EPG by date + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + */ + public function getEPGByDateWithHttpInfo($date = null, $withunpublished = null) + { + $returnType = '\RadioManager\Model\EPGResults'; + $request = $this->getEPGByDateRequest($date, $withunpublished); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\EPGResults', - '/broadcasts/epg/daily' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\EPGResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\EPGResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\EPGResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getEPGByDate + * Operation getEPGByDateAsync * * Get EPG by date * - * @param \DateTime $date Date *(Optional)* (optional) - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\EPGResults + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEPGByDate($date = null, $withunpublished = null) + public function getEPGByDateAsync($date = null, $withunpublished = null) { - list($response) = $this->getEPGByDateWithHttpInfo($date, $withunpublished); - return $response; + return $this->getEPGByDateAsyncWithHttpInfo($date, $withunpublished) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getEPGByDateWithHttpInfo + * Operation getEPGByDateAsyncWithHttpInfo * * Get EPG by date * - * @param \DateTime $date Date *(Optional)* (optional) - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEPGByDateWithHttpInfo($date = null, $withunpublished = null) + public function getEPGByDateAsyncWithHttpInfo($date = null, $withunpublished = null) { - // parse inputs - $resourcePath = "/broadcasts/epg"; - $httpBody = ''; + $returnType = '\RadioManager\Model\EPGResults'; + $request = $this->getEPGByDateRequest($date, $withunpublished); + + 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 'getEPGByDate' + * + * @param \DateTime $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getEPGByDateRequest($date = null, $withunpublished = null) + { + + $resourcePath = '/broadcasts/epg'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($date !== null) { - $queryParams['date'] = $this->apiClient->getSerializer()->toQueryValue($date); + $queryParams['date'] = ObjectSerializer::toQueryValue($date); } // query params if ($withunpublished !== null) { - $queryParams['withunpublished'] = $this->apiClient->getSerializer()->toQueryValue($withunpublished); + $queryParams['withunpublished'] = ObjectSerializer::toQueryValue($withunpublished); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 getNextBroadcast + * + * Get next Broadcast + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\BroadcastResult + */ + public function getNextBroadcast($withunpublished = null) + { + list($response) = $this->getNextBroadcastWithHttpInfo($withunpublished); + return $response; + } + + /** + * Operation getNextBroadcastWithHttpInfo + * + * Get next Broadcast + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\BroadcastResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getNextBroadcastWithHttpInfo($withunpublished = null) + { + $returnType = '\RadioManager\Model\BroadcastResult'; + $request = $this->getNextBroadcastRequest($withunpublished); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\EPGResults', - '/broadcasts/epg' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\EPGResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\EPGResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BroadcastResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getNextBroadcast + * Operation getNextBroadcastAsync * * Get next Broadcast * - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\BroadcastResult + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNextBroadcast($withunpublished = null) + public function getNextBroadcastAsync($withunpublished = null) { - list($response) = $this->getNextBroadcastWithHttpInfo($withunpublished); - return $response; + return $this->getNextBroadcastAsyncWithHttpInfo($withunpublished) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getNextBroadcastWithHttpInfo + * Operation getNextBroadcastAsyncWithHttpInfo * * Get next Broadcast * - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\BroadcastResult, HTTP status code, HTTP response headers (array of strings) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNextBroadcastWithHttpInfo($withunpublished = null) + public function getNextBroadcastAsyncWithHttpInfo($withunpublished = null) { - // parse inputs - $resourcePath = "/broadcasts/next"; - $httpBody = ''; + $returnType = '\RadioManager\Model\BroadcastResult'; + $request = $this->getNextBroadcastRequest($withunpublished); + + 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 'getNextBroadcast' + * + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getNextBroadcastRequest($withunpublished = null) + { + + $resourcePath = '/broadcasts/next'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($withunpublished !== null) { - $queryParams['withunpublished'] = $this->apiClient->getSerializer()->toQueryValue($withunpublished); + $queryParams['withunpublished'] = ObjectSerializer::toQueryValue($withunpublished); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 getWeeklyEPG + * + * Get weekly EPG + * + * @param string $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\EPGResults + */ + public function getWeeklyEPG($date = null, $withunpublished = null) + { + list($response) = $this->getWeeklyEPGWithHttpInfo($date, $withunpublished); + return $response; + } + + /** + * Operation getWeeklyEPGWithHttpInfo + * + * Get weekly EPG + * + * @param string $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + */ + public function getWeeklyEPGWithHttpInfo($date = null, $withunpublished = null) + { + $returnType = '\RadioManager\Model\EPGResults'; + $request = $this->getWeeklyEPGRequest($date, $withunpublished); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BroadcastResult', - '/broadcasts/next' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BroadcastResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BroadcastResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\EPGResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getWeeklyEPG + * Operation getWeeklyEPGAsync + * + * Get weekly EPG + * + * @param string $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWeeklyEPGAsync($date = null, $withunpublished = null) + { + return $this->getWeeklyEPGAsyncWithHttpInfo($date, $withunpublished) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWeeklyEPGAsyncWithHttpInfo * * Get weekly EPG * - * @param string $date Date *(Optional)* (optional) - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * @param string $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWeeklyEPGAsyncWithHttpInfo($date = null, $withunpublished = null) + { + $returnType = '\RadioManager\Model\EPGResults'; + $request = $this->getWeeklyEPGRequest($date, $withunpublished); + + 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 'getWeeklyEPG' + * + * @param string $date Date *(Optional)* (optional) + * @param bool $withunpublished Show Unpublished *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWeeklyEPGRequest($date = null, $withunpublished = null) + { + + $resourcePath = '/broadcasts/epg/weekly'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($date !== null) { + $queryParams['date'] = ObjectSerializer::toQueryValue($date); + } + // query params + if ($withunpublished !== null) { + $queryParams['withunpublished'] = ObjectSerializer::toQueryValue($withunpublished); + } + + + // 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 listBroadcasts + * + * Get all broadcasts. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\EPGResults + * @throws \InvalidArgumentException + * @return \RadioManager\Model\BroadcastResults */ - public function getWeeklyEPG($date = null, $withunpublished = null) + public function listBroadcasts($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->getWeeklyEPGWithHttpInfo($date, $withunpublished); + list($response) = $this->listBroadcastsWithHttpInfo($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); return $response; } /** - * Operation getWeeklyEPGWithHttpInfo + * Operation listBroadcastsWithHttpInfo * - * Get weekly EPG + * Get all broadcasts. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) * - * @param string $date Date *(Optional)* (optional) - * @param bool $withunpublished Show Unpublished *(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\BroadcastResults, HTTP status code, HTTP response headers (array of strings) */ - public function getWeeklyEPGWithHttpInfo($date = null, $withunpublished = null) + public function listBroadcastsWithHttpInfo($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - // parse inputs - $resourcePath = "/broadcasts/epg/weekly"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - - // query params - if ($date !== null) { - $queryParams['date'] = $this->apiClient->getSerializer()->toQueryValue($date); - } - // query params - if ($withunpublished !== null) { - $queryParams['withunpublished'] = $this->apiClient->getSerializer()->toQueryValue($withunpublished); - } + $returnType = '\RadioManager\Model\BroadcastResults'; + $request = $this->listBroadcastsRequest($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\EPGResults', - '/broadcasts/epg/weekly' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\EPGResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\EPGResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\BroadcastResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listBroadcasts + * Operation listBroadcastsAsync * * Get all broadcasts. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) - * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\BroadcastResults + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listBroadcasts($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listBroadcastsAsync($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listBroadcastsWithHttpInfo($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listBroadcastsAsyncWithHttpInfo($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listBroadcastsWithHttpInfo + * Operation listBroadcastsAsyncWithHttpInfo * * Get all broadcasts. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) - * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\BroadcastResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listBroadcastsWithHttpInfo($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listBroadcastsAsyncWithHttpInfo($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\BroadcastResults'; + $request = $this->listBroadcastsRequest($page, $program_id, $block_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $item_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listBroadcasts' + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listBroadcastsRequest($page = '1', $program_id = null, $block_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $item_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling BroadcastApi.listBroadcasts, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling BroadcastApi.listBroadcasts, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling BroadcastApi.listBroadcasts, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/broadcasts"; - $httpBody = ''; + + $resourcePath = '/broadcasts'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($block_id !== null) { - $queryParams['block_id'] = $this->apiClient->getSerializer()->toQueryValue($block_id); + $queryParams['block_id'] = ObjectSerializer::toQueryValue($block_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($tag_id !== null) { - $queryParams['tag_id'] = $this->apiClient->getSerializer()->toQueryValue($tag_id); + $queryParams['tag_id'] = ObjectSerializer::toQueryValue($tag_id); } // query params if ($presenter_id !== null) { - $queryParams['presenter_id'] = $this->apiClient->getSerializer()->toQueryValue($presenter_id); + $queryParams['presenter_id'] = ObjectSerializer::toQueryValue($presenter_id); } // query params if ($genre_id !== null) { - $queryParams['genre_id'] = $this->apiClient->getSerializer()->toQueryValue($genre_id); + $queryParams['genre_id'] = ObjectSerializer::toQueryValue($genre_id); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($start_min !== null) { - $queryParams['start-min'] = $this->apiClient->getSerializer()->toQueryValue($start_min); + $queryParams['start-min'] = ObjectSerializer::toQueryValue($start_min); } // query params if ($start_max !== null) { - $queryParams['start-max'] = $this->apiClient->getSerializer()->toQueryValue($start_max); + $queryParams['start-max'] = ObjectSerializer::toQueryValue($start_max); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 printBroadcastById + * + * Print broadcast by id with template + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $template_id Search on template ID *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function printBroadcastById($id, $template_id = null) + { + list($response) = $this->printBroadcastByIdWithHttpInfo($id, $template_id); + return $response; + } + + /** + * Operation printBroadcastByIdWithHttpInfo + * + * Print broadcast by id with template + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $template_id Search on template ID *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function printBroadcastByIdWithHttpInfo($id, $template_id = null) + { + $returnType = 'string'; + $request = $this->printBroadcastByIdRequest($id, $template_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\BroadcastResults', - '/broadcasts' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\BroadcastResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\BroadcastResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation printBroadcastById + * Operation printBroadcastByIdAsync * - * Print Broadcast by id + * Print broadcast by id with template * - * @param int $id ID of Broadcast **(Required)** (required) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\EPGResults + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $template_id Search on template ID *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function printBroadcastById($id, $program_id = null, $presenter_id = null, $tag_id = null) + public function printBroadcastByIdAsync($id, $template_id = null) { - list($response) = $this->printBroadcastByIdWithHttpInfo($id, $program_id, $presenter_id, $tag_id); - return $response; + return $this->printBroadcastByIdAsyncWithHttpInfo($id, $template_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation printBroadcastByIdWithHttpInfo + * Operation printBroadcastByIdAsyncWithHttpInfo * - * Print Broadcast by id + * Print broadcast by id with template * - * @param int $id ID of Broadcast **(Required)** (required) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\EPGResults, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $template_id Search on template ID *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function printBroadcastByIdAsyncWithHttpInfo($id, $template_id = null) + { + $returnType = 'string'; + $request = $this->printBroadcastByIdRequest($id, $template_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() + ]; + }, + 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 'printBroadcastById' + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param int $template_id Search on template ID *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function printBroadcastByIdWithHttpInfo($id, $program_id = null, $presenter_id = null, $tag_id = null) + protected function printBroadcastByIdRequest($id, $template_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling printBroadcastById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling printBroadcastById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling BroadcastApi.printBroadcastById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/broadcasts/print/{id}"; - $httpBody = ''; + + $resourcePath = '/broadcasts/print/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params - if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); - } - // query params - if ($presenter_id !== null) { - $queryParams['presenter_id'] = $this->apiClient->getSerializer()->toQueryValue($presenter_id); - } - // query params - if ($tag_id !== null) { - $queryParams['tag_id'] = $this->apiClient->getSerializer()->toQueryValue($tag_id); + if ($template_id !== null) { + $queryParams['template_id'] = ObjectSerializer::toQueryValue($template_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 updateBroadcastByID + * + * Update broadcast by id + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateBroadcastByID($id, $data = null) + { + list($response) = $this->updateBroadcastByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateBroadcastByIDWithHttpInfo + * + * Update broadcast by id + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateBroadcastByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateBroadcastByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\EPGResults', - '/broadcasts/print/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\EPGResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\EPGResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateBroadcastByID + * Operation updateBroadcastByIDAsync * * Update broadcast by id * - * @param int $id ID of Broadcast **(Required)** (required) - * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Broadcast **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBroadcastByID($id, $data = null) + public function updateBroadcastByIDAsync($id, $data = null) { - list($response) = $this->updateBroadcastByIDWithHttpInfo($id, $data); - return $response; + return $this->updateBroadcastByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateBroadcastByIDWithHttpInfo + * Operation updateBroadcastByIDAsyncWithHttpInfo * * Update broadcast by id * - * @param int $id ID of Broadcast **(Required)** (required) - * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Broadcast **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBroadcastByIDWithHttpInfo($id, $data = null) + public function updateBroadcastByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateBroadcastByIDRequest($id, $data); + + 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 'updateBroadcastByID' + * + * @param int $id ID of Broadcast **(Required)** (required) + * @param \RadioManager\Model\BroadcastDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateBroadcastByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateBroadcastByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateBroadcastByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling BroadcastApi.updateBroadcastByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/broadcasts/{id}"; - $httpBody = ''; + + $resourcePath = '/broadcasts/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/broadcasts/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/CampaignApi.php b/lib/Api/CampaignApi.php index 676dda9..ed8b840 100644 --- a/lib/Api/CampaignApi.php +++ b/lib/Api/CampaignApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * CampaignApi Class Doc Comment @@ -44,47 +50,36 @@ class CampaignApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return CampaignApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create campaign. * - * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createCampaign($data) @@ -107,27 +104,205 @@ public function createCampaign($data) * * Create campaign. * - * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createCampaignWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createCampaignRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCampaignAsync + * + * Create campaign. + * + * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCampaignAsync($data) + { + return $this->createCampaignAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCampaignAsyncWithHttpInfo + * + * Create campaign. + * + * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCampaignAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createCampaignRequest($data); + + 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 'createCampaign' + * + * @param \RadioManager\Model\CampaignDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createCampaignRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createCampaign'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createCampaign' + ); } - // parse inputs - $resourcePath = "/campaigns"; - $httpBody = ''; + + $resourcePath = '/campaigns'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -135,531 +310,1362 @@ public function createCampaignWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 deleteCampaignById + * + * Delete campaign by id + * + * @param int $id ID of Campaign **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteCampaignById($id) + { + list($response) = $this->deleteCampaignByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteCampaignByIdWithHttpInfo + * + * Delete campaign by id + * + * @param int $id ID of Campaign **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCampaignByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteCampaignByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/campaigns' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteCampaignById + * Operation deleteCampaignByIdAsync * * Delete campaign by id * - * @param int $id ID of Campaign **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Campaign **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignById($id) + public function deleteCampaignByIdAsync($id) { - list($response) = $this->deleteCampaignByIdWithHttpInfo($id); - return $response; + return $this->deleteCampaignByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteCampaignByIdWithHttpInfo + * Operation deleteCampaignByIdAsyncWithHttpInfo * * Delete campaign by id * - * @param int $id ID of Campaign **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Campaign **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignByIdWithHttpInfo($id) + public function deleteCampaignByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteCampaignByIdRequest($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() + ]; + }, + 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 'deleteCampaignById' + * + * @param int $id ID of Campaign **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteCampaignByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteCampaignById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteCampaignById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling CampaignApi.deleteCampaignById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/campaigns/{id}"; - $httpBody = ''; + + $resourcePath = '/campaigns/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 getCampaignById + * + * Get campaign by id + * + * @param int $id ID of Campaign **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\CampaignResult + */ + public function getCampaignById($id, $_external_station_id = null) + { + list($response) = $this->getCampaignByIdWithHttpInfo($id, $_external_station_id); + return $response; + } + + /** + * Operation getCampaignByIdWithHttpInfo + * + * Get campaign by id + * + * @param int $id ID of Campaign **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\CampaignResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\CampaignResult'; + $request = $this->getCampaignByIdRequest($id, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/campaigns/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\CampaignResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getCampaignById + * Operation getCampaignByIdAsync * * Get campaign by id * - * @param int $id ID of Campaign **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\CampaignResult + * @param int $id ID of Campaign **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignById($id, $_external_station_id = null) + public function getCampaignByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getCampaignByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->getCampaignByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getCampaignByIdWithHttpInfo + * Operation getCampaignByIdAsyncWithHttpInfo * * Get campaign by id * - * @param int $id ID of Campaign **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\CampaignResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Campaign **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignByIdWithHttpInfo($id, $_external_station_id = null) + public function getCampaignByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\CampaignResult'; + $request = $this->getCampaignByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getCampaignById' + * + * @param int $id ID of Campaign **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCampaignByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getCampaignById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCampaignById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling CampaignApi.getCampaignById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/campaigns/{id}"; - $httpBody = ''; + + $resourcePath = '/campaigns/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listCampaigns + * + * Get all campaigns. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\CampaignResults + */ + public function listCampaigns($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listCampaignsWithHttpInfo($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listCampaignsWithHttpInfo + * + * Get all campaigns. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\CampaignResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listCampaignsWithHttpInfo($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\CampaignResults'; + $request = $this->listCampaignsRequest($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\CampaignResult', - '/campaigns/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\CampaignResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\CampaignResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\CampaignResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listCampaigns + * Operation listCampaignsAsync * * Get all campaigns. * - * @param int $page Current page *(Optional)* (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\CampaignResults + * @param int $page Current page *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCampaigns($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listCampaignsAsync($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listCampaignsWithHttpInfo($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listCampaignsAsyncWithHttpInfo($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listCampaignsWithHttpInfo + * Operation listCampaignsAsyncWithHttpInfo * * Get all campaigns. * - * @param int $page Current page *(Optional)* (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\CampaignResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCampaignsWithHttpInfo($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listCampaignsAsyncWithHttpInfo($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\CampaignResults'; + $request = $this->listCampaignsRequest($page, $item_id, $model_type_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listCampaigns' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listCampaignsRequest($page = null, $item_id = null, $model_type_id = null, $start_min = null, $start_max = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling CampaignApi.listCampaigns, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling CampaignApi.listCampaigns, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling CampaignApi.listCampaigns, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/campaigns"; - $httpBody = ''; + + $resourcePath = '/campaigns'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($start_min !== null) { - $queryParams['start-min'] = $this->apiClient->getSerializer()->toQueryValue($start_min); + $queryParams['start-min'] = ObjectSerializer::toQueryValue($start_min); } // query params if ($start_max !== null) { - $queryParams['start-max'] = $this->apiClient->getSerializer()->toQueryValue($start_max); + $queryParams['start-max'] = ObjectSerializer::toQueryValue($start_max); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updateCampaignByID + * + * Update campaign by id + * + * @param int $id ID of Campaign **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateCampaignByID($id, $data = null) + { + list($response) = $this->updateCampaignByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateCampaignByIDWithHttpInfo + * + * Update campaign by id + * + * @param int $id ID of Campaign **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCampaignByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateCampaignByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\CampaignResults', - '/campaigns' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\CampaignResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\CampaignResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateCampaignByID + * Operation updateCampaignByIDAsync * * Update campaign by id * - * @param int $id ID of Campaign **(Required)** (required) - * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Campaign **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignByID($id, $data = null) + public function updateCampaignByIDAsync($id, $data = null) { - list($response) = $this->updateCampaignByIDWithHttpInfo($id, $data); - return $response; + return $this->updateCampaignByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateCampaignByIDWithHttpInfo + * Operation updateCampaignByIDAsyncWithHttpInfo * * Update campaign by id * - * @param int $id ID of Campaign **(Required)** (required) - * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Campaign **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignByIDWithHttpInfo($id, $data = null) + public function updateCampaignByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateCampaignByIDRequest($id, $data); + + 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 'updateCampaignByID' + * + * @param int $id ID of Campaign **(Required)** (required) + * @param \RadioManager\Model\CampaignDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateCampaignByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateCampaignByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateCampaignByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling CampaignApi.updateCampaignByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/campaigns/{id}"; - $httpBody = ''; + + $resourcePath = '/campaigns/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/campaigns/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/ContactApi.php b/lib/Api/ContactApi.php index dfc9127..4f31d9c 100644 --- a/lib/Api/ContactApi.php +++ b/lib/Api/ContactApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * ContactApi Class Doc Comment @@ -44,47 +50,36 @@ class ContactApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return ContactApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create contact. * - * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createContact($data) @@ -107,27 +104,205 @@ public function createContact($data) * * Create contact. * - * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createContactWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createContactRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createContactAsync + * + * Create contact. + * + * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createContactAsync($data) + { + return $this->createContactAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createContactAsyncWithHttpInfo + * + * Create contact. + * + * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createContactAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createContactRequest($data); + + 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 'createContact' + * + * @param \RadioManager\Model\ContactDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createContactRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createContact'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createContact' + ); } - // parse inputs - $resourcePath = "/contacts"; - $httpBody = ''; + + $resourcePath = '/contacts'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -135,525 +310,1353 @@ public function createContactWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 deleteContactById + * + * Delete contact by id + * + * @param int $id ID of Contact **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteContactById($id) + { + list($response) = $this->deleteContactByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteContactByIdWithHttpInfo + * + * Delete contact by id + * + * @param int $id ID of Contact **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteContactByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteContactByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/contacts' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteContactById + * Operation deleteContactByIdAsync * * Delete contact by id * - * @param int $id ID of Contact **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Contact **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteContactById($id) + public function deleteContactByIdAsync($id) { - list($response) = $this->deleteContactByIdWithHttpInfo($id); - return $response; + return $this->deleteContactByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteContactByIdWithHttpInfo + * Operation deleteContactByIdAsyncWithHttpInfo * * Delete contact by id * - * @param int $id ID of Contact **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Contact **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteContactByIdWithHttpInfo($id) + public function deleteContactByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteContactByIdRequest($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() + ]; + }, + 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 'deleteContactById' + * + * @param int $id ID of Contact **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteContactByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteContactById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteContactById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ContactApi.deleteContactById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/contacts/{id}"; - $httpBody = ''; + + $resourcePath = '/contacts/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 getContactById + * + * Get contact by id + * + * @param int $id ID of Contact **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ContactResult + */ + public function getContactById($id, $_external_station_id = null) + { + list($response) = $this->getContactByIdWithHttpInfo($id, $_external_station_id); + return $response; + } + + /** + * Operation getContactByIdWithHttpInfo + * + * Get contact by id + * + * @param int $id ID of Contact **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ContactResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ContactResult'; + $request = $this->getContactByIdRequest($id, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/contacts/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ContactResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getContactById + * Operation getContactByIdAsync * * Get contact by id * - * @param int $id ID of Contact **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ContactResult + * @param int $id ID of Contact **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getContactById($id, $_external_station_id = null) + public function getContactByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getContactByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->getContactByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getContactByIdWithHttpInfo + * Operation getContactByIdAsyncWithHttpInfo * * Get contact by id * - * @param int $id ID of Contact **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ContactResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Contact **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getContactByIdWithHttpInfo($id, $_external_station_id = null) + public function getContactByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ContactResult'; + $request = $this->getContactByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getContactById' + * + * @param int $id ID of Contact **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getContactByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getContactById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getContactById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ContactApi.getContactById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/contacts/{id}"; - $httpBody = ''; + + $resourcePath = '/contacts/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listContacts + * + * Get all contacts. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ContactResults + */ + public function listContacts($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listContactsWithHttpInfo($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listContactsWithHttpInfo + * + * Get all contacts. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ContactResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listContactsWithHttpInfo($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ContactResults'; + $request = $this->listContactsRequest($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ContactResult', - '/contacts/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ContactResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ContactResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ContactResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listContacts + * Operation listContactsAsync * * Get all contacts. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ContactResults + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listContacts($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listContactsAsync($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listContactsWithHttpInfo($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listContactsAsyncWithHttpInfo($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listContactsWithHttpInfo + * Operation listContactsAsyncWithHttpInfo * * Get all contacts. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ContactResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listContactsWithHttpInfo($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listContactsAsyncWithHttpInfo($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ContactResults'; + $request = $this->listContactsRequest($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listContacts' + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listContactsRequest($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling ContactApi.listContacts, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactApi.listContacts, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactApi.listContacts, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/contacts"; - $httpBody = ''; + + $resourcePath = '/contacts'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($tag_id !== null) { - $queryParams['tag_id'] = $this->apiClient->getSerializer()->toQueryValue($tag_id); + $queryParams['tag_id'] = ObjectSerializer::toQueryValue($tag_id); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updateContactByID + * + * Update contact by id + * + * @param int $id ID of Contact **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateContactByID($id, $data = null) + { + list($response) = $this->updateContactByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateContactByIDWithHttpInfo + * + * Update contact by id + * + * @param int $id ID of Contact **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateContactByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateContactByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ContactResults', - '/contacts' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ContactResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ContactResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateContactByID + * Operation updateContactByIDAsync * * Update contact by id * - * @param int $id ID of Contact **(Required)** (required) - * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Contact **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateContactByID($id, $data = null) + public function updateContactByIDAsync($id, $data = null) { - list($response) = $this->updateContactByIDWithHttpInfo($id, $data); - return $response; + return $this->updateContactByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateContactByIDWithHttpInfo + * Operation updateContactByIDAsyncWithHttpInfo * * Update contact by id * - * @param int $id ID of Contact **(Required)** (required) - * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Contact **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateContactByIDWithHttpInfo($id, $data = null) + public function updateContactByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateContactByIDRequest($id, $data); + + 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 'updateContactByID' + * + * @param int $id ID of Contact **(Required)** (required) + * @param \RadioManager\Model\ContactDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateContactByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateContactByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateContactByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ContactApi.updateContactByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/contacts/{id}"; - $httpBody = ''; + + $resourcePath = '/contacts/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/contacts/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/GenreApi.php b/lib/Api/GenreApi.php index 489cd03..d65f92c 100644 --- a/lib/Api/GenreApi.php +++ b/lib/Api/GenreApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * GenreApi Class Doc Comment @@ -44,47 +50,36 @@ class GenreApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return GenreApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,9 +87,11 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Get genre by id * - * @param int $id ID of Genre **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of Genre **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\GenreResult */ public function getGenreById($id, $_external_station_id = null) @@ -108,235 +105,658 @@ public function getGenreById($id, $_external_station_id = null) * * Get genre by id * - * @param int $id ID of Genre **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of Genre **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\GenreResult, HTTP status code, HTTP response headers (array of strings) */ public function getGenreByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\GenreResult'; + $request = $this->getGenreByIdRequest($id, $_external_station_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\GenreResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGenreByIdAsync + * + * Get genre by id + * + * @param int $id ID of Genre **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGenreByIdAsync($id, $_external_station_id = null) + { + return $this->getGenreByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGenreByIdAsyncWithHttpInfo + * + * Get genre by id + * + * @param int $id ID of Genre **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGenreByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\GenreResult'; + $request = $this->getGenreByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getGenreById' + * + * @param int $id ID of Genre **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getGenreByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getGenreById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getGenreById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling GenreApi.getGenreById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/genres/{id}"; - $httpBody = ''; + + $resourcePath = '/genres/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 listGenres + * + * List all genres. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\GenreResults + */ + public function listGenres($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listGenresWithHttpInfo($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listGenresWithHttpInfo + * + * List all genres. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\GenreResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listGenresWithHttpInfo($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\GenreResults'; + $request = $this->listGenresRequest($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\GenreResult', - '/genres/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\GenreResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\GenreResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\GenreResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listGenres + * Operation listGenresAsync * * List all genres. * - * @param int $page Current page *(Optional)* (optional) - * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\GenreResults + * @param int $page Current page *(Optional)* (optional) + * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listGenres($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listGenresAsync($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listGenresWithHttpInfo($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listGenresAsyncWithHttpInfo($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listGenresWithHttpInfo + * Operation listGenresAsyncWithHttpInfo * * List all genres. * - * @param int $page Current page *(Optional)* (optional) - * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\GenreResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listGenresWithHttpInfo($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listGenresAsyncWithHttpInfo($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\GenreResults'; + $request = $this->listGenresRequest($page, $parent_id, $program_id, $broadcast_id, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listGenres' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $parent_id Search on Parent ID of Genre *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listGenresRequest($page = null, $parent_id = null, $program_id = null, $broadcast_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling GenreApi.listGenres, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling GenreApi.listGenres, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling GenreApi.listGenres, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/genres"; - $httpBody = ''; + + $resourcePath = '/genres'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($parent_id !== null) { - $queryParams['parent_id'] = $this->apiClient->getSerializer()->toQueryValue($parent_id); + $queryParams['parent_id'] = ObjectSerializer::toQueryValue($parent_id); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\GenreResults', - '/genres' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\GenreResults', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\GenreResults', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $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/ItemApi.php b/lib/Api/ItemApi.php index 916f50f..a3bd2a7 100644 --- a/lib/Api/ItemApi.php +++ b/lib/Api/ItemApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * ItemApi Class Doc Comment @@ -44,47 +50,36 @@ class ItemApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return ItemApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create an new item. * - * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createItem($data = null) @@ -107,111 +104,183 @@ public function createItem($data = null) * * Create an new item. * - * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createItemWithHttpInfo($data = null) { - // parse inputs - $resourcePath = "/items"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - - // body params - $_tempBody = null; - if (isset($data)) { - $_tempBody = $data; - } + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createItemRequest($data); - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/items' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation currentItemPostStructure + * Operation createItemAsync * - * Post a current playing item, keep structure + * Create an new item. * - * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function currentItemPostStructure($data = null) + public function createItemAsync($data = null) { - list($response) = $this->currentItemPostStructureWithHttpInfo($data); - return $response; + return $this->createItemAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation currentItemPostStructureWithHttpInfo + * Operation createItemAsyncWithHttpInfo * - * Post a current playing item, keep structure + * Create an new item. * - * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function currentItemPostStructureWithHttpInfo($data = null) + public function createItemAsyncWithHttpInfo($data = null) { - // parse inputs - $resourcePath = "/items/current/structure"; - $httpBody = ''; + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createItemRequest($data); + + 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 'createItem' + * + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createItemRequest($data = null) + { + + $resourcePath = '/items'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -219,344 +288,1210 @@ public function currentItemPostStructureWithHttpInfo($data = null) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/items/current/structure' - ); - - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; + $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 currentItemPostTiming + * Operation currentItemPostStructure * - * Post a current playing item + * Post a current playing item, keep structure + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) * - * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\Success */ - public function currentItemPostTiming($data = null) + public function currentItemPostStructure($data = null) { - list($response) = $this->currentItemPostTimingWithHttpInfo($data); + list($response) = $this->currentItemPostStructureWithHttpInfo($data); return $response; } /** - * Operation currentItemPostTimingWithHttpInfo + * Operation currentItemPostStructureWithHttpInfo * - * Post a current playing item + * Post a current playing item, keep structure + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) * - * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) */ - public function currentItemPostTimingWithHttpInfo($data = null) + public function currentItemPostStructureWithHttpInfo($data = null) { - // parse inputs - $resourcePath = "/items/current/timing"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $returnType = '\RadioManager\Model\Success'; + $request = $this->currentItemPostStructureRequest($data); - // body params - $_tempBody = null; - if (isset($data)) { - $_tempBody = $data; - } - - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/items/current/timing' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteItemById + * Operation currentItemPostStructureAsync * - * Delete item by ID. + * Post a current playing item, keep structure * - * @param int $id ID of Item **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteItemById($id) + public function currentItemPostStructureAsync($data = null) { - list($response) = $this->deleteItemByIdWithHttpInfo($id); - return $response; + return $this->currentItemPostStructureAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteItemByIdWithHttpInfo + * Operation currentItemPostStructureAsyncWithHttpInfo * - * Delete item by ID. + * Post a current playing item, keep structure * - * @param int $id ID of Item **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteItemByIdWithHttpInfo($id) + public function currentItemPostStructureAsyncWithHttpInfo($data = null) { - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteItemById'); - } - if (($id < 0)) { - throw new \InvalidArgumentException('invalid value for "$id" when calling ItemApi.deleteItemById, must be bigger than or equal to 0.'); - } + $returnType = '\RadioManager\Model\Success'; + $request = $this->currentItemPostStructureRequest($data); + + 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() + ); + } + ); + } - // parse inputs - $resourcePath = "/items/{id}"; - $httpBody = ''; + /** + * Create request for operation 'currentItemPostStructure' + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function currentItemPostStructureRequest($data = null) + { + + $resourcePath = '/items/current/structure'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($data)) { + $_tempBody = $data; } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - // path params - if ($id !== null) { - $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), - $resourcePath + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/items/{id}' - ); - - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 202: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; + $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 getCurrentItem + * Operation currentItemPostTiming * - * Get current Item + * Post a current playing item + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) * - * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ItemResult + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success */ - public function getCurrentItem($lastplayed = null) + public function currentItemPostTiming($data = null) { - list($response) = $this->getCurrentItemWithHttpInfo($lastplayed); + list($response) = $this->currentItemPostTimingWithHttpInfo($data); return $response; } /** - * Operation getCurrentItemWithHttpInfo + * Operation currentItemPostTimingWithHttpInfo * - * Get current Item + * Post a current playing item + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) * - * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ItemResult, HTTP status code, HTTP response headers (array of strings) + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) */ - public function getCurrentItemWithHttpInfo($lastplayed = null) + public function currentItemPostTimingWithHttpInfo($data = null) { - // parse inputs - $resourcePath = "/items/current"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $returnType = '\RadioManager\Model\Success'; + $request = $this->currentItemPostTimingRequest($data); - // query params - if ($lastplayed !== null) { - $queryParams['lastplayed'] = $this->apiClient->getSerializer()->toQueryValue($lastplayed); - } - - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ItemResult', - '/items/current' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ItemResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ItemResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 202: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } + /** + * Operation currentItemPostTimingAsync + * + * Post a current playing item + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function currentItemPostTimingAsync($data = null) + { + return $this->currentItemPostTimingAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation currentItemPostTimingAsyncWithHttpInfo + * + * Post a current playing item + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function currentItemPostTimingAsyncWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->currentItemPostTimingRequest($data); + + 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 'currentItemPostTiming' + * + * @param \RadioManager\Model\ImportItem $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function currentItemPostTimingRequest($data = null) + { + + $resourcePath = '/items/current/timing'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($data)) { + $_tempBody = $data; + } + + 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 deleteItemById + * + * Delete item by ID. + * + * @param int $id ID of Item **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteItemById($id) + { + list($response) = $this->deleteItemByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteItemByIdWithHttpInfo + * + * Delete item by ID. + * + * @param int $id ID of Item **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteItemByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteItemByIdRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteItemByIdAsync + * + * Delete item by ID. + * + * @param int $id ID of Item **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteItemByIdAsync($id) + { + return $this->deleteItemByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteItemByIdAsyncWithHttpInfo + * + * Delete item by ID. + * + * @param int $id ID of Item **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteItemByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteItemByIdRequest($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() + ]; + }, + 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 'deleteItemById' + * + * @param int $id ID of Item **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteItemByIdRequest($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteItemById' + ); + } + if ($id < 0) { + throw new \InvalidArgumentException('invalid value for "$id" when calling ItemApi.deleteItemById, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/items/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 getCurrentItem + * + * Get current Item + * + * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ItemResult + */ + public function getCurrentItem($lastplayed = null) + { + list($response) = $this->getCurrentItemWithHttpInfo($lastplayed); + return $response; + } + + /** + * Operation getCurrentItemWithHttpInfo + * + * Get current Item + * + * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ItemResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getCurrentItemWithHttpInfo($lastplayed = null) + { + $returnType = '\RadioManager\Model\ItemResult'; + $request = $this->getCurrentItemRequest($lastplayed); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ItemResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCurrentItemAsync + * + * Get current Item + * + * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCurrentItemAsync($lastplayed = null) + { + return $this->getCurrentItemAsyncWithHttpInfo($lastplayed) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCurrentItemAsyncWithHttpInfo + * + * Get current Item + * + * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCurrentItemAsyncWithHttpInfo($lastplayed = null) + { + $returnType = '\RadioManager\Model\ItemResult'; + $request = $this->getCurrentItemRequest($lastplayed); + + 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 'getCurrentItem' + * + * @param bool $lastplayed Show last played item if there is no current item*(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCurrentItemRequest($lastplayed = null) + { + + $resourcePath = '/items/current'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($lastplayed !== null) { + $queryParams['lastplayed'] = ObjectSerializer::toQueryValue($lastplayed); + } + + + // 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 getItemById * * Get extended item details by ID. * - * @param int $id ID of Item **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of Item **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\ItemResult */ public function getItemById($id, $_external_station_id = null) @@ -570,357 +1505,1510 @@ public function getItemById($id, $_external_station_id = null) * * Get extended item details by ID. * - * @param int $id ID of Item **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of Item **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\ItemResult, HTTP status code, HTTP response headers (array of strings) */ public function getItemByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ItemResult'; + $request = $this->getItemByIdRequest($id, $_external_station_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ItemResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getItemByIdAsync + * + * Get extended item details by ID. + * + * @param int $id ID of Item **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getItemByIdAsync($id, $_external_station_id = null) + { + return $this->getItemByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getItemByIdAsyncWithHttpInfo + * + * Get extended item details by ID. + * + * @param int $id ID of Item **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getItemByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ItemResult'; + $request = $this->getItemByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getItemById' + * + * @param int $id ID of Item **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getItemByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getItemById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getItemById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ItemApi.getItemById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/items/{id}"; - $httpBody = ''; + + $resourcePath = '/items/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listItems + * + * Get a list of all the items currently in your station. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) + * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) + * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param string $external_id Search on External ID *(Optional)* (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) + * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) + * @param string $status Play Status of item *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ItemResults + */ + public function listItems($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listItemsWithHttpInfo($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listItemsWithHttpInfo + * + * Get a list of all the items currently in your station. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) + * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) + * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param string $external_id Search on External ID *(Optional)* (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) + * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) + * @param string $status Play Status of item *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ItemResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listItemsWithHttpInfo($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ItemResults'; + $request = $this->listItemsRequest($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ItemResult', - '/items/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ItemResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ItemResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ItemResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listItems + * Operation listItemsAsync * * Get a list of all the items currently in your station. * - * @param int $page Current page *(Optional)* (optional) - * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) - * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) - * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) - * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) - * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param string $external_id Search on External ID *(Optional)* (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) - * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) - * @param string $status Play Status of item *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ItemResults + * @param int $page Current page *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) + * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) + * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param string $external_id Search on External ID *(Optional)* (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) + * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) + * @param string $status Play Status of item *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listItems($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listItemsAsync($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listItemsWithHttpInfo($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listItemsAsyncWithHttpInfo($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listItemsWithHttpInfo + * Operation listItemsAsyncWithHttpInfo * * Get a list of all the items currently in your station. * - * @param int $page Current page *(Optional)* (optional) - * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) - * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) - * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) - * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) - * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param string $external_id Search on External ID *(Optional)* (optional) - * @param \DateTime $start_min Minimum start date *(Optional)* (optional) - * @param \DateTime $start_max Maximum start date *(Optional)* (optional) - * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) - * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) - * @param string $status Play Status of item *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ItemResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) + * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) + * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param string $external_id Search on External ID *(Optional)* (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) + * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) + * @param string $status Play Status of item *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listItemsWithHttpInfo($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listItemsAsyncWithHttpInfo($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ItemResults'; + $request = $this->listItemsRequest($page, $block_id, $broadcast_id, $model_type_id, $tag_id, $campaign_id, $contact_id, $program_draft_id, $user_draft_id, $station_draft_id, $program_id, $external_id, $start_min, $start_max, $duration_min, $duration_max, $status, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listItems' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $program_draft_id Search on Program Draft ID *(Optional)* (optional) + * @param int $user_draft_id Search on User Draft ID *(Optional)* (optional) + * @param int $station_draft_id Search on Station Draft ID *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param string $external_id Search on External ID *(Optional)* (optional) + * @param \DateTime $start_min Minimum start date *(Optional)* (optional) + * @param \DateTime $start_max Maximum start date *(Optional)* (optional) + * @param int $duration_min Minimum duration (seconds) *(Optional)* (optional) + * @param int $duration_max Maximum duration (seconds) *(Optional)* (optional) + * @param string $status Play Status of item *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listItemsRequest($page = null, $block_id = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $campaign_id = null, $contact_id = null, $program_draft_id = null, $user_draft_id = null, $station_draft_id = null, $program_id = null, $external_id = null, $start_min = null, $start_max = null, $duration_min = null, $duration_max = null, $status = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 1)) { + if ($page !== null && $page < 1) { throw new \InvalidArgumentException('invalid value for "$page" when calling ItemApi.listItems, must be bigger than or equal to 1.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ItemApi.listItems, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ItemApi.listItems, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/items"; - $httpBody = ''; + + $resourcePath = '/items'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($block_id !== null) { - $queryParams['block_id'] = $this->apiClient->getSerializer()->toQueryValue($block_id); + $queryParams['block_id'] = ObjectSerializer::toQueryValue($block_id); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($tag_id !== null) { - $queryParams['tag_id'] = $this->apiClient->getSerializer()->toQueryValue($tag_id); + $queryParams['tag_id'] = ObjectSerializer::toQueryValue($tag_id); } // query params if ($campaign_id !== null) { - $queryParams['campaign_id'] = $this->apiClient->getSerializer()->toQueryValue($campaign_id); + $queryParams['campaign_id'] = ObjectSerializer::toQueryValue($campaign_id); } // query params if ($contact_id !== null) { - $queryParams['contact_id'] = $this->apiClient->getSerializer()->toQueryValue($contact_id); + $queryParams['contact_id'] = ObjectSerializer::toQueryValue($contact_id); } // query params if ($program_draft_id !== null) { - $queryParams['program_draft_id'] = $this->apiClient->getSerializer()->toQueryValue($program_draft_id); + $queryParams['program_draft_id'] = ObjectSerializer::toQueryValue($program_draft_id); } // query params if ($user_draft_id !== null) { - $queryParams['user_draft_id'] = $this->apiClient->getSerializer()->toQueryValue($user_draft_id); + $queryParams['user_draft_id'] = ObjectSerializer::toQueryValue($user_draft_id); } // query params if ($station_draft_id !== null) { - $queryParams['station_draft_id'] = $this->apiClient->getSerializer()->toQueryValue($station_draft_id); + $queryParams['station_draft_id'] = ObjectSerializer::toQueryValue($station_draft_id); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($external_id !== null) { - $queryParams['external_id'] = $this->apiClient->getSerializer()->toQueryValue($external_id); + $queryParams['external_id'] = ObjectSerializer::toQueryValue($external_id); } // query params if ($start_min !== null) { - $queryParams['start-min'] = $this->apiClient->getSerializer()->toQueryValue($start_min); + $queryParams['start-min'] = ObjectSerializer::toQueryValue($start_min); } // query params if ($start_max !== null) { - $queryParams['start-max'] = $this->apiClient->getSerializer()->toQueryValue($start_max); + $queryParams['start-max'] = ObjectSerializer::toQueryValue($start_max); } // query params if ($duration_min !== null) { - $queryParams['duration-min'] = $this->apiClient->getSerializer()->toQueryValue($duration_min); + $queryParams['duration-min'] = ObjectSerializer::toQueryValue($duration_min); } // query params if ($duration_max !== null) { - $queryParams['duration-max'] = $this->apiClient->getSerializer()->toQueryValue($duration_max); + $queryParams['duration-max'] = ObjectSerializer::toQueryValue($duration_max); } // query params if ($status !== null) { - $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); + $queryParams['status'] = ObjectSerializer::toQueryValue($status); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 playlistPostMerge + * + * Post a playlist, do not remove previously imported items + * + * @param \RadioManager\Model\Data2 $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\InlineResponse202 + */ + public function playlistPostMerge($data = null) + { + list($response) = $this->playlistPostMergeWithHttpInfo($data); + return $response; + } + + /** + * Operation playlistPostMergeWithHttpInfo + * + * Post a playlist, do not remove previously imported items + * + * @param \RadioManager\Model\Data2 $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\InlineResponse202, HTTP status code, HTTP response headers (array of strings) + */ + public function playlistPostMergeWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\InlineResponse202'; + $request = $this->playlistPostMergeRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\InlineResponse202', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation playlistPostMergeAsync + * + * Post a playlist, do not remove previously imported items + * + * @param \RadioManager\Model\Data2 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function playlistPostMergeAsync($data = null) + { + return $this->playlistPostMergeAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation playlistPostMergeAsyncWithHttpInfo + * + * Post a playlist, do not remove previously imported items + * + * @param \RadioManager\Model\Data2 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function playlistPostMergeAsyncWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\InlineResponse202'; + $request = $this->playlistPostMergeRequest($data); + + 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 'playlistPostMerge' + * + * @param \RadioManager\Model\Data2 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function playlistPostMergeRequest($data = null) + { + + $resourcePath = '/items/playlist/merge'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($data)) { + $_tempBody = $data; + } + + 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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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 playlistPostStructure + * + * Post a playlist, keep current structure + * + * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\InlineResponse202 + */ + public function playlistPostStructure($data = null) + { + list($response) = $this->playlistPostStructureWithHttpInfo($data); + return $response; + } + + /** + * Operation playlistPostStructureWithHttpInfo + * + * Post a playlist, keep current structure + * + * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\InlineResponse202, HTTP status code, HTTP response headers (array of strings) + */ + public function playlistPostStructureWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\InlineResponse202'; + $request = $this->playlistPostStructureRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\InlineResponse202', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation playlistPostStructureAsync + * + * Post a playlist, keep current structure + * + * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function playlistPostStructureAsync($data = null) + { + return $this->playlistPostStructureAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation playlistPostStructureAsyncWithHttpInfo + * + * Post a playlist, keep current structure + * + * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function playlistPostStructureAsyncWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\InlineResponse202'; + $request = $this->playlistPostStructureRequest($data); + + 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 'playlistPostStructure' + * + * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function playlistPostStructureRequest($data = null) + { + + $resourcePath = '/items/playlist/structure'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($data)) { + $_tempBody = $data; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); } // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 playlistPostTiming + * + * Post a playlist + * + * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\InlineResponse202 + */ + public function playlistPostTiming($data = null) + { + list($response) = $this->playlistPostTimingWithHttpInfo($data); + return $response; + } + + /** + * Operation playlistPostTimingWithHttpInfo + * + * Post a playlist + * + * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\InlineResponse202, HTTP status code, HTTP response headers (array of strings) + */ + public function playlistPostTimingWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\InlineResponse202'; + $request = $this->playlistPostTimingRequest($data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ItemResults', - '/items' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ItemResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ItemResults', $e->getResponseHeaders()); + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\InlineResponse202', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation playlistPostStructure + * Operation playlistPostTimingAsync * - * Post a playlist, keep current structure + * Post a playlist * - * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\InlineResponse202 + * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function playlistPostStructure($data = null) + public function playlistPostTimingAsync($data = null) { - list($response) = $this->playlistPostStructureWithHttpInfo($data); - return $response; + return $this->playlistPostTimingAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation playlistPostStructureWithHttpInfo + * Operation playlistPostTimingAsyncWithHttpInfo * - * Post a playlist, keep current structure + * Post a playlist * - * @param \RadioManager\Model\Data1 $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\InlineResponse202, HTTP status code, HTTP response headers (array of strings) + * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function playlistPostStructureWithHttpInfo($data = null) + public function playlistPostTimingAsyncWithHttpInfo($data = null) { - // parse inputs - $resourcePath = "/items/playlist/structure"; - $httpBody = ''; + $returnType = '\RadioManager\Model\InlineResponse202'; + $request = $this->playlistPostTimingRequest($data); + + 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 'playlistPostTiming' + * + * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function playlistPostTimingRequest($data = null) + { + + $resourcePath = '/items/playlist/timing'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -928,87 +3016,287 @@ public function playlistPostStructureWithHttpInfo($data = null) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 stopCurrentItem + * + * Stop an Item + * + * @param \RadioManager\Model\Data3 $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function stopCurrentItem($data = null) + { + list($response) = $this->stopCurrentItemWithHttpInfo($data); + return $response; + } + + /** + * Operation stopCurrentItemWithHttpInfo + * + * Stop an Item + * + * @param \RadioManager\Model\Data3 $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function stopCurrentItemWithHttpInfo($data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->stopCurrentItemRequest($data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\InlineResponse202', - '/items/playlist/structure' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\InlineResponse202', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { - case 202: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\InlineResponse202', $e->getResponseHeaders()); + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation playlistPostTiming + * Operation stopCurrentItemAsync * - * Post a playlist + * Stop an Item * - * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\InlineResponse202 + * @param \RadioManager\Model\Data3 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function playlistPostTiming($data = null) + public function stopCurrentItemAsync($data = null) { - list($response) = $this->playlistPostTimingWithHttpInfo($data); - return $response; + return $this->stopCurrentItemAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation playlistPostTimingWithHttpInfo + * Operation stopCurrentItemAsyncWithHttpInfo * - * Post a playlist + * Stop an Item * - * @param \RadioManager\Model\Data $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\InlineResponse202, HTTP status code, HTTP response headers (array of strings) + * @param \RadioManager\Model\Data3 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function playlistPostTimingWithHttpInfo($data = null) + public function stopCurrentItemAsyncWithHttpInfo($data = null) { - // parse inputs - $resourcePath = "/items/playlist/timing"; - $httpBody = ''; + $returnType = '\RadioManager\Model\Success'; + $request = $this->stopCurrentItemRequest($data); + + 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 'stopCurrentItem' + * + * @param \RadioManager\Model\Data3 $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function stopCurrentItemRequest($data = null) + { + + $resourcePath = '/items/stopcurrent'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -1016,161 +3304,399 @@ public function playlistPostTimingWithHttpInfo($data = null) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updateItemById + * + * Update extended item details by ID. + * + * @param int $id ID of Item **(Required)** (required) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateItemById($id, $data = null) + { + list($response) = $this->updateItemByIdWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateItemByIdWithHttpInfo + * + * Update extended item details by ID. + * + * @param int $id ID of Item **(Required)** (required) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateItemByIdWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateItemByIdRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\InlineResponse202', - '/items/playlist/timing' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\InlineResponse202', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { - case 202: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\InlineResponse202', $e->getResponseHeaders()); + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateItemById + * Operation updateItemByIdAsync * * Update extended item details by ID. * - * @param int $id ID of Item **(Required)** (required) - * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Item **(Required)** (required) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateItemById($id, $data = null) + public function updateItemByIdAsync($id, $data = null) { - list($response) = $this->updateItemByIdWithHttpInfo($id, $data); - return $response; + return $this->updateItemByIdAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateItemByIdWithHttpInfo + * Operation updateItemByIdAsyncWithHttpInfo * * Update extended item details by ID. * - * @param int $id ID of Item **(Required)** (required) - * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Item **(Required)** (required) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateItemByIdWithHttpInfo($id, $data = null) + public function updateItemByIdAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateItemByIdRequest($id, $data); + + 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 'updateItemById' + * + * @param int $id ID of Item **(Required)** (required) + * @param \RadioManager\Model\ItemDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateItemByIdRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateItemById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateItemById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ItemApi.updateItemById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/items/{id}"; - $httpBody = ''; + + $resourcePath = '/items/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/items/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/ModelTypeApi.php b/lib/Api/ModelTypeApi.php index 50214ad..556ea07 100644 --- a/lib/Api/ModelTypeApi.php +++ b/lib/Api/ModelTypeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * ModelTypeApi Class Doc Comment @@ -44,47 +50,36 @@ class ModelTypeApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return ModelTypeApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,9 +87,11 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Get modelType by id * - * @param int $id ID of ModelType **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of ModelType **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\ModelTypeResult */ public function getModelTypeById($id, $_external_station_id = null) @@ -108,259 +105,694 @@ public function getModelTypeById($id, $_external_station_id = null) * * Get modelType by id * - * @param int $id ID of ModelType **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * @param int $id ID of ModelType **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\ModelTypeResult, HTTP status code, HTTP response headers (array of strings) */ public function getModelTypeByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ModelTypeResult'; + $request = $this->getModelTypeByIdRequest($id, $_external_station_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ModelTypeResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getModelTypeByIdAsync + * + * Get modelType by id + * + * @param int $id ID of ModelType **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getModelTypeByIdAsync($id, $_external_station_id = null) + { + return $this->getModelTypeByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getModelTypeByIdAsyncWithHttpInfo + * + * Get modelType by id + * + * @param int $id ID of ModelType **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getModelTypeByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ModelTypeResult'; + $request = $this->getModelTypeByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getModelTypeById' + * + * @param int $id ID of ModelType **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getModelTypeByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getModelTypeById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getModelTypeById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ModelTypeApi.getModelTypeById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/model_types/{id}"; - $httpBody = ''; + + $resourcePath = '/model_types/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 listModelTypes + * + * Get all modelTypes. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) + * @param int $contact_id Search on Contact ID *(Optional)* (optional) + * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ModelTypeResults + */ + public function listModelTypes($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listModelTypesWithHttpInfo($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listModelTypesWithHttpInfo + * + * Get all modelTypes. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) + * @param int $contact_id Search on Contact ID *(Optional)* (optional) + * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ModelTypeResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listModelTypesWithHttpInfo($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ModelTypeResults'; + $request = $this->listModelTypesRequest($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ModelTypeResult', - '/model_types/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ModelTypeResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ModelTypeResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ModelTypeResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listModelTypes + * Operation listModelTypesAsync * * Get all modelTypes. * - * @param int $page Current page *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) - * @param int $item_id Search on Item ID *(Optional)* (optional) - * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) - * @param int $contact_id Search on Contact ID *(Optional)* (optional) - * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ModelTypeResults + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) + * @param int $contact_id Search on Contact ID *(Optional)* (optional) + * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listModelTypes($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listModelTypesAsync($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listModelTypesWithHttpInfo($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listModelTypesAsyncWithHttpInfo($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listModelTypesWithHttpInfo + * Operation listModelTypesAsyncWithHttpInfo * * Get all modelTypes. * - * @param int $page Current page *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) - * @param int $item_id Search on Item ID *(Optional)* (optional) - * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) - * @param int $contact_id Search on Contact ID *(Optional)* (optional) - * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ModelTypeResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) + * @param int $contact_id Search on Contact ID *(Optional)* (optional) + * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listModelTypesWithHttpInfo($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listModelTypesAsyncWithHttpInfo($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ModelTypeResults'; + $request = $this->listModelTypesRequest($page, $program_id, $broadcast_id, $item_id, $campaign_id, $presenter_id, $contact_id, $model, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listModelTypes' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* (optional) + * @param int $item_id Search on Item ID *(Optional)* (optional) + * @param int $campaign_id Search on Campaign ID *(Optional)* (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* (optional) + * @param int $contact_id Search on Contact ID *(Optional)* (optional) + * @param string $model Search Modeltypes for certain Model *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listModelTypesRequest($page = null, $program_id = null, $broadcast_id = null, $item_id = null, $campaign_id = null, $presenter_id = null, $contact_id = null, $model = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling ModelTypeApi.listModelTypes, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ModelTypeApi.listModelTypes, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ModelTypeApi.listModelTypes, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/model_types"; - $httpBody = ''; + + $resourcePath = '/model_types'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($campaign_id !== null) { - $queryParams['campaign_id'] = $this->apiClient->getSerializer()->toQueryValue($campaign_id); + $queryParams['campaign_id'] = ObjectSerializer::toQueryValue($campaign_id); } // query params if ($presenter_id !== null) { - $queryParams['presenter_id'] = $this->apiClient->getSerializer()->toQueryValue($presenter_id); + $queryParams['presenter_id'] = ObjectSerializer::toQueryValue($presenter_id); } // query params if ($contact_id !== null) { - $queryParams['contact_id'] = $this->apiClient->getSerializer()->toQueryValue($contact_id); + $queryParams['contact_id'] = ObjectSerializer::toQueryValue($contact_id); } // query params if ($model !== null) { - $queryParams['model'] = $this->apiClient->getSerializer()->toQueryValue($model); + $queryParams['model'] = ObjectSerializer::toQueryValue($model); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ModelTypeResults', - '/model_types' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ModelTypeResults', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ModelTypeResults', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $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/PresenterApi.php b/lib/Api/PresenterApi.php index 08712f0..60a44e4 100644 --- a/lib/Api/PresenterApi.php +++ b/lib/Api/PresenterApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * PresenterApi Class Doc Comment @@ -44,47 +50,36 @@ class PresenterApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return PresenterApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create presenter. * - * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createPresenter($data) @@ -107,27 +104,205 @@ public function createPresenter($data) * * Create presenter. * - * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createPresenterWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createPresenterRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPresenterAsync + * + * Create presenter. + * + * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createPresenterAsync($data) + { + return $this->createPresenterAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPresenterAsyncWithHttpInfo + * + * Create presenter. + * + * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createPresenterAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createPresenterRequest($data); + + 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 'createPresenter' + * + * @param \RadioManager\Model\PresenterDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createPresenterRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createPresenter'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createPresenter' + ); } - // parse inputs - $resourcePath = "/presenters"; - $httpBody = ''; + + $resourcePath = '/presenters'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -135,525 +310,1353 @@ public function createPresenterWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 deletePresenterById + * + * Delete presenter by id + * + * @param int $id id of presenter (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deletePresenterById($id) + { + list($response) = $this->deletePresenterByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deletePresenterByIdWithHttpInfo + * + * Delete presenter by id + * + * @param int $id id of presenter (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePresenterByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deletePresenterByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/presenters' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deletePresenterById + * Operation deletePresenterByIdAsync * * Delete presenter by id * - * @param int $id id of presenter (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id id of presenter (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePresenterById($id) + public function deletePresenterByIdAsync($id) { - list($response) = $this->deletePresenterByIdWithHttpInfo($id); - return $response; + return $this->deletePresenterByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deletePresenterByIdWithHttpInfo + * Operation deletePresenterByIdAsyncWithHttpInfo * * Delete presenter by id * - * @param int $id id of presenter (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id id of presenter (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePresenterByIdWithHttpInfo($id) + public function deletePresenterByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deletePresenterByIdRequest($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() + ]; + }, + 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 'deletePresenterById' + * + * @param int $id id of presenter (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deletePresenterByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deletePresenterById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePresenterById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling PresenterApi.deletePresenterById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/presenters/{id}"; - $httpBody = ''; + + $resourcePath = '/presenters/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 getPresenterById + * + * Get presenter by id + * + * @param int $id id of Presenter (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\PresenterResult + */ + public function getPresenterById($id, $_external_station_id = null) + { + list($response) = $this->getPresenterByIdWithHttpInfo($id, $_external_station_id); + return $response; + } + + /** + * Operation getPresenterByIdWithHttpInfo + * + * Get presenter by id + * + * @param int $id id of Presenter (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\PresenterResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getPresenterByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\PresenterResult'; + $request = $this->getPresenterByIdRequest($id, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/presenters/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PresenterResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getPresenterById + * Operation getPresenterByIdAsync * * Get presenter by id * - * @param int $id id of Presenter (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\PresenterResult + * @param int $id id of Presenter (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPresenterById($id, $_external_station_id = null) + public function getPresenterByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getPresenterByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->getPresenterByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getPresenterByIdWithHttpInfo + * Operation getPresenterByIdAsyncWithHttpInfo * * Get presenter by id * - * @param int $id id of Presenter (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\PresenterResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id id of Presenter (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPresenterByIdWithHttpInfo($id, $_external_station_id = null) + public function getPresenterByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\PresenterResult'; + $request = $this->getPresenterByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getPresenterById' + * + * @param int $id id of Presenter (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getPresenterByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getPresenterById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPresenterById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling PresenterApi.getPresenterById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/presenters/{id}"; - $httpBody = ''; + + $resourcePath = '/presenters/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listPresenters + * + * Get all presenters. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID (Optional) (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\PresenterResults + */ + public function listPresenters($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listPresentersWithHttpInfo($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listPresentersWithHttpInfo + * + * Get all presenters. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID (Optional) (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\PresenterResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listPresentersWithHttpInfo($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\PresenterResults'; + $request = $this->listPresentersRequest($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PresenterResult', - '/presenters/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PresenterResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PresenterResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PresenterResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listPresenters + * Operation listPresentersAsync * * Get all presenters. * - * @param int $page Current page *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID (Optional) (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\PresenterResults + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID (Optional) (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listPresenters($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listPresentersAsync($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listPresentersWithHttpInfo($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listPresentersAsyncWithHttpInfo($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listPresentersWithHttpInfo + * Operation listPresentersAsyncWithHttpInfo * * Get all presenters. * - * @param int $page Current page *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID (Optional) (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\PresenterResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID (Optional) (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listPresentersWithHttpInfo($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listPresentersAsyncWithHttpInfo($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\PresenterResults'; + $request = $this->listPresentersRequest($page, $program_id, $broadcast_id, $model_type_id, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listPresenters' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID (Optional) (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listPresentersRequest($page = null, $program_id = null, $broadcast_id = null, $model_type_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling PresenterApi.listPresenters, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling PresenterApi.listPresenters, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling PresenterApi.listPresenters, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/presenters"; - $httpBody = ''; + + $resourcePath = '/presenters'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updatePresenterByID + * + * Update presenter by id + * + * @param int $id id of Presenter (required) + * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updatePresenterByID($id, $data = null) + { + list($response) = $this->updatePresenterByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updatePresenterByIDWithHttpInfo + * + * Update presenter by id + * + * @param int $id id of Presenter (required) + * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePresenterByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updatePresenterByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PresenterResults', - '/presenters' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PresenterResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PresenterResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updatePresenterByID + * Operation updatePresenterByIDAsync * * Update presenter by id * - * @param int $id id of Presenter (required) - * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id id of Presenter (required) + * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePresenterByID($id, $data = null) + public function updatePresenterByIDAsync($id, $data = null) { - list($response) = $this->updatePresenterByIDWithHttpInfo($id, $data); - return $response; + return $this->updatePresenterByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updatePresenterByIDWithHttpInfo + * Operation updatePresenterByIDAsyncWithHttpInfo * * Update presenter by id * - * @param int $id id of Presenter (required) - * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id id of Presenter (required) + * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePresenterByIDWithHttpInfo($id, $data = null) + public function updatePresenterByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updatePresenterByIDRequest($id, $data); + + 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 'updatePresenterByID' + * + * @param int $id id of Presenter (required) + * @param \RadioManager\Model\PresenterDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updatePresenterByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updatePresenterByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updatePresenterByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling PresenterApi.updatePresenterByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/presenters/{id}"; - $httpBody = ''; + + $resourcePath = '/presenters/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/presenters/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/ProgramApi.php b/lib/Api/ProgramApi.php index abf4add..5cb0ab8 100644 --- a/lib/Api/ProgramApi.php +++ b/lib/Api/ProgramApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * ProgramApi Class Doc Comment @@ -44,47 +50,36 @@ class ProgramApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return ProgramApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create program. * - * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createProgram($data) @@ -107,27 +104,205 @@ public function createProgram($data) * * Create program. * - * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createProgramWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createProgramRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createProgramAsync + * + * Create program. + * + * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createProgramAsync($data) + { + return $this->createProgramAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createProgramAsyncWithHttpInfo + * + * Create program. + * + * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createProgramAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createProgramRequest($data); + + 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 'createProgram' + * + * @param \RadioManager\Model\ProgramDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createProgramRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createProgram'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createProgram' + ); } - // parse inputs - $resourcePath = "/programs"; - $httpBody = ''; + + $resourcePath = '/programs'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -135,549 +310,1405 @@ public function createProgramWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 deleteProgramById + * + * Delete program by id + * + * @param int $id ID of program **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteProgramById($id) + { + list($response) = $this->deleteProgramByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteProgramByIdWithHttpInfo + * + * Delete program by id + * + * @param int $id ID of program **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteProgramByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteProgramByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/programs' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteProgramById + * Operation deleteProgramByIdAsync * * Delete program by id * - * @param int $id ID of program **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of program **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteProgramById($id) + public function deleteProgramByIdAsync($id) { - list($response) = $this->deleteProgramByIdWithHttpInfo($id); - return $response; + return $this->deleteProgramByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteProgramByIdWithHttpInfo + * Operation deleteProgramByIdAsyncWithHttpInfo * * Delete program by id * - * @param int $id ID of program **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of program **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteProgramByIdWithHttpInfo($id) + public function deleteProgramByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteProgramByIdRequest($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() + ]; + }, + 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 'deleteProgramById' + * + * @param int $id ID of program **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteProgramByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteProgramById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteProgramById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ProgramApi.deleteProgramById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/programs/{id}"; - $httpBody = ''; + + $resourcePath = '/programs/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 getProgramById + * + * Get program by id + * + * @param int $id ID of Program **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ProgramResult + */ + public function getProgramById($id, $_external_station_id = null) + { + list($response) = $this->getProgramByIdWithHttpInfo($id, $_external_station_id); + return $response; + } + + /** + * Operation getProgramByIdWithHttpInfo + * + * Get program by id + * + * @param int $id ID of Program **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ProgramResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getProgramByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ProgramResult'; + $request = $this->getProgramByIdRequest($id, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/programs/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ProgramResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getProgramById + * Operation getProgramByIdAsync * * Get program by id * - * @param int $id ID of Program **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ProgramResult + * @param int $id ID of Program **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProgramById($id, $_external_station_id = null) + public function getProgramByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getProgramByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->getProgramByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getProgramByIdWithHttpInfo + * Operation getProgramByIdAsyncWithHttpInfo * * Get program by id * - * @param int $id ID of Program **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ProgramResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Program **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProgramByIdWithHttpInfo($id, $_external_station_id = null) + public function getProgramByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ProgramResult'; + $request = $this->getProgramByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getProgramById' + * + * @param int $id ID of Program **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getProgramByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getProgramById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProgramById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ProgramApi.getProgramById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/programs/{id}"; - $httpBody = ''; + + $resourcePath = '/programs/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listPrograms + * + * Get all programs. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $disabled Search on Disabled status *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\ProgramResults + */ + public function listPrograms($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $disabled = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listProgramsWithHttpInfo($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $disabled, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listProgramsWithHttpInfo + * + * Get all programs. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $disabled Search on Disabled status *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\ProgramResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listProgramsWithHttpInfo($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $disabled = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ProgramResults'; + $request = $this->listProgramsRequest($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $disabled, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ProgramResult', - '/programs/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ProgramResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ProgramResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\ProgramResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listPrograms + * Operation listProgramsAsync * * Get all programs. * - * @param int $page Current page *(Optional)* (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) - * @param int $genre_id Search on Genre ID *(Optional)* (optional) - * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\ProgramResults + * @param int $page Current page *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $disabled Search on Disabled status *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listPrograms($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listProgramsAsync($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $disabled = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listProgramsWithHttpInfo($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listProgramsAsyncWithHttpInfo($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $disabled, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listProgramsWithHttpInfo + * Operation listProgramsAsyncWithHttpInfo * * Get all programs. * - * @param int $page Current page *(Optional)* (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) - * @param int $genre_id Search on Genre ID *(Optional)* (optional) - * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\ProgramResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $disabled Search on Disabled status *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listProgramsAsyncWithHttpInfo($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $disabled = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\ProgramResults'; + $request = $this->listProgramsRequest($page, $broadcast_id, $model_type_id, $tag_id, $presenter_id, $genre_id, $block_id, $item_id, $disabled, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listPrograms' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $presenter_id Search on Presenter ID *(Optional)* `(Relation)` (optional) + * @param int $genre_id Search on Genre ID *(Optional)* (optional) + * @param int $block_id Search on Block ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $disabled Search on Disabled status *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function listProgramsWithHttpInfo($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + protected function listProgramsRequest($page = null, $broadcast_id = null, $model_type_id = null, $tag_id = null, $presenter_id = null, $genre_id = null, $block_id = null, $item_id = null, $disabled = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling ProgramApi.listPrograms, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($disabled !== null && $disabled > 1) { + throw new \InvalidArgumentException('invalid value for "$disabled" when calling ProgramApi.listPrograms, must be smaller than or equal to 1.'); + } + if ($disabled !== null && $disabled < 0) { + throw new \InvalidArgumentException('invalid value for "$disabled" when calling ProgramApi.listPrograms, must be bigger than or equal to 0.'); + } + + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ProgramApi.listPrograms, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling ProgramApi.listPrograms, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/programs"; - $httpBody = ''; + + $resourcePath = '/programs'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($tag_id !== null) { - $queryParams['tag_id'] = $this->apiClient->getSerializer()->toQueryValue($tag_id); + $queryParams['tag_id'] = ObjectSerializer::toQueryValue($tag_id); } // query params if ($presenter_id !== null) { - $queryParams['presenter_id'] = $this->apiClient->getSerializer()->toQueryValue($presenter_id); + $queryParams['presenter_id'] = ObjectSerializer::toQueryValue($presenter_id); } // query params if ($genre_id !== null) { - $queryParams['genre_id'] = $this->apiClient->getSerializer()->toQueryValue($genre_id); + $queryParams['genre_id'] = ObjectSerializer::toQueryValue($genre_id); } // query params if ($block_id !== null) { - $queryParams['block_id'] = $this->apiClient->getSerializer()->toQueryValue($block_id); + $queryParams['block_id'] = ObjectSerializer::toQueryValue($block_id); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); + } + // query params + if ($disabled !== null) { + $queryParams['disabled'] = ObjectSerializer::toQueryValue($disabled); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updateProgramByID + * + * Update program by id + * + * @param int $id ID of Program **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateProgramByID($id, $data = null) + { + list($response) = $this->updateProgramByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateProgramByIDWithHttpInfo + * + * Update program by id + * + * @param int $id ID of Program **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateProgramByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateProgramByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\ProgramResults', - '/programs' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\ProgramResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\ProgramResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateProgramByID + * Operation updateProgramByIDAsync * * Update program by id * - * @param int $id ID of Program **(Required)** (required) - * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Program **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateProgramByID($id, $data = null) + public function updateProgramByIDAsync($id, $data = null) { - list($response) = $this->updateProgramByIDWithHttpInfo($id, $data); - return $response; + return $this->updateProgramByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateProgramByIDWithHttpInfo + * Operation updateProgramByIDAsyncWithHttpInfo * * Update program by id * - * @param int $id ID of Program **(Required)** (required) - * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Program **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateProgramByIDWithHttpInfo($id, $data = null) + public function updateProgramByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateProgramByIDRequest($id, $data); + + 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 'updateProgramByID' + * + * @param int $id ID of Program **(Required)** (required) + * @param \RadioManager\Model\ProgramDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateProgramByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateProgramByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateProgramByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling ProgramApi.updateProgramByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/programs/{id}"; - $httpBody = ''; + + $resourcePath = '/programs/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/programs/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/StationApi.php b/lib/Api/StationApi.php index ac2b6d1..8d6f19c 100644 --- a/lib/Api/StationApi.php +++ b/lib/Api/StationApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * StationApi Class Doc Comment @@ -44,47 +50,36 @@ class StationApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return StationApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,7 +87,9 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Get own station only * + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\StationResult */ public function getStation() @@ -106,65 +103,265 @@ public function getStation() * * Get own station only * + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\StationResult, HTTP status code, HTTP response headers (array of strings) */ public function getStationWithHttpInfo() { - // parse inputs - $resourcePath = "/station"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - + $returnType = '\RadioManager\Model\StationResult'; + $request = $this->getStationRequest(); - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\StationResult', - '/station' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\StationResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\StationResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\StationResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } + + /** + * Operation getStationAsync + * + * Get own station only + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getStationAsync() + { + return $this->getStationAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getStationAsyncWithHttpInfo + * + * Get own station only + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getStationAsyncWithHttpInfo() + { + $returnType = '\RadioManager\Model\StationResult'; + $request = $this->getStationRequest(); + + 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 'getStation' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getStationRequest() + { + + $resourcePath = '/station'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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/StoryApi.php b/lib/Api/StoryApi.php index 9459c26..e9a7c37 100644 --- a/lib/Api/StoryApi.php +++ b/lib/Api/StoryApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * StoryApi Class Doc Comment @@ -44,47 +50,36 @@ class StoryApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return StoryApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create story. * - * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createStory($data) @@ -107,27 +104,197 @@ public function createStory($data) * * Create story. * - * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createStoryWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createStoryRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createStoryAsync + * + * Create story. + * + * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createStoryAsync($data) + { + return $this->createStoryAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createStoryAsyncWithHttpInfo + * + * Create story. + * + * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createStoryAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createStoryRequest($data); + + 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 'createStory' + * + * @param \RadioManager\Model\StoryDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createStoryRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createStory'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createStory' + ); } - // parse inputs - $resourcePath = "/stories"; - $httpBody = ''; + + $resourcePath = '/stories'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -135,521 +302,1353 @@ public function createStoryWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 deleteStoryById + * + * Delete story by id + * + * @param int $id ID of Story **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteStoryById($id) + { + list($response) = $this->deleteStoryByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteStoryByIdWithHttpInfo + * + * Delete story by id + * + * @param int $id ID of Story **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteStoryByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteStoryByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/stories' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteStoryById + * Operation deleteStoryByIdAsync * * Delete story by id * - * @param int $id ID of Story **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Story **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteStoryById($id) + public function deleteStoryByIdAsync($id) { - list($response) = $this->deleteStoryByIdWithHttpInfo($id); - return $response; + return $this->deleteStoryByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteStoryByIdWithHttpInfo + * Operation deleteStoryByIdAsyncWithHttpInfo * * Delete story by id * - * @param int $id ID of Story **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Story **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteStoryByIdWithHttpInfo($id) + public function deleteStoryByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteStoryByIdRequest($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() + ]; + }, + 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 'deleteStoryById' + * + * @param int $id ID of Story **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteStoryByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteStoryById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteStoryById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling StoryApi.deleteStoryById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/stories/{id}"; - $httpBody = ''; + + $resourcePath = '/stories/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 getStoryById + * + * Get story by id + * + * @param int $id ID of Story **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\StoryResult + */ + public function getStoryById($id, $_external_station_id = null) + { + list($response) = $this->getStoryByIdWithHttpInfo($id, $_external_station_id); + return $response; + } + + /** + * Operation getStoryByIdWithHttpInfo + * + * Get story by id + * + * @param int $id ID of Story **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\StoryResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getStoryByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\StoryResult'; + $request = $this->getStoryByIdRequest($id, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/stories/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\StoryResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getStoryById + * Operation getStoryByIdAsync * * Get story by id * - * @param int $id ID of Story **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\StoryResult + * @param int $id ID of Story **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStoryById($id, $_external_station_id = null) + public function getStoryByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getStoryByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->getStoryByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getStoryByIdWithHttpInfo + * Operation getStoryByIdAsyncWithHttpInfo * * Get story by id * - * @param int $id ID of Story **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\StoryResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Story **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStoryByIdWithHttpInfo($id, $_external_station_id = null) + public function getStoryByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\StoryResult'; + $request = $this->getStoryByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getStoryById' + * + * @param int $id ID of Story **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getStoryByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getStoryById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getStoryById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling StoryApi.getStoryById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/stories/{id}"; - $httpBody = ''; + + $resourcePath = '/stories/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 listStories + * + * Get all stories. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\StoryResults + */ + public function listStories($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listStoriesWithHttpInfo($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listStoriesWithHttpInfo + * + * Get all stories. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\StoryResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listStoriesWithHttpInfo($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\StoryResults'; + $request = $this->listStoriesRequest($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\StoryResult', - '/stories/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\StoryResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\StoryResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\StoryResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listStories + * Operation listStoriesAsync * * Get all stories. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\StoryResults + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStories($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listStoriesAsync($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listStoriesWithHttpInfo($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listStoriesAsyncWithHttpInfo($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listStoriesWithHttpInfo + * Operation listStoriesAsyncWithHttpInfo * * Get all stories. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) - * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\StoryResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStoriesWithHttpInfo($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listStoriesAsyncWithHttpInfo($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 0)) { + $returnType = '\RadioManager\Model\StoryResults'; + $request = $this->listStoriesRequest($page, $item_id, $model_type_id, $tag_id, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listStories' + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $model_type_id Search on ModelType ID *(Optional)* `(Relation)` (optional) + * @param int $tag_id Search on Tag ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listStoriesRequest($page = '1', $item_id = null, $model_type_id = null, $tag_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling StoryApi.listStories, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling StoryApi.listStories, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling StoryApi.listStories, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/stories"; - $httpBody = ''; + + $resourcePath = '/stories'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($model_type_id !== null) { - $queryParams['model_type_id'] = $this->apiClient->getSerializer()->toQueryValue($model_type_id); + $queryParams['model_type_id'] = ObjectSerializer::toQueryValue($model_type_id); } // query params if ($tag_id !== null) { - $queryParams['tag_id'] = $this->apiClient->getSerializer()->toQueryValue($tag_id); + $queryParams['tag_id'] = ObjectSerializer::toQueryValue($tag_id); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updateStoryByID + * + * Update story by id + * + * @param int $id ID of Story **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateStoryByID($id, $data = null) + { + list($response) = $this->updateStoryByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateStoryByIDWithHttpInfo + * + * Update story by id + * + * @param int $id ID of Story **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateStoryByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateStoryByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\StoryResults', - '/stories' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\StoryResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\StoryResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateStoryByID + * Operation updateStoryByIDAsync * * Update story by id * - * @param int $id ID of Story **(Required)** (required) - * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Story **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStoryByID($id, $data = null) + public function updateStoryByIDAsync($id, $data = null) { - list($response) = $this->updateStoryByIDWithHttpInfo($id, $data); - return $response; + return $this->updateStoryByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateStoryByIDWithHttpInfo + * Operation updateStoryByIDAsyncWithHttpInfo * * Update story by id * - * @param int $id ID of Story **(Required)** (required) - * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Story **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStoryByIDWithHttpInfo($id, $data = null) + public function updateStoryByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateStoryByIDRequest($id, $data); + + 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 'updateStoryByID' + * + * @param int $id ID of Story **(Required)** (required) + * @param \RadioManager\Model\StoryDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateStoryByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateStoryByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateStoryByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling StoryApi.updateStoryByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/stories/{id}"; - $httpBody = ''; + + $resourcePath = '/stories/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/stories/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/StringApi.php b/lib/Api/StringApi.php index 6979c60..6993d3b 100644 --- a/lib/Api/StringApi.php +++ b/lib/Api/StringApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * StringApi Class Doc Comment @@ -44,47 +50,36 @@ class StringApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return StringApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,9 +87,11 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Get Strings (formatted) * - * @param string $name Name of Strings **(Required)** (required) - * @param bool $full_model Full model or content only **(Required)** (required) + * @param string $name Name of Strings **(Required)** (required) + * @param bool $full_model Full model or content only **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\TextString */ public function getStringsByName($name, $full_model) @@ -108,87 +105,297 @@ public function getStringsByName($name, $full_model) * * Get Strings (formatted) * - * @param string $name Name of Strings **(Required)** (required) - * @param bool $full_model Full model or content only **(Required)** (required) + * @param string $name Name of Strings **(Required)** (required) + * @param bool $full_model Full model or content only **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\TextString, HTTP status code, HTTP response headers (array of strings) */ public function getStringsByNameWithHttpInfo($name, $full_model) + { + $returnType = '\RadioManager\Model\TextString'; + $request = $this->getStringsByNameRequest($name, $full_model); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TextString', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getStringsByNameAsync + * + * Get Strings (formatted) + * + * @param string $name Name of Strings **(Required)** (required) + * @param bool $full_model Full model or content only **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getStringsByNameAsync($name, $full_model) + { + return $this->getStringsByNameAsyncWithHttpInfo($name, $full_model) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getStringsByNameAsyncWithHttpInfo + * + * Get Strings (formatted) + * + * @param string $name Name of Strings **(Required)** (required) + * @param bool $full_model Full model or content only **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getStringsByNameAsyncWithHttpInfo($name, $full_model) + { + $returnType = '\RadioManager\Model\TextString'; + $request = $this->getStringsByNameRequest($name, $full_model); + + 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 'getStringsByName' + * + * @param string $name Name of Strings **(Required)** (required) + * @param bool $full_model Full model or content only **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getStringsByNameRequest($name, $full_model) { // verify the required parameter 'name' is set if ($name === null) { - throw new \InvalidArgumentException('Missing the required parameter $name when calling getStringsByName'); + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling getStringsByName' + ); } // verify the required parameter 'full_model' is set if ($full_model === null) { - throw new \InvalidArgumentException('Missing the required parameter $full_model when calling getStringsByName'); + throw new \InvalidArgumentException( + 'Missing the required parameter $full_model when calling getStringsByName' + ); } - // parse inputs - $resourcePath = "/strings/{name}"; - $httpBody = ''; + + $resourcePath = '/strings/{name}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($full_model !== null) { - $queryParams['full_model'] = $this->apiClient->getSerializer()->toQueryValue($full_model); + $queryParams['full_model'] = ObjectSerializer::toQueryValue($full_model); } + // path params if ($name !== null) { $resourcePath = str_replace( - "{" . "name" . "}", - $this->apiClient->getSerializer()->toPathValue($name), + '{' . 'name' . '}', + ObjectSerializer::toPathValue($name), $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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\TextString', - '/strings/{name}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\TextString', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TextString', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $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/TagApi.php b/lib/Api/TagApi.php index bee94e2..c5171dd 100644 --- a/lib/Api/TagApi.php +++ b/lib/Api/TagApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * TagApi Class Doc Comment @@ -44,47 +50,36 @@ class TagApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return TagApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Create tag. * - * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\PostSuccess */ public function createTag($data) @@ -107,27 +104,205 @@ public function createTag($data) * * Create tag. * - * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\PostSuccess, HTTP status code, HTTP response headers (array of strings) */ public function createTagWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createTagRequest($data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\PostSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createTagAsync + * + * Create tag. + * + * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createTagAsync($data) + { + return $this->createTagAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createTagAsyncWithHttpInfo + * + * Create tag. + * + * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createTagAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\PostSuccess'; + $request = $this->createTagRequest($data); + + 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 'createTag' + * + * @param \RadioManager\Model\TagDataInput $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createTagRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling createTag'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling createTag' + ); } - // parse inputs - $resourcePath = "/tags"; - $httpBody = ''; + + $resourcePath = '/tags'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -135,531 +310,1362 @@ public function createTagWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 deleteTagById + * + * Delete tag by id + * + * @param int $id ID of Tag **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function deleteTagById($id) + { + list($response) = $this->deleteTagByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteTagByIdWithHttpInfo + * + * Delete tag by id + * + * @param int $id ID of Tag **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteTagByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteTagByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\PostSuccess', - '/tags' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\PostSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\PostSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation deleteTagById + * Operation deleteTagByIdAsync * * Delete tag by id * - * @param int $id ID of Tag **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Tag **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagById($id) + public function deleteTagByIdAsync($id) { - list($response) = $this->deleteTagByIdWithHttpInfo($id); - return $response; + return $this->deleteTagByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation deleteTagByIdWithHttpInfo + * Operation deleteTagByIdAsyncWithHttpInfo * * Delete tag by id * - * @param int $id ID of Tag **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Tag **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagByIdWithHttpInfo($id) + public function deleteTagByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteTagByIdRequest($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() + ]; + }, + 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 'deleteTagById' + * + * @param int $id ID of Tag **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteTagByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteTagById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteTagById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling TagApi.deleteTagById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/tags/{id}"; - $httpBody = ''; + + $resourcePath = '/tags/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 getTagById + * + * Get tags by id + * + * @param int $id ID of Tag **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\TagResult + */ + public function getTagById($id, $_external_station_id = null) + { + list($response) = $this->getTagByIdWithHttpInfo($id, $_external_station_id); + return $response; + } + + /** + * Operation getTagByIdWithHttpInfo + * + * Get tags by id + * + * @param int $id ID of Tag **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\TagResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getTagByIdWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\TagResult'; + $request = $this->getTagByIdRequest($id, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/tags/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TagResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getTagById + * Operation getTagByIdAsync * * Get tags by id * - * @param int $id ID of Tag **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\TagResult + * @param int $id ID of Tag **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagById($id, $_external_station_id = null) + public function getTagByIdAsync($id, $_external_station_id = null) { - list($response) = $this->getTagByIdWithHttpInfo($id, $_external_station_id); - return $response; + return $this->getTagByIdAsyncWithHttpInfo($id, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getTagByIdWithHttpInfo + * Operation getTagByIdAsyncWithHttpInfo * * Get tags by id * - * @param int $id ID of Tag **(Required)** (required) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\TagResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Tag **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagByIdWithHttpInfo($id, $_external_station_id = null) + public function getTagByIdAsyncWithHttpInfo($id, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\TagResult'; + $request = $this->getTagByIdRequest($id, $_external_station_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() + ]; + }, + 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 'getTagById' + * + * @param int $id ID of Tag **(Required)** (required) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getTagByIdRequest($id, $_external_station_id = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getTagById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTagById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling TagApi.getTagById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/tags/{id}"; - $httpBody = ''; + + $resourcePath = '/tags/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); } + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listTags + * + * Get a list of all the tags currently in your station. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\TagResults + */ + public function listTags($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + list($response) = $this->listTagsWithHttpInfo($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_id); + return $response; + } + + /** + * Operation listTagsWithHttpInfo + * + * Get a list of all the tags currently in your station. + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\TagResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listTagsWithHttpInfo($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\TagResults'; + $request = $this->listTagsRequest($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\TagResult', - '/tags/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\TagResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TagResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TagResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listTags + * Operation listTagsAsync * * Get a list of all the tags currently in your station. * - * @param int $page Current page *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\TagResults + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTags($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listTagsAsync($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - list($response) = $this->listTagsWithHttpInfo($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_id); - return $response; + return $this->listTagsAsyncWithHttpInfo($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listTagsWithHttpInfo + * Operation listTagsAsyncWithHttpInfo * * Get a list of all the tags currently in your station. * - * @param int $page Current page *(Optional)* (optional) - * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) - * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) - * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) - * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\TagResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTagsWithHttpInfo($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + public function listTagsAsyncWithHttpInfo($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) + { + $returnType = '\RadioManager\Model\TagResults'; + $request = $this->listTagsRequest($page, $program_id, $item_id, $broadcast_id, $contact_id, $limit, $order_by, $order_direction, $_external_station_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() + ]; + }, + 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 'listTags' + * + * @param int $page Current page *(Optional)* (optional) + * @param int $program_id Search on Program ID *(Optional)* `(Relation)` (optional) + * @param int $item_id Search on Item ID *(Optional)* `(Relation)` (optional) + * @param int $broadcast_id Search on Broadcast ID *(Optional)* `(Relation)` (optional) + * @param int $contact_id Search on Contact ID *(Optional)* `(Relation)` (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * @param int $_external_station_id Query on a different (content providing) station *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listTagsRequest($page = null, $program_id = null, $item_id = null, $broadcast_id = null, $contact_id = null, $limit = null, $order_by = null, $order_direction = null, $_external_station_id = null) { - if (!is_null($page) && ($page < 1)) { + if ($page !== null && $page < 1) { throw new \InvalidArgumentException('invalid value for "$page" when calling TagApi.listTags, must be bigger than or equal to 1.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling TagApi.listTags, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling TagApi.listTags, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/tags"; - $httpBody = ''; + + $resourcePath = '/tags'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($program_id !== null) { - $queryParams['program_id'] = $this->apiClient->getSerializer()->toQueryValue($program_id); + $queryParams['program_id'] = ObjectSerializer::toQueryValue($program_id); } // query params if ($item_id !== null) { - $queryParams['item_id'] = $this->apiClient->getSerializer()->toQueryValue($item_id); + $queryParams['item_id'] = ObjectSerializer::toQueryValue($item_id); } // query params if ($broadcast_id !== null) { - $queryParams['broadcast_id'] = $this->apiClient->getSerializer()->toQueryValue($broadcast_id); + $queryParams['broadcast_id'] = ObjectSerializer::toQueryValue($broadcast_id); } // query params if ($contact_id !== null) { - $queryParams['contact_id'] = $this->apiClient->getSerializer()->toQueryValue($contact_id); + $queryParams['contact_id'] = ObjectSerializer::toQueryValue($contact_id); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); } // query params if ($_external_station_id !== null) { - $queryParams['_external_station_id'] = $this->apiClient->getSerializer()->toQueryValue($_external_station_id); + $queryParams['_external_station_id'] = ObjectSerializer::toQueryValue($_external_station_id); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 updateTagByID + * + * Update tag by id + * + * @param int $id ID of Tag **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\Success + */ + public function updateTagByID($id, $data = null) + { + list($response) = $this->updateTagByIDWithHttpInfo($id, $data); + return $response; + } + + /** + * Operation updateTagByIDWithHttpInfo + * + * Update tag by id + * + * @param int $id ID of Tag **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTagByIDWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateTagByIDRequest($id, $data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\TagResults', - '/tags' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\TagResults', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TagResults', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation updateTagByID + * Operation updateTagByIDAsync * * Update tag by id * - * @param int $id ID of Tag **(Required)** (required) - * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\Success + * @param int $id ID of Tag **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTagByID($id, $data = null) + public function updateTagByIDAsync($id, $data = null) { - list($response) = $this->updateTagByIDWithHttpInfo($id, $data); - return $response; + return $this->updateTagByIDAsyncWithHttpInfo($id, $data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation updateTagByIDWithHttpInfo + * Operation updateTagByIDAsyncWithHttpInfo * * Update tag by id * - * @param int $id ID of Tag **(Required)** (required) - * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) + * @param int $id ID of Tag **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTagByIDWithHttpInfo($id, $data = null) + public function updateTagByIDAsyncWithHttpInfo($id, $data = null) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->updateTagByIDRequest($id, $data); + + 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 'updateTagByID' + * + * @param int $id ID of Tag **(Required)** (required) + * @param \RadioManager\Model\TagDataInput $data Data *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateTagByIDRequest($id, $data = null) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling updateTagByID'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateTagByID' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling TagApi.updateTagByID, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/tags/{id}"; - $httpBody = ''; + + $resourcePath = '/tags/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } + // body params $_tempBody = null; if (isset($data)) { $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'PATCH', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/tags/{id}' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $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/UserApi.php b/lib/Api/UserApi.php index 020f2db..b182bab 100644 --- a/lib/Api/UserApi.php +++ b/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * UserApi Class Doc Comment @@ -44,47 +50,36 @@ class UserApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return UserApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,8 +87,10 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Remove user from station by Id * - * @param int $id id of User (required) + * @param int $id id of User (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\Success */ public function deleteUserById($id) @@ -107,233 +104,795 @@ public function deleteUserById($id) * * Remove user from station by Id * - * @param int $id id of User (required) + * @param int $id id of User (required) + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\Success, HTTP status code, HTTP response headers (array of strings) */ public function deleteUserByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteUserByIdRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Success', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteUserByIdAsync + * + * Remove user from station by Id + * + * @param int $id id of User (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteUserByIdAsync($id) + { + return $this->deleteUserByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteUserByIdAsyncWithHttpInfo + * + * Remove user from station by Id + * + * @param int $id id of User (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteUserByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\Success'; + $request = $this->deleteUserByIdRequest($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() + ]; + }, + 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 'deleteUserById' + * + * @param int $id id of User (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteUserByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteUserById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteUserById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling UserApi.deleteUserById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/users/{id}"; - $httpBody = ''; + + $resourcePath = '/users/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 getUserById + * + * Get user by id + * + * @param int $id id of User (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\UserResult + */ + public function getUserById($id) + { + list($response) = $this->getUserByIdWithHttpInfo($id); + return $response; + } + + /** + * Operation getUserByIdWithHttpInfo + * + * Get user by id + * + * @param int $id id of User (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\UserResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserByIdWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\UserResult'; + $request = $this->getUserByIdRequest($id); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'DELETE', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\Success', - '/users/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\Success', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Success', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UserResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation getUserById + * Operation getUserByIdAsync * * Get user by id * - * @param int $id id of User (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\UserResult + * @param int $id id of User (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserById($id) + public function getUserByIdAsync($id) { - list($response) = $this->getUserByIdWithHttpInfo($id); - return $response; + return $this->getUserByIdAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation getUserByIdWithHttpInfo + * Operation getUserByIdAsyncWithHttpInfo * * Get user by id * - * @param int $id id of User (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\UserResult, HTTP status code, HTTP response headers (array of strings) + * @param int $id id of User (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserByIdWithHttpInfo($id) + public function getUserByIdAsyncWithHttpInfo($id) + { + $returnType = '\RadioManager\Model\UserResult'; + $request = $this->getUserByIdRequest($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() + ]; + }, + 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 'getUserById' + * + * @param int $id id of User (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getUserByIdRequest($id) { // verify the required parameter 'id' is set if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling getUserById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUserById' + ); } - if (($id < 0)) { + if ($id < 0) { throw new \InvalidArgumentException('invalid value for "$id" when calling UserApi.getUserById, must be bigger than or equal to 0.'); } - // parse inputs - $resourcePath = "/users/{id}"; - $httpBody = ''; + + $resourcePath = '/users/{id}'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + // path params if ($id !== null) { $resourcePath = str_replace( - "{" . "id" . "}", - $this->apiClient->getSerializer()->toPathValue($id), + '{' . '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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call + + $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 inviteUserByMail + * + * Invite user by mail + * + * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\InviteUserSuccess + */ + public function inviteUserByMail($data) + { + list($response) = $this->inviteUserByMailWithHttpInfo($data); + return $response; + } + + /** + * Operation inviteUserByMailWithHttpInfo + * + * Invite user by mail + * + * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\InviteUserSuccess, HTTP status code, HTTP response headers (array of strings) + */ + public function inviteUserByMailWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\InviteUserSuccess'; + $request = $this->inviteUserByMailRequest($data); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\UserResult', - '/users/{id}' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\UserResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UserResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\InviteUserSuccess', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UnprocessableEntity', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation inviteUserByMail + * Operation inviteUserByMailAsync * * Invite user by mail * - * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\InviteUserSuccess + * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function inviteUserByMail($data) + public function inviteUserByMailAsync($data) { - list($response) = $this->inviteUserByMailWithHttpInfo($data); - return $response; + return $this->inviteUserByMailAsyncWithHttpInfo($data) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation inviteUserByMailWithHttpInfo + * Operation inviteUserByMailAsyncWithHttpInfo * * Invite user by mail * - * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\InviteUserSuccess, HTTP status code, HTTP response headers (array of strings) + * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function inviteUserByMailWithHttpInfo($data) + public function inviteUserByMailAsyncWithHttpInfo($data) + { + $returnType = '\RadioManager\Model\InviteUserSuccess'; + $request = $this->inviteUserByMailRequest($data); + + 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 'inviteUserByMail' + * + * @param \RadioManager\Model\InviteUserData $data Data **(Required)** (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function inviteUserByMailRequest($data) { // verify the required parameter 'data' is set if ($data === null) { - throw new \InvalidArgumentException('Missing the required parameter $data when calling inviteUserByMail'); + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling inviteUserByMail' + ); } - // parse inputs - $resourcePath = "/users/invite"; - $httpBody = ''; + + $resourcePath = '/users/invite'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; + + // body params $_tempBody = null; @@ -341,181 +900,416 @@ public function inviteUserByMailWithHttpInfo($data) $_tempBody = $data; } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $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 listUsers + * + * Get all users. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $role_id Search on Role ID *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \RadioManager\Model\UserResults + */ + public function listUsers($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) + { + list($response) = $this->listUsersWithHttpInfo($page, $role_id, $limit, $order_by, $order_direction); + return $response; + } + + /** + * Operation listUsersWithHttpInfo + * + * Get all users. + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $role_id Search on Role ID *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * + * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \RadioManager\Model\UserResults, HTTP status code, HTTP response headers (array of strings) + */ + public function listUsersWithHttpInfo($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) + { + $returnType = '\RadioManager\Model\UserResults'; + $request = $this->listUsersRequest($page, $role_id, $limit, $order_by, $order_direction); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\InviteUserSuccess', - '/users/invite' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\InviteUserSuccess', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\InviteUserSuccess', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\UserResults', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\Forbidden', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UnprocessableEntity', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listUsers + * Operation listUsersAsync * * Get all users. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $role_id Search on Role ID *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return \RadioManager\Model\UserResults + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $role_id Search on Role ID *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUsers($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) + public function listUsersAsync($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) { - list($response) = $this->listUsersWithHttpInfo($page, $role_id, $limit, $order_by, $order_direction); - return $response; + return $this->listUsersAsyncWithHttpInfo($page, $role_id, $limit, $order_by, $order_direction) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listUsersWithHttpInfo + * Operation listUsersAsyncWithHttpInfo * * Get all users. * - * @param int $page Current page *(Optional)* (optional, default to 1) - * @param int $role_id Search on Role ID *(Optional)* (optional) - * @param int $limit Results per page *(Optional)* (optional) - * @param string $order_by Field to order the results *(Optional)* (optional) - * @param string $order_direction Direction of ordering *(Optional)* (optional) - * @throws \RadioManager\ApiException on non-2xx response - * @return array of \RadioManager\Model\UserResults, HTTP status code, HTTP response headers (array of strings) + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $role_id Search on Role ID *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUsersWithHttpInfo($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) + public function listUsersAsyncWithHttpInfo($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) { - if (!is_null($page) && ($page < 0)) { + $returnType = '\RadioManager\Model\UserResults'; + $request = $this->listUsersRequest($page, $role_id, $limit, $order_by, $order_direction); + + 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 'listUsers' + * + * @param int $page Current page *(Optional)* (optional, default to 1) + * @param int $role_id Search on Role ID *(Optional)* (optional) + * @param int $limit Results per page *(Optional)* (optional) + * @param string $order_by Field to order the results *(Optional)* (optional) + * @param string $order_direction Direction of ordering *(Optional)* (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listUsersRequest($page = '1', $role_id = null, $limit = null, $order_by = null, $order_direction = null) + { + if ($page !== null && $page < 0) { throw new \InvalidArgumentException('invalid value for "$page" when calling UserApi.listUsers, must be bigger than or equal to 0.'); } - if (!is_null($limit) && ($limit > 50)) { + if ($limit !== null && $limit > 50) { throw new \InvalidArgumentException('invalid value for "$limit" when calling UserApi.listUsers, must be smaller than or equal to 50.'); } - if (!is_null($limit) && ($limit < 1)) { + if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling UserApi.listUsers, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/users"; - $httpBody = ''; + + $resourcePath = '/users'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + $httpBody = ''; + $multipart = false; // query params if ($page !== null) { - $queryParams['page'] = $this->apiClient->getSerializer()->toQueryValue($page); + $queryParams['page'] = ObjectSerializer::toQueryValue($page); } // query params if ($role_id !== null) { - $queryParams['role_id'] = $this->apiClient->getSerializer()->toQueryValue($role_id); + $queryParams['role_id'] = ObjectSerializer::toQueryValue($role_id); } // query params if ($limit !== null) { - $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); } // query params if ($order_by !== null) { - $queryParams['order-by'] = $this->apiClient->getSerializer()->toQueryValue($order_by); + $queryParams['order-by'] = ObjectSerializer::toQueryValue($order_by); } // query params if ($order_direction !== null) { - $queryParams['order-direction'] = $this->apiClient->getSerializer()->toQueryValue($order_direction); + $queryParams['order-direction'] = ObjectSerializer::toQueryValue($order_direction); + } + + + // 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)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_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) { - $httpBody = $formParams; // for HTTP post (form) + 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->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\UserResults', - '/users' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\UserResults', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\UserResults', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\Forbidden', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $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/VisualSlideApi.php b/lib/Api/VisualSlideApi.php index a8d64dc..5e7f4f8 100644 --- a/lib/Api/VisualSlideApi.php +++ b/lib/Api/VisualSlideApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -28,10 +28,16 @@ namespace RadioManager\Api; -use \RadioManager\ApiClient; -use \RadioManager\ApiException; -use \RadioManager\Configuration; -use \RadioManager\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use RadioManager\ApiException; +use RadioManager\Configuration; +use RadioManager\HeaderSelector; +use RadioManager\ObjectSerializer; /** * VisualSlideApi Class Doc Comment @@ -44,47 +50,36 @@ class VisualSlideApi { /** - * API Client - * - * @var \RadioManager\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \RadioManager\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\RadioManager\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } - - $this->apiClient = $apiClient; - } + protected $config; /** - * Get API client - * - * @return \RadioManager\ApiClient get the API client + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector */ - public function getApiClient() - { - return $this->apiClient; + 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(); } /** - * Set the API client - * - * @param \RadioManager\ApiClient $apiClient set the API client - * - * @return VisualSlideApi + * @return Configuration */ - public function setApiClient(\RadioManager\ApiClient $apiClient) + public function getConfig() { - $this->apiClient = $apiClient; - return $this; + return $this->config; } /** @@ -92,7 +87,9 @@ public function setApiClient(\RadioManager\ApiClient $apiClient) * * Get Visual Slide Image as Base64 * + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return \RadioManager\Model\VisualResult */ public function getVisualSlide() @@ -106,65 +103,265 @@ public function getVisualSlide() * * Get Visual Slide Image as Base64 * + * * @throws \RadioManager\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of \RadioManager\Model\VisualResult, HTTP status code, HTTP response headers (array of strings) */ public function getVisualSlideWithHttpInfo() { - // parse inputs - $resourcePath = "/visual"; - $httpBody = ''; - $queryParams = []; - $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - + $returnType = '\RadioManager\Model\VisualResult'; + $request = $this->getVisualSlideRequest(); - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key'); - if (strlen($apiKey) !== 0) { - $headerParams['api-key'] = $apiKey; - } - // make the API Call try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\RadioManager\Model\VisualResult', - '/visual' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\RadioManager\Model\VisualResult', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\VisualResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\VisualResult', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\NotFound', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\NotFound', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\RadioManager\Model\TooManyRequests', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\RadioManager\Model\TooManyRequests', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } + + /** + * Operation getVisualSlideAsync + * + * Get Visual Slide Image as Base64 + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getVisualSlideAsync() + { + return $this->getVisualSlideAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getVisualSlideAsyncWithHttpInfo + * + * Get Visual Slide Image as Base64 + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getVisualSlideAsyncWithHttpInfo() + { + $returnType = '\RadioManager\Model\VisualResult'; + $request = $this->getVisualSlideRequest(); + + 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 'getVisualSlide' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getVisualSlideRequest() + { + + $resourcePath = '/visual'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \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('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + + $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/ApiClient.php b/lib/ApiClient.php deleted file mode 100644 index 09ea456..0000000 --- a/lib/ApiClient.php +++ /dev/null @@ -1,371 +0,0 @@ -config = $config; - $this->serializer = new ObjectSerializer(); - } - - /** - * Get the config - * - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Get the serializer - * - * @return ObjectSerializer - */ - public function getSerializer() - { - return $this->serializer; - } - - /** - * 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->config->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->config->getApiKey($apiKeyIdentifier); - - if (!isset($apiKey)) { - return null; - } - - if (isset($prefix)) { - $keyWithPrefix = $prefix." ".$apiKey; - } else { - $keyWithPrefix = $apiKey; - } - - return $keyWithPrefix; - } - - /** - * Make the HTTP call (Sync) - * - * @param string $resourcePath path to method endpoint - * @param string $method method to call - * @param array $queryParams parameters to be place in query URL - * @param array $postData parameters to be placed in POST body - * @param array $headerParams parameters to be place in request header - * @param string $responseType expected response type of the endpoint - * @param string $endpointPath path to method endpoint before expanding parameters - * - * @throws \RadioManager\ApiException on a non 2xx response - * @return mixed - */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) - { - $headers = []; - - // construct the http header - $headerParams = array_merge( - (array)$this->config->getDefaultHeaders(), - (array)$headerParams - ); - - foreach ($headerParams as $key => $val) { - $headers[] = "$key: $val"; - } - - // form data - if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { - $postData = http_build_query($postData); - } elseif ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model - $postData = json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($postData)); - } - - $url = $this->config->getHost() . $resourcePath; - - $curl = curl_init(); - // set timeout, if needed - if ($this->config->getCurlTimeout() !== 0) { - curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); - } - // set connect timeout, if needed - if ($this->config->getCurlConnectTimeout() != 0) { - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout()); - } - - // return the result on success, rather than just true - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - - // disable SSL verification, if needed - if ($this->config->getSSLVerification() === false) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); - } - - if ($this->config->getCurlProxyHost()) { - curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); - } - - if ($this->config->getCurlProxyPort()) { - curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort()); - } - - if ($this->config->getCurlProxyType()) { - curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType()); - } - - if ($this->config->getCurlProxyUser()) { - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword()); - } - - if (!empty($queryParams)) { - $url = ($url . '?' . http_build_query($queryParams)); - } - - if ($this->config->getAllowEncoding()) { - curl_setopt($curl, CURLOPT_ENCODING, ''); - } - - if ($method === self::$POST) { - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$HEAD) { - curl_setopt($curl, CURLOPT_NOBODY, true); - } elseif ($method === self::$OPTIONS) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "OPTIONS"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$PATCH) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$PUT) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$DELETE) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method !== self::$GET) { - throw new ApiException('Method ' . $method . ' is not recognized.'); - } - curl_setopt($curl, CURLOPT_URL, $url); - - // Set user agent - curl_setopt($curl, CURLOPT_USERAGENT, $this->config->getUserAgent()); - - // debugging for curl - if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); - - curl_setopt($curl, CURLOPT_VERBOSE, 1); - curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); - } else { - curl_setopt($curl, CURLOPT_VERBOSE, 0); - } - - // obtain the HTTP response headers - curl_setopt($curl, CURLOPT_HEADER, 1); - - // Make the request - $response = curl_exec($curl); - $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); - $http_header = $this->httpParseHeaders(substr($response, 0, $http_header_size)); - $http_body = substr($response, $http_header_size); - $response_info = curl_getinfo($curl); - - // debug HTTP response body - if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); - } - - // Handle the response - if ($response_info['http_code'] === 0) { - $curl_error_message = curl_error($curl); - - // curl_exec can sometimes fail but still return a blank message from curl_error(). - if (!empty($curl_error_message)) { - $error_message = "API call to $url failed: $curl_error_message"; - } else { - $error_message = "API call to $url failed, but for an unknown reason. " . - "This could happen if you are disconnected from the network."; - } - - $exception = new ApiException($error_message, 0, null, null); - $exception->setResponseObject($response_info); - throw $exception; - } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { - // return raw body if response is a file - if ($responseType === '\SplFileObject' || $responseType === 'string') { - return [$http_body, $response_info['http_code'], $http_header]; - } - - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - } else { - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - - throw new ApiException( - "[".$response_info['http_code']."] Error connecting to the API ($url)", - $response_info['http_code'], - $http_header, - $data - ); - } - return [$data, $response_info['http_code'], $http_header]; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - public function selectHeaderAccept($accept) - { - if (count($accept) === 0 or (count($accept) === 1 and $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[] $content_type Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - public function selectHeaderContentType($content_type) - { - if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $content_type)) { - return 'application/json'; - } else { - return implode(',', $content_type); - } - } - - /** - * Return an array of HTTP response headers - * - * @param string $raw_headers A string of raw HTTP response headers - * - * @return string[] Array of HTTP response heaers - */ - protected function httpParseHeaders($raw_headers) - { - // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 - $headers = []; - $key = ''; - - foreach (explode("\n", $raw_headers) as $h) { - $h = explode(':', $h, 2); - - if (isset($h[1])) { - if (!isset($headers[$h[0]])) { - $headers[$h[0]] = trim($h[1]); - } elseif (is_array($headers[$h[0]])) { - $headers[$h[0]] = array_merge($headers[$h[0]], [trim($h[1])]); - } else { - $headers[$h[0]] = array_merge([$headers[$h[0]]], [trim($h[1])]); - } - - $key = $h[0]; - } else { - if (substr($h[0], 0, 1) === "\t") { - $headers[$key] .= "\r\n\t".trim($h[0]); - } elseif (!$key) { - $headers[0] = trim($h[0]); - } - trim($h[0]); - } - } - - return $headers; - } -} diff --git a/lib/ApiException.php b/lib/ApiException.php index fdae2d7..9c50c0d 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -51,7 +51,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[] + * @var string[]|null */ protected $responseHeaders; @@ -65,10 +65,10 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string[] $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string + * @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) { @@ -80,7 +80,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re /** * Gets the HTTP response header * - * @return string[] HTTP response headers + * @return string[]|null HTTP response header */ public function getResponseHeaders() { diff --git a/lib/Configuration.php b/lib/Configuration.php index d19e864..b095950 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -76,13 +76,6 @@ class Configuration */ protected $password = ''; - /** - * The default header(s) - * - * @var array - */ - protected $defaultHeaders = []; - /** * The host * @@ -90,20 +83,6 @@ class Configuration */ protected $host = 'https://radiomanager.io/api/v2'; - /** - * Timeout (second) of the HTTP request, by default set to 0, no timeout - * - * @var string - */ - protected $curlTimeout = 0; - - /** - * Timeout (second) of the HTTP connection, by default set to 0, no timeout - * - * @var string - */ - protected $curlConnectTimeout = 0; - /** * User agent of the HTTP request, set to "PHP-Swagger" by default * @@ -132,58 +111,6 @@ class Configuration */ protected $tempFolderPath; - /** - * Indicates if SSL verification should be enabled or disabled. - * - * This is useful if the host uses a self-signed SSL certificate. - * - * @var boolean True if the certificate should be validated, false otherwise. - */ - protected $sslVerification = true; - - /** - * Curl proxy host - * - * @var string - */ - protected $proxyHost; - - /** - * Curl proxy port - * - * @var integer - */ - protected $proxyPort; - - /** - * Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5 - * - * @see https://secure.php.net/manual/en/function.curl-setopt.php - * @var integer - */ - protected $proxyType; - - /** - * Curl proxy username - * - * @var string - */ - protected $proxyUser; - - /** - * Curl proxy password - * - * @var string - */ - protected $proxyPassword; - - /** - * Allow Curl encoding header - * - * @var bool - */ - protected $allowEncoding = false; - /** * Constructor */ @@ -313,48 +240,6 @@ public function getPassword() return $this->password; } - /** - * Adds a default header - * - * @param string $headerName header name (e.g. Token) - * @param string $headerValue header value (e.g. 1z8wp3) - * - * @throws \InvalidArgumentException - * @return $this - */ - public function addDefaultHeader($headerName, $headerValue) - { - if (!is_string($headerName)) { - throw new \InvalidArgumentException('Header name must be a string.'); - } - - $this->defaultHeaders[$headerName] = $headerValue; - return $this; - } - - /** - * Gets the default header - * - * @return array An array of default header(s) - */ - public function getDefaultHeaders() - { - return $this->defaultHeaders; - } - - /** - * Deletes a default header - * - * @param string $headerName the header to delete - * - * @return $this - */ - public function deleteDefaultHeader($headerName) - { - unset($this->defaultHeaders[$headerName]); - return $this; - } - /** * Sets the host * @@ -406,199 +291,6 @@ public function getUserAgent() return $this->userAgent; } - /** - * Sets the HTTP timeout value - * - * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] - * - * @throws \InvalidArgumentException - * @return $this - */ - public function setCurlTimeout($seconds) - { - if (!is_numeric($seconds) || $seconds < 0) { - throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.'); - } - - $this->curlTimeout = $seconds; - return $this; - } - - /** - * Gets the HTTP timeout value - * - * @return string HTTP timeout value - */ - public function getCurlTimeout() - { - return $this->curlTimeout; - } - - /** - * Sets the HTTP connect timeout value - * - * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] - * - * @throws \InvalidArgumentException - * @return $this - */ - public function setCurlConnectTimeout($seconds) - { - if (!is_numeric($seconds) || $seconds < 0) { - throw new \InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.'); - } - - $this->curlConnectTimeout = $seconds; - return $this; - } - - /** - * Set whether to accept encoding - * @param bool $allowEncoding - * - * @return $this - */ - public function setAllowEncoding($allowEncoding) - { - $this->allowEncoding = $allowEncoding; - return $this; - } - - /** - * Gets the HTTP connect timeout value - * - * @return string HTTP connect timeout value - */ - public function getCurlConnectTimeout() - { - return $this->curlConnectTimeout; - } - - /** - * Get whether to allow encoding - * - * @return bool - */ - public function getAllowEncoding() - { - return $this->allowEncoding; - } - - /** - * Sets the HTTP Proxy Host - * - * @param string $proxyHost HTTP Proxy URL - * - * @return $this - */ - public function setCurlProxyHost($proxyHost) - { - $this->proxyHost = $proxyHost; - return $this; - } - - /** - * Gets the HTTP Proxy Host - * - * @return string - */ - public function getCurlProxyHost() - { - return $this->proxyHost; - } - - /** - * Sets the HTTP Proxy Port - * - * @param integer $proxyPort HTTP Proxy Port - * - * @return $this - */ - public function setCurlProxyPort($proxyPort) - { - $this->proxyPort = $proxyPort; - return $this; - } - - /** - * Gets the HTTP Proxy Port - * - * @return integer - */ - public function getCurlProxyPort() - { - return $this->proxyPort; - } - - /** - * Sets the HTTP Proxy Type - * - * @param integer $proxyType HTTP Proxy Type - * - * @return $this - */ - public function setCurlProxyType($proxyType) - { - $this->proxyType = $proxyType; - return $this; - } - - /** - * Gets the HTTP Proxy Type - * - * @return integer - */ - public function getCurlProxyType() - { - return $this->proxyType; - } - - /** - * Sets the HTTP Proxy User - * - * @param string $proxyUser HTTP Proxy User - * - * @return $this - */ - public function setCurlProxyUser($proxyUser) - { - $this->proxyUser = $proxyUser; - return $this; - } - - /** - * Gets the HTTP Proxy User - * - * @return string - */ - public function getCurlProxyUser() - { - return $this->proxyUser; - } - - /** - * Sets the HTTP Proxy Password - * - * @param string $proxyPassword HTTP Proxy Password - * - * @return $this - */ - public function setCurlProxyPassword($proxyPassword) - { - $this->proxyPassword = $proxyPassword; - return $this; - } - - /** - * Gets the HTTP Proxy Password - * - * @return string - */ - public function getCurlProxyPassword() - { - return $this->proxyPassword; - } - /** * Sets debug flag * @@ -668,29 +360,6 @@ public function getTempFolderPath() return $this->tempFolderPath; } - /** - * Sets if SSL verification should be enabled or disabled - * - * @param boolean $sslVerification True if the certificate should be validated, false otherwise - * - * @return $this - */ - public function setSSLVerification($sslVerification) - { - $this->sslVerification = $sslVerification; - return $this; - } - - /** - * Gets if SSL verification should be enabled or disabled - * - * @return boolean True if the certificate should be validated, false otherwise - */ - public function getSSLVerification() - { - return $this->sslVerification; - } - /** * Gets the default configuration instance * @@ -732,4 +401,29 @@ public static function toDebugReport() 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..1bff5a7 --- /dev/null +++ b/lib/HeaderSelector.php @@ -0,0 +1,110 @@ +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/Block.php b/lib/Model/Block.php index 0e774ec..79d5a13 100644 --- a/lib/Model/Block.php +++ b/lib/Model/Block.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Block Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Block implements ArrayAccess +class Block implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Block'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -66,6 +69,7 @@ class Block implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -79,18 +83,30 @@ class Block implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -120,9 +136,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -136,34 +152,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -178,40 +223,40 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['broadcast_id'] === null) { - $invalid_properties[] = "'broadcast_id' can't be null"; + $invalidProperties[] = "'broadcast_id' can't be null"; } if ($this->container['start'] === null) { - $invalid_properties[] = "'start' can't be null"; + $invalidProperties[] = "'start' can't be null"; } if ($this->container['stop'] === null) { - $invalid_properties[] = "'stop' can't be null"; + $invalidProperties[] = "'stop' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -246,6 +291,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -255,7 +301,9 @@ public function getId() /** * Sets id + * * @param int $id ID of the current Block. + * * @return $this */ public function setId($id) @@ -267,6 +315,7 @@ public function setId($id) /** * Gets broadcast_id + * * @return int */ public function getBroadcastId() @@ -276,7 +325,9 @@ public function getBroadcastId() /** * Sets broadcast_id + * * @param int $broadcast_id Currently assigned Broadcast connected to the current Block, identified by the Broadcast ID. + * * @return $this */ public function setBroadcastId($broadcast_id) @@ -288,6 +339,7 @@ public function setBroadcastId($broadcast_id) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -297,7 +349,9 @@ public function getStart() /** * Sets start + * * @param \DateTime $start Start of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setStart($start) @@ -309,6 +363,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -318,7 +373,9 @@ public function getStop() /** * Sets stop + * * @param \DateTime $stop End of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setStop($stop) @@ -330,6 +387,7 @@ public function setStop($stop) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -339,7 +397,9 @@ public function getCreatedAt() /** * Sets created_at + * * @param \DateTime $created_at Time of the creation of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setCreatedAt($created_at) @@ -351,6 +411,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -360,7 +421,9 @@ public function getUpdatedAt() /** * Sets updated_at + * * @param \DateTime $updated_at Time of the last update of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setUpdatedAt($updated_at) @@ -372,6 +435,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -381,7 +445,9 @@ public function getDeletedAt() /** * Sets deleted_at + * * @param \DateTime $deleted_at Moment when the Block got deleted (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setDeletedAt($deleted_at) @@ -393,6 +459,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -402,7 +469,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -413,7 +482,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -423,7 +494,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -433,8 +506,10 @@ 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 */ public function offsetSet($offset, $value) @@ -448,7 +523,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -458,15 +535,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockRelations.php b/lib/Model/BlockRelations.php index 855e549..8ce28e4 100644 --- a/lib/Model/BlockRelations.php +++ b/lib/Model/BlockRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockRelations implements ArrayAccess +class BlockRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +64,7 @@ class BlockRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -69,18 +73,30 @@ class BlockRelations implements ArrayAccess 'program' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -89,9 +105,9 @@ public static function swaggerFormats() 'program' => 'program' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -100,9 +116,9 @@ public static function swaggerFormats() 'program' => 'setProgram' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,34 +127,63 @@ public static function swaggerFormats() 'program' => 'getProgram' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -148,19 +193,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -174,6 +219,7 @@ public function valid() /** * Gets items + * * @return \RadioManager\Model\BlockRelationsItems */ public function getItems() @@ -183,7 +229,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\BlockRelationsItems $items + * + * @param \RadioManager\Model\BlockRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -195,6 +243,7 @@ public function setItems($items) /** * Gets broadcast + * * @return \RadioManager\Model\BlockRelationsBroadcast */ public function getBroadcast() @@ -204,7 +253,9 @@ public function getBroadcast() /** * Sets broadcast - * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast + * + * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast broadcast + * * @return $this */ public function setBroadcast($broadcast) @@ -216,6 +267,7 @@ public function setBroadcast($broadcast) /** * Gets program + * * @return \RadioManager\Model\BlockRelationsProgram */ public function getProgram() @@ -225,7 +277,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\BlockRelationsProgram $program + * + * @param \RadioManager\Model\BlockRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -236,7 +290,9 @@ public function setProgram($program) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -246,7 +302,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -256,8 +314,10 @@ 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 */ public function offsetSet($offset, $value) @@ -271,7 +331,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -281,15 +343,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockRelationsBroadcast.php b/lib/Model/BlockRelationsBroadcast.php index b7128cd..ad70286 100644 --- a/lib/Model/BlockRelationsBroadcast.php +++ b/lib/Model/BlockRelationsBroadcast.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockRelationsBroadcast Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockRelationsBroadcast implements ArrayAccess +class BlockRelationsBroadcast implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockRelations_broadcast'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BlockRelationsBroadcast implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BlockRelationsBroadcast implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockRelationsBroadcastParams.php b/lib/Model/BlockRelationsBroadcastParams.php index 761fcc6..295ba58 100644 --- a/lib/Model/BlockRelationsBroadcastParams.php +++ b/lib/Model/BlockRelationsBroadcastParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockRelationsBroadcastParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockRelationsBroadcastParams implements ArrayAccess +class BlockRelationsBroadcastParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockRelations_broadcast_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class BlockRelationsBroadcastParams implements ArrayAccess /** * 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 + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -171,7 +217,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -182,7 +230,9 @@ public function setId($id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockRelationsItems.php b/lib/Model/BlockRelationsItems.php index 01eebd8..3d4c2b6 100644 --- a/lib/Model/BlockRelationsItems.php +++ b/lib/Model/BlockRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockRelationsItems implements ArrayAccess +class BlockRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BlockRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BlockRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsItemsParams $params + * + * @param \RadioManager\Model\BlockRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockRelationsItemsParams.php b/lib/Model/BlockRelationsItemsParams.php index 35921b0..3624046 100644 --- a/lib/Model/BlockRelationsItemsParams.php +++ b/lib/Model/BlockRelationsItemsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockRelationsItemsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockRelationsItemsParams implements ArrayAccess +class BlockRelationsItemsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockRelations_items_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class BlockRelationsItemsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'block_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'block_id' => 'block_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'block_id' => 'setBlockId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'block_id' => 'getBlockId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets block_id + * * @return int */ public function getBlockId() @@ -171,7 +217,9 @@ public function getBlockId() /** * Sets block_id - * @param int $block_id + * + * @param int $block_id block_id + * * @return $this */ public function setBlockId($block_id) @@ -182,7 +230,9 @@ public function setBlockId($block_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockRelationsProgram.php b/lib/Model/BlockRelationsProgram.php index 2baf9c9..a664dc1 100644 --- a/lib/Model/BlockRelationsProgram.php +++ b/lib/Model/BlockRelationsProgram.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockRelationsProgram Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockRelationsProgram implements ArrayAccess +class BlockRelationsProgram implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockRelations_program'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BlockRelationsProgram implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BlockRelationsProgram implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockResult.php b/lib/Model/BlockResult.php index a1a7d68..d6ebcb8 100644 --- a/lib/Model/BlockResult.php +++ b/lib/Model/BlockResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockResult implements ArrayAccess +class BlockResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -69,6 +72,7 @@ class BlockResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -85,18 +89,30 @@ class BlockResult implements ArrayAccess 'program' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -113,9 +129,9 @@ public static function swaggerFormats() 'program' => 'program' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -132,9 +148,9 @@ public static function swaggerFormats() 'program' => 'setProgram' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -151,34 +167,63 @@ public static function swaggerFormats() 'program' => 'getProgram' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -196,40 +241,40 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['broadcast_id'] === null) { - $invalid_properties[] = "'broadcast_id' can't be null"; + $invalidProperties[] = "'broadcast_id' can't be null"; } if ($this->container['start'] === null) { - $invalid_properties[] = "'start' can't be null"; + $invalidProperties[] = "'start' can't be null"; } if ($this->container['stop'] === null) { - $invalid_properties[] = "'stop' can't be null"; + $invalidProperties[] = "'stop' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -264,6 +309,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -273,7 +319,9 @@ public function getId() /** * Sets id + * * @param int $id ID of the current Block. + * * @return $this */ public function setId($id) @@ -285,6 +333,7 @@ public function setId($id) /** * Gets broadcast_id + * * @return int */ public function getBroadcastId() @@ -294,7 +343,9 @@ public function getBroadcastId() /** * Sets broadcast_id + * * @param int $broadcast_id Currently assigned Broadcast connected to the current Block, identified by the Broadcast ID. + * * @return $this */ public function setBroadcastId($broadcast_id) @@ -306,6 +357,7 @@ public function setBroadcastId($broadcast_id) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -315,7 +367,9 @@ public function getStart() /** * Sets start + * * @param \DateTime $start Start of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setStart($start) @@ -327,6 +381,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -336,7 +391,9 @@ public function getStop() /** * Sets stop + * * @param \DateTime $stop End of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setStop($stop) @@ -348,6 +405,7 @@ public function setStop($stop) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -357,7 +415,9 @@ public function getCreatedAt() /** * Sets created_at + * * @param \DateTime $created_at Time of the creation of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setCreatedAt($created_at) @@ -369,6 +429,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -378,7 +439,9 @@ public function getUpdatedAt() /** * Sets updated_at + * * @param \DateTime $updated_at Time of the last update of the Block (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setUpdatedAt($updated_at) @@ -390,6 +453,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -399,7 +463,9 @@ public function getDeletedAt() /** * Sets deleted_at + * * @param \DateTime $deleted_at Moment when the Block got deleted (formatted as a DateTime object), saved with an TimeZone. + * * @return $this */ public function setDeletedAt($deleted_at) @@ -411,6 +477,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -420,7 +487,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -432,6 +501,7 @@ public function setExternalStationId($_external_station_id) /** * Gets items + * * @return \RadioManager\Model\BlockRelationsItems */ public function getItems() @@ -441,7 +511,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\BlockRelationsItems $items + * + * @param \RadioManager\Model\BlockRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -453,6 +525,7 @@ public function setItems($items) /** * Gets broadcast + * * @return \RadioManager\Model\BlockRelationsBroadcast */ public function getBroadcast() @@ -462,7 +535,9 @@ public function getBroadcast() /** * Sets broadcast - * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast + * + * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast broadcast + * * @return $this */ public function setBroadcast($broadcast) @@ -474,6 +549,7 @@ public function setBroadcast($broadcast) /** * Gets program + * * @return \RadioManager\Model\BlockRelationsProgram */ public function getProgram() @@ -483,7 +559,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\BlockRelationsProgram $program + * + * @param \RadioManager\Model\BlockRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -494,7 +572,9 @@ public function setProgram($program) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -504,7 +584,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -514,8 +596,10 @@ 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 */ public function offsetSet($offset, $value) @@ -529,7 +613,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -539,15 +625,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BlockResults.php b/lib/Model/BlockResults.php index 235c0cf..85d04d7 100644 --- a/lib/Model/BlockResults.php +++ b/lib/Model/BlockResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BlockResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BlockResults implements ArrayAccess +class BlockResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BlockResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class BlockResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class BlockResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\BlockResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\BlockResult[] $results + * + * @param \RadioManager\Model\BlockResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Broadcast.php b/lib/Model/Broadcast.php index 59cf729..7a0725b 100644 --- a/lib/Model/Broadcast.php +++ b/lib/Model/Broadcast.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Broadcast Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Broadcast implements ArrayAccess +class Broadcast implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Broadcast'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -80,6 +83,7 @@ class Broadcast implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -107,18 +111,30 @@ class Broadcast implements ArrayAccess 'pty_code_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -146,9 +162,9 @@ public static function swaggerFormats() 'pty_code_id' => 'pty_code_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -176,9 +192,9 @@ public static function swaggerFormats() 'pty_code_id' => 'setPtyCodeId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -206,38 +222,65 @@ public static function swaggerFormats() 'pty_code_id' => 'getPtyCodeId' ]; + /** + * 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 REPETITION_TYPE__1_WEEK = '1 week'; - const REPETITION_TYPE__2_WEEKS = '2 weeks'; - const REPETITION_TYPE__4_WEEKS = '4 weeks'; + const REPETITION_TYPE__2_WEEK = '2 week'; + const REPETITION_TYPE__4_WEEK = '4 week'; const REPETITION_TYPE__1_MONTH = '1 month'; /** * Gets allowable values of the enum + * * @return string[] */ public function getRepetitionTypeAllowableValues() { return [ self::REPETITION_TYPE__1_WEEK, - self::REPETITION_TYPE__2_WEEKS, - self::REPETITION_TYPE__4_WEEKS, + self::REPETITION_TYPE__2_WEEK, + self::REPETITION_TYPE__4_WEEK, self::REPETITION_TYPE__1_MONTH, ]; } @@ -245,13 +288,16 @@ public function getRepetitionTypeAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -280,31 +326,27 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - if (!is_null($this->container['pty_code_id']) && ($this->container['pty_code_id'] < 1)) { - $invalid_properties[] = "invalid value for 'pty_code_id', must be bigger than or equal to 1."; - } - - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -312,11 +354,8 @@ public function listInvalidProperties() public function valid() { - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - return false; - } - if ($this->container['pty_code_id'] < 1) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { return false; } return true; @@ -325,6 +364,7 @@ public function valid() /** * Gets program_id + * * @return int */ public function getProgramId() @@ -334,7 +374,9 @@ public function getProgramId() /** * Sets program_id - * @param int $program_id + * + * @param int $program_id program_id + * * @return $this */ public function setProgramId($program_id) @@ -346,6 +388,7 @@ public function setProgramId($program_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -355,7 +398,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -367,6 +412,7 @@ public function setModelTypeId($model_type_id) /** * Gets station_id + * * @return int */ public function getStationId() @@ -376,7 +422,9 @@ public function getStationId() /** * Sets station_id - * @param int $station_id + * + * @param int $station_id station_id + * * @return $this */ public function setStationId($station_id) @@ -388,6 +436,7 @@ public function setStationId($station_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -397,7 +446,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -409,6 +460,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -418,7 +470,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -430,6 +484,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -439,7 +494,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -451,6 +508,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -460,7 +518,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -472,6 +532,7 @@ public function setStop($stop) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -481,7 +542,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -493,6 +556,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -502,7 +566,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -514,6 +580,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -523,7 +590,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -535,6 +604,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -544,7 +614,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -556,6 +628,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -565,7 +638,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -577,6 +652,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -586,7 +662,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -598,6 +676,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -607,7 +686,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -619,6 +700,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -628,7 +710,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -640,6 +724,7 @@ public function setLanguage($language) /** * Gets published + * * @return bool */ public function getPublished() @@ -649,7 +734,9 @@ public function getPublished() /** * Sets published - * @param bool $published + * + * @param bool $published published + * * @return $this */ public function setPublished($published) @@ -661,6 +748,7 @@ public function setPublished($published) /** * Gets repetition_uid + * * @return string */ public function getRepetitionUid() @@ -670,7 +758,9 @@ public function getRepetitionUid() /** * Sets repetition_uid - * @param string $repetition_uid + * + * @param string $repetition_uid repetition_uid + * * @return $this */ public function setRepetitionUid($repetition_uid) @@ -682,6 +772,7 @@ public function setRepetitionUid($repetition_uid) /** * Gets repetition_type + * * @return string */ public function getRepetitionType() @@ -691,17 +782,19 @@ public function getRepetitionType() /** * Sets repetition_type - * @param string $repetition_type + * + * @param string $repetition_type repetition_type + * * @return $this */ public function setRepetitionType($repetition_type) { - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!is_null($repetition_type) && !in_array($repetition_type, $allowed_values)) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!is_null($repetition_type) && !in_array($repetition_type, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -712,6 +805,7 @@ public function setRepetitionType($repetition_type) /** * Gets repetition_end + * * @return \DateTime */ public function getRepetitionEnd() @@ -721,7 +815,9 @@ public function getRepetitionEnd() /** * Sets repetition_end - * @param \DateTime $repetition_end + * + * @param \DateTime $repetition_end repetition_end + * * @return $this */ public function setRepetitionEnd($repetition_end) @@ -733,6 +829,7 @@ public function setRepetitionEnd($repetition_end) /** * Gets repetition_start + * * @return \DateTime */ public function getRepetitionStart() @@ -742,7 +839,9 @@ public function getRepetitionStart() /** * Sets repetition_start - * @param \DateTime $repetition_start + * + * @param \DateTime $repetition_start repetition_start + * * @return $this */ public function setRepetitionStart($repetition_start) @@ -754,6 +853,7 @@ public function setRepetitionStart($repetition_start) /** * Gets repetition_days + * * @return string */ public function getRepetitionDays() @@ -763,7 +863,9 @@ public function getRepetitionDays() /** * Sets repetition_days - * @param string $repetition_days + * + * @param string $repetition_days repetition_days + * * @return $this */ public function setRepetitionDays($repetition_days) @@ -775,6 +877,7 @@ public function setRepetitionDays($repetition_days) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -784,23 +887,22 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) { - - if (!is_null($pty_code_id) && ($pty_code_id < 1)) { - throw new \InvalidArgumentException('invalid value for $pty_code_id when calling Broadcast., must be bigger than or equal to 1.'); - } - $this->container['pty_code_id'] = $pty_code_id; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -810,7 +912,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -820,8 +924,10 @@ 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 */ public function offsetSet($offset, $value) @@ -835,7 +941,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -845,15 +953,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastDataInput.php b/lib/Model/BroadcastDataInput.php index 6f8c7c2..3e2dcb0 100644 --- a/lib/Model/BroadcastDataInput.php +++ b/lib/Model/BroadcastDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastDataInput implements ArrayAccess +class BroadcastDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -82,6 +85,7 @@ class BroadcastDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -111,18 +115,30 @@ class BroadcastDataInput implements ArrayAccess 'presenters' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -152,9 +168,9 @@ public static function swaggerFormats() 'presenters' => 'presenters' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -184,9 +200,9 @@ public static function swaggerFormats() 'presenters' => 'setPresenters' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -216,38 +232,65 @@ public static function swaggerFormats() 'presenters' => 'getPresenters' ]; + /** + * 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 REPETITION_TYPE__1_WEEK = '1 week'; - const REPETITION_TYPE__2_WEEKS = '2 weeks'; - const REPETITION_TYPE__4_WEEKS = '4 weeks'; + const REPETITION_TYPE__2_WEEK = '2 week'; + const REPETITION_TYPE__4_WEEK = '4 week'; const REPETITION_TYPE__1_MONTH = '1 month'; /** * Gets allowable values of the enum + * * @return string[] */ public function getRepetitionTypeAllowableValues() { return [ self::REPETITION_TYPE__1_WEEK, - self::REPETITION_TYPE__2_WEEKS, - self::REPETITION_TYPE__4_WEEKS, + self::REPETITION_TYPE__2_WEEK, + self::REPETITION_TYPE__4_WEEK, self::REPETITION_TYPE__1_MONTH, ]; } @@ -255,13 +298,16 @@ public function getRepetitionTypeAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -292,31 +338,27 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - if (!is_null($this->container['pty_code_id']) && ($this->container['pty_code_id'] < 1)) { - $invalid_properties[] = "invalid value for 'pty_code_id', must be bigger than or equal to 1."; - } - - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -324,11 +366,8 @@ public function listInvalidProperties() public function valid() { - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - return false; - } - if ($this->container['pty_code_id'] < 1) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { return false; } return true; @@ -337,6 +376,7 @@ public function valid() /** * Gets program_id + * * @return int */ public function getProgramId() @@ -346,7 +386,9 @@ public function getProgramId() /** * Sets program_id - * @param int $program_id + * + * @param int $program_id program_id + * * @return $this */ public function setProgramId($program_id) @@ -358,6 +400,7 @@ public function setProgramId($program_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -367,7 +410,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -379,6 +424,7 @@ public function setModelTypeId($model_type_id) /** * Gets station_id + * * @return int */ public function getStationId() @@ -388,7 +434,9 @@ public function getStationId() /** * Sets station_id - * @param int $station_id + * + * @param int $station_id station_id + * * @return $this */ public function setStationId($station_id) @@ -400,6 +448,7 @@ public function setStationId($station_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -409,7 +458,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -421,6 +472,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -430,7 +482,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -442,6 +496,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -451,7 +506,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -463,6 +520,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -472,7 +530,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -484,6 +544,7 @@ public function setStop($stop) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -493,7 +554,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -505,6 +568,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -514,7 +578,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -526,6 +592,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -535,7 +602,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -547,6 +616,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -556,7 +626,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -568,6 +640,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -577,7 +650,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -589,6 +664,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -598,7 +674,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -610,6 +688,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -619,7 +698,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -631,6 +712,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -640,7 +722,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -652,6 +736,7 @@ public function setLanguage($language) /** * Gets published + * * @return bool */ public function getPublished() @@ -661,7 +746,9 @@ public function getPublished() /** * Sets published - * @param bool $published + * + * @param bool $published published + * * @return $this */ public function setPublished($published) @@ -673,6 +760,7 @@ public function setPublished($published) /** * Gets repetition_uid + * * @return string */ public function getRepetitionUid() @@ -682,7 +770,9 @@ public function getRepetitionUid() /** * Sets repetition_uid - * @param string $repetition_uid + * + * @param string $repetition_uid repetition_uid + * * @return $this */ public function setRepetitionUid($repetition_uid) @@ -694,6 +784,7 @@ public function setRepetitionUid($repetition_uid) /** * Gets repetition_type + * * @return string */ public function getRepetitionType() @@ -703,17 +794,19 @@ public function getRepetitionType() /** * Sets repetition_type - * @param string $repetition_type + * + * @param string $repetition_type repetition_type + * * @return $this */ public function setRepetitionType($repetition_type) { - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!is_null($repetition_type) && !in_array($repetition_type, $allowed_values)) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!is_null($repetition_type) && !in_array($repetition_type, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -724,6 +817,7 @@ public function setRepetitionType($repetition_type) /** * Gets repetition_end + * * @return \DateTime */ public function getRepetitionEnd() @@ -733,7 +827,9 @@ public function getRepetitionEnd() /** * Sets repetition_end - * @param \DateTime $repetition_end + * + * @param \DateTime $repetition_end repetition_end + * * @return $this */ public function setRepetitionEnd($repetition_end) @@ -745,6 +841,7 @@ public function setRepetitionEnd($repetition_end) /** * Gets repetition_start + * * @return \DateTime */ public function getRepetitionStart() @@ -754,7 +851,9 @@ public function getRepetitionStart() /** * Sets repetition_start - * @param \DateTime $repetition_start + * + * @param \DateTime $repetition_start repetition_start + * * @return $this */ public function setRepetitionStart($repetition_start) @@ -766,6 +865,7 @@ public function setRepetitionStart($repetition_start) /** * Gets repetition_days + * * @return string */ public function getRepetitionDays() @@ -775,7 +875,9 @@ public function getRepetitionDays() /** * Sets repetition_days - * @param string $repetition_days + * + * @param string $repetition_days repetition_days + * * @return $this */ public function setRepetitionDays($repetition_days) @@ -787,6 +889,7 @@ public function setRepetitionDays($repetition_days) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -796,16 +899,13 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) { - - if (!is_null($pty_code_id) && ($pty_code_id < 1)) { - throw new \InvalidArgumentException('invalid value for $pty_code_id when calling BroadcastDataInput., must be bigger than or equal to 1.'); - } - $this->container['pty_code_id'] = $pty_code_id; return $this; @@ -813,6 +913,7 @@ public function setPtyCodeId($pty_code_id) /** * Gets tags + * * @return int[] */ public function getTags() @@ -822,7 +923,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -834,6 +937,7 @@ public function setTags($tags) /** * Gets presenters + * * @return int[] */ public function getPresenters() @@ -843,7 +947,9 @@ public function getPresenters() /** * Sets presenters - * @param int[] $presenters + * + * @param int[] $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -854,7 +960,9 @@ public function setPresenters($presenters) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -864,7 +972,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -874,8 +984,10 @@ 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 */ public function offsetSet($offset, $value) @@ -889,7 +1001,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -899,15 +1013,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastEPGDay.php b/lib/Model/BroadcastEPGDay.php index 2ced1b3..3a12961 100644 --- a/lib/Model/BroadcastEPGDay.php +++ b/lib/Model/BroadcastEPGDay.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastEPGDay Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastEPGDay implements ArrayAccess +class BroadcastEPGDay implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastEPGDay'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class BroadcastEPGDay implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class BroadcastEPGDay implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,22 +187,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['results'] === null) { - $invalid_properties[] = "'results' can't be null"; + $invalidProperties[] = "'results' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -174,6 +219,7 @@ public function valid() /** * Gets day + * * @return \DateTime */ public function getDay() @@ -183,7 +229,9 @@ public function getDay() /** * Sets day - * @param \DateTime $day + * + * @param \DateTime $day day + * * @return $this */ public function setDay($day) @@ -195,6 +243,7 @@ public function setDay($day) /** * Gets results + * * @return \RadioManager\Model\BroadcastEPGResult[] */ public function getResults() @@ -204,7 +253,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\BroadcastEPGResult[] $results + * + * @param \RadioManager\Model\BroadcastEPGResult[] $results results + * * @return $this */ public function setResults($results) @@ -215,7 +266,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +278,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +290,10 @@ 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 */ public function offsetSet($offset, $value) @@ -250,7 +307,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +319,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastEPGRelations.php b/lib/Model/BroadcastEPGRelations.php index dee4299..827e853 100644 --- a/lib/Model/BroadcastEPGRelations.php +++ b/lib/Model/BroadcastEPGRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastEPGRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastEPGRelations implements ArrayAccess +class BroadcastEPGRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastEPGRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class BroadcastEPGRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class BroadcastEPGRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,19 +211,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -192,6 +237,7 @@ public function valid() /** * Gets items + * * @return \RadioManager\Model\BroadcastRelationsItems */ public function getItems() @@ -201,7 +247,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\BroadcastRelationsItems $items + * + * @param \RadioManager\Model\BroadcastRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -213,6 +261,7 @@ public function setItems($items) /** * Gets blocks + * * @return \RadioManager\Model\BroadcastRelationsBlocks */ public function getBlocks() @@ -222,7 +271,9 @@ public function getBlocks() /** * Sets blocks - * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks + * + * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks blocks + * * @return $this */ public function setBlocks($blocks) @@ -234,6 +285,7 @@ public function setBlocks($blocks) /** * Gets program + * * @return \RadioManager\Model\BlockRelationsProgram */ public function getProgram() @@ -243,7 +295,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\BlockRelationsProgram $program + * + * @param \RadioManager\Model\BlockRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -255,6 +309,7 @@ public function setProgram($program) /** * Gets tags + * * @return \RadioManager\Model\BroadcastRelationsTags */ public function getTags() @@ -264,7 +319,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\BroadcastRelationsTags $tags + * + * @param \RadioManager\Model\BroadcastRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -276,6 +333,7 @@ public function setTags($tags) /** * Gets presenters + * * @return \RadioManager\Model\PresenterEPGResult[] */ public function getPresenters() @@ -285,7 +343,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\PresenterEPGResult[] $presenters + * + * @param \RadioManager\Model\PresenterEPGResult[] $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -297,6 +357,7 @@ public function setPresenters($presenters) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -306,7 +367,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -317,7 +380,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -327,7 +392,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -337,8 +404,10 @@ 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 */ public function offsetSet($offset, $value) @@ -352,7 +421,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -362,15 +433,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastEPGResult.php b/lib/Model/BroadcastEPGResult.php index 7d0d726..ca9dc51 100644 --- a/lib/Model/BroadcastEPGResult.php +++ b/lib/Model/BroadcastEPGResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastEPGResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastEPGResult implements ArrayAccess +class BroadcastEPGResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastEPGResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -91,6 +94,7 @@ class BroadcastEPGResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -129,18 +133,30 @@ class BroadcastEPGResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -179,9 +195,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -220,9 +236,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -261,38 +277,65 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 REPETITION_TYPE__1_WEEK = '1 week'; - const REPETITION_TYPE__2_WEEKS = '2 weeks'; - const REPETITION_TYPE__4_WEEKS = '4 weeks'; + const REPETITION_TYPE__2_WEEK = '2 week'; + const REPETITION_TYPE__4_WEEK = '4 week'; const REPETITION_TYPE__1_MONTH = '1 month'; /** * Gets allowable values of the enum + * * @return string[] */ public function getRepetitionTypeAllowableValues() { return [ self::REPETITION_TYPE__1_WEEK, - self::REPETITION_TYPE__2_WEEKS, - self::REPETITION_TYPE__4_WEEKS, + self::REPETITION_TYPE__2_WEEK, + self::REPETITION_TYPE__4_WEEK, self::REPETITION_TYPE__1_MONTH, ]; } @@ -300,13 +343,16 @@ public function getRepetitionTypeAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -346,43 +392,39 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - if (!is_null($this->container['pty_code_id']) && ($this->container['pty_code_id'] < 1)) { - $invalid_properties[] = "invalid value for 'pty_code_id', must be bigger than or equal to 1."; - } - - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -402,11 +444,8 @@ public function valid() if ($this->container['deleted_at'] === null) { return false; } - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - return false; - } - if ($this->container['pty_code_id'] < 1) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { return false; } return true; @@ -415,6 +454,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -424,7 +464,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -436,6 +478,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -445,7 +488,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -457,6 +502,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -466,7 +512,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -478,6 +526,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -487,7 +536,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -499,6 +550,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -508,7 +560,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -520,6 +574,7 @@ public function setExternalStationId($_external_station_id) /** * Gets program_id + * * @return int */ public function getProgramId() @@ -529,7 +584,9 @@ public function getProgramId() /** * Sets program_id - * @param int $program_id + * + * @param int $program_id program_id + * * @return $this */ public function setProgramId($program_id) @@ -541,6 +598,7 @@ public function setProgramId($program_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -550,7 +608,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -562,6 +622,7 @@ public function setModelTypeId($model_type_id) /** * Gets station_id + * * @return int */ public function getStationId() @@ -571,7 +632,9 @@ public function getStationId() /** * Sets station_id - * @param int $station_id + * + * @param int $station_id station_id + * * @return $this */ public function setStationId($station_id) @@ -583,6 +646,7 @@ public function setStationId($station_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -592,7 +656,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -604,6 +670,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -613,7 +680,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -625,6 +694,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -634,7 +704,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -646,6 +718,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -655,7 +728,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -667,6 +742,7 @@ public function setStop($stop) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -676,7 +752,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -688,6 +766,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -697,7 +776,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -709,6 +790,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -718,7 +800,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -730,6 +814,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -739,7 +824,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -751,6 +838,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -760,7 +848,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -772,6 +862,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -781,7 +872,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -793,6 +886,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -802,7 +896,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -814,6 +910,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -823,7 +920,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -835,6 +934,7 @@ public function setLanguage($language) /** * Gets published + * * @return bool */ public function getPublished() @@ -844,7 +944,9 @@ public function getPublished() /** * Sets published - * @param bool $published + * + * @param bool $published published + * * @return $this */ public function setPublished($published) @@ -856,6 +958,7 @@ public function setPublished($published) /** * Gets repetition_uid + * * @return string */ public function getRepetitionUid() @@ -865,7 +968,9 @@ public function getRepetitionUid() /** * Sets repetition_uid - * @param string $repetition_uid + * + * @param string $repetition_uid repetition_uid + * * @return $this */ public function setRepetitionUid($repetition_uid) @@ -877,6 +982,7 @@ public function setRepetitionUid($repetition_uid) /** * Gets repetition_type + * * @return string */ public function getRepetitionType() @@ -886,17 +992,19 @@ public function getRepetitionType() /** * Sets repetition_type - * @param string $repetition_type + * + * @param string $repetition_type repetition_type + * * @return $this */ public function setRepetitionType($repetition_type) { - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!is_null($repetition_type) && !in_array($repetition_type, $allowed_values)) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!is_null($repetition_type) && !in_array($repetition_type, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -907,6 +1015,7 @@ public function setRepetitionType($repetition_type) /** * Gets repetition_end + * * @return \DateTime */ public function getRepetitionEnd() @@ -916,7 +1025,9 @@ public function getRepetitionEnd() /** * Sets repetition_end - * @param \DateTime $repetition_end + * + * @param \DateTime $repetition_end repetition_end + * * @return $this */ public function setRepetitionEnd($repetition_end) @@ -928,6 +1039,7 @@ public function setRepetitionEnd($repetition_end) /** * Gets repetition_start + * * @return \DateTime */ public function getRepetitionStart() @@ -937,7 +1049,9 @@ public function getRepetitionStart() /** * Sets repetition_start - * @param \DateTime $repetition_start + * + * @param \DateTime $repetition_start repetition_start + * * @return $this */ public function setRepetitionStart($repetition_start) @@ -949,6 +1063,7 @@ public function setRepetitionStart($repetition_start) /** * Gets repetition_days + * * @return string */ public function getRepetitionDays() @@ -958,7 +1073,9 @@ public function getRepetitionDays() /** * Sets repetition_days - * @param string $repetition_days + * + * @param string $repetition_days repetition_days + * * @return $this */ public function setRepetitionDays($repetition_days) @@ -970,6 +1087,7 @@ public function setRepetitionDays($repetition_days) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -979,16 +1097,13 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) { - - if (!is_null($pty_code_id) && ($pty_code_id < 1)) { - throw new \InvalidArgumentException('invalid value for $pty_code_id when calling BroadcastEPGResult., must be bigger than or equal to 1.'); - } - $this->container['pty_code_id'] = $pty_code_id; return $this; @@ -996,6 +1111,7 @@ public function setPtyCodeId($pty_code_id) /** * Gets items + * * @return \RadioManager\Model\BroadcastRelationsItems */ public function getItems() @@ -1005,7 +1121,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\BroadcastRelationsItems $items + * + * @param \RadioManager\Model\BroadcastRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -1017,6 +1135,7 @@ public function setItems($items) /** * Gets blocks + * * @return \RadioManager\Model\BroadcastRelationsBlocks */ public function getBlocks() @@ -1026,7 +1145,9 @@ public function getBlocks() /** * Sets blocks - * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks + * + * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks blocks + * * @return $this */ public function setBlocks($blocks) @@ -1038,6 +1159,7 @@ public function setBlocks($blocks) /** * Gets program + * * @return \RadioManager\Model\BlockRelationsProgram */ public function getProgram() @@ -1047,7 +1169,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\BlockRelationsProgram $program + * + * @param \RadioManager\Model\BlockRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -1059,6 +1183,7 @@ public function setProgram($program) /** * Gets tags + * * @return \RadioManager\Model\BroadcastRelationsTags */ public function getTags() @@ -1068,7 +1193,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\BroadcastRelationsTags $tags + * + * @param \RadioManager\Model\BroadcastRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -1080,6 +1207,7 @@ public function setTags($tags) /** * Gets presenters + * * @return \RadioManager\Model\PresenterEPGResult[] */ public function getPresenters() @@ -1089,7 +1217,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\PresenterEPGResult[] $presenters + * + * @param \RadioManager\Model\PresenterEPGResult[] $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -1101,6 +1231,7 @@ public function setPresenters($presenters) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -1110,7 +1241,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -1121,7 +1254,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -1131,7 +1266,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -1141,8 +1278,10 @@ 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 */ public function offsetSet($offset, $value) @@ -1156,7 +1295,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -1166,15 +1307,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastInputOnly.php b/lib/Model/BroadcastInputOnly.php index 06b0afd..d60a6b1 100644 --- a/lib/Model/BroadcastInputOnly.php +++ b/lib/Model/BroadcastInputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastInputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastInputOnly implements ArrayAccess +class BroadcastInputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastInputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class BroadcastInputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class BroadcastInputOnly implements ArrayAccess 'presenters' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'presenters' => 'presenters' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'presenters' => 'setPresenters' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'presenters' => 'getPresenters' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,19 +187,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets tags + * * @return int[] */ public function getTags() @@ -177,7 +223,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -189,6 +237,7 @@ public function setTags($tags) /** * Gets presenters + * * @return int[] */ public function getPresenters() @@ -198,7 +247,9 @@ public function getPresenters() /** * Sets presenters - * @param int[] $presenters + * + * @param int[] $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -209,7 +260,9 @@ public function setPresenters($presenters) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +272,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +284,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +301,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +313,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastOutputOnly.php b/lib/Model/BroadcastOutputOnly.php index 1f109fb..78879c9 100644 --- a/lib/Model/BroadcastOutputOnly.php +++ b/lib/Model/BroadcastOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastOutputOnly implements ArrayAccess +class BroadcastOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -63,6 +66,7 @@ class BroadcastOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -73,18 +77,30 @@ class BroadcastOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,9 +111,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -108,9 +124,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -121,34 +137,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -160,31 +205,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -219,7 +265,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -231,6 +279,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -240,7 +289,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -252,6 +303,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -261,7 +313,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -273,6 +327,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -282,7 +337,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -294,6 +351,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -303,7 +361,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -314,7 +374,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -324,7 +386,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -334,8 +398,10 @@ 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 */ public function offsetSet($offset, $value) @@ -349,7 +415,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -359,15 +427,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelations.php b/lib/Model/BroadcastRelations.php index c533476..668ae79 100644 --- a/lib/Model/BroadcastRelations.php +++ b/lib/Model/BroadcastRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,30 +30,34 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelations implements ArrayAccess +class BroadcastRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ + 'genre' => '\RadioManager\Model\BroadcastRelationsGenre', 'items' => '\RadioManager\Model\BroadcastRelationsItems', 'blocks' => '\RadioManager\Model\BroadcastRelationsBlocks', 'program' => '\RadioManager\Model\BlockRelationsProgram', @@ -64,9 +68,11 @@ class BroadcastRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ + 'genre' => null, 'items' => null, 'blocks' => null, 'program' => null, @@ -75,21 +81,34 @@ class BroadcastRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'genre' => 'genre', 'items' => 'items', 'blocks' => 'blocks', 'program' => 'program', @@ -98,12 +117,13 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'genre' => 'setGenre', 'items' => 'setItems', 'blocks' => 'setBlocks', 'program' => 'setProgram', @@ -112,12 +132,13 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'genre' => 'getGenre', 'items' => 'getItems', 'blocks' => 'getBlocks', 'program' => 'getProgram', @@ -126,37 +147,67 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['genre'] = isset($data['genre']) ? $data['genre'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['blocks'] = isset($data['blocks']) ? $data['blocks'] : null; $this->container['program'] = isset($data['program']) ? $data['program'] : null; @@ -166,19 +217,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -190,8 +241,33 @@ public function valid() } + /** + * Gets genre + * + * @return \RadioManager\Model\BroadcastRelationsGenre + */ + public function getGenre() + { + return $this->container['genre']; + } + + /** + * Sets genre + * + * @param \RadioManager\Model\BroadcastRelationsGenre $genre genre + * + * @return $this + */ + public function setGenre($genre) + { + $this->container['genre'] = $genre; + + return $this; + } + /** * Gets items + * * @return \RadioManager\Model\BroadcastRelationsItems */ public function getItems() @@ -201,7 +277,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\BroadcastRelationsItems $items + * + * @param \RadioManager\Model\BroadcastRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -213,6 +291,7 @@ public function setItems($items) /** * Gets blocks + * * @return \RadioManager\Model\BroadcastRelationsBlocks */ public function getBlocks() @@ -222,7 +301,9 @@ public function getBlocks() /** * Sets blocks - * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks + * + * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks blocks + * * @return $this */ public function setBlocks($blocks) @@ -234,6 +315,7 @@ public function setBlocks($blocks) /** * Gets program + * * @return \RadioManager\Model\BlockRelationsProgram */ public function getProgram() @@ -243,7 +325,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\BlockRelationsProgram $program + * + * @param \RadioManager\Model\BlockRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -255,6 +339,7 @@ public function setProgram($program) /** * Gets tags + * * @return \RadioManager\Model\BroadcastRelationsTags */ public function getTags() @@ -264,7 +349,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\BroadcastRelationsTags $tags + * + * @param \RadioManager\Model\BroadcastRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -276,6 +363,7 @@ public function setTags($tags) /** * Gets presenters + * * @return \RadioManager\Model\BroadcastRelationsPresenters */ public function getPresenters() @@ -285,7 +373,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\BroadcastRelationsPresenters $presenters + * + * @param \RadioManager\Model\BroadcastRelationsPresenters $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -297,6 +387,7 @@ public function setPresenters($presenters) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -306,7 +397,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -317,7 +410,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -327,7 +422,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -337,8 +434,10 @@ 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 */ public function offsetSet($offset, $value) @@ -352,7 +451,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -362,15 +463,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsBlocks.php b/lib/Model/BroadcastRelationsBlocks.php index 968ec66..8fb9d7b 100644 --- a/lib/Model/BroadcastRelationsBlocks.php +++ b/lib/Model/BroadcastRelationsBlocks.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsBlocks Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsBlocks implements ArrayAccess +class BroadcastRelationsBlocks implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_blocks'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BroadcastRelationsBlocks implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BroadcastRelationsBlocks implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BroadcastRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BroadcastRelationsItemsParams $params + * + * @param \RadioManager\Model\BroadcastRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsGenre.php b/lib/Model/BroadcastRelationsGenre.php index b976012..a8ee2e7 100644 --- a/lib/Model/BroadcastRelationsGenre.php +++ b/lib/Model/BroadcastRelationsGenre.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsGenre Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsGenre implements ArrayAccess +class BroadcastRelationsGenre implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_genre'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BroadcastRelationsGenre implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BroadcastRelationsGenre implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsItems.php b/lib/Model/BroadcastRelationsItems.php index e126f59..b412678 100644 --- a/lib/Model/BroadcastRelationsItems.php +++ b/lib/Model/BroadcastRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsItems implements ArrayAccess +class BroadcastRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BroadcastRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BroadcastRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BroadcastRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BroadcastRelationsItemsParams $params + * + * @param \RadioManager\Model\BroadcastRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsItemsParams.php b/lib/Model/BroadcastRelationsItemsParams.php index 0559cb5..e44db81 100644 --- a/lib/Model/BroadcastRelationsItemsParams.php +++ b/lib/Model/BroadcastRelationsItemsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsItemsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsItemsParams implements ArrayAccess +class BroadcastRelationsItemsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_items_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class BroadcastRelationsItemsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'broadcast_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'broadcast_id' => 'broadcast_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'broadcast_id' => 'setBroadcastId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'broadcast_id' => 'getBroadcastId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets broadcast_id + * * @return int */ public function getBroadcastId() @@ -171,7 +217,9 @@ public function getBroadcastId() /** * Sets broadcast_id - * @param int $broadcast_id + * + * @param int $broadcast_id broadcast_id + * * @return $this */ public function setBroadcastId($broadcast_id) @@ -182,7 +230,9 @@ public function setBroadcastId($broadcast_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsModelType.php b/lib/Model/BroadcastRelationsModelType.php index 4e96c37..4a321b2 100644 --- a/lib/Model/BroadcastRelationsModelType.php +++ b/lib/Model/BroadcastRelationsModelType.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsModelType Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsModelType implements ArrayAccess +class BroadcastRelationsModelType implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_model_type'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BroadcastRelationsModelType implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BroadcastRelationsModelType implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsPresenters.php b/lib/Model/BroadcastRelationsPresenters.php index 937b38c..e9866b1 100644 --- a/lib/Model/BroadcastRelationsPresenters.php +++ b/lib/Model/BroadcastRelationsPresenters.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsPresenters Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsPresenters implements ArrayAccess +class BroadcastRelationsPresenters implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_presenters'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BroadcastRelationsPresenters implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BroadcastRelationsPresenters implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BroadcastRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BroadcastRelationsItemsParams $params + * + * @param \RadioManager\Model\BroadcastRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastRelationsTags.php b/lib/Model/BroadcastRelationsTags.php index 2a1774b..59f630b 100644 --- a/lib/Model/BroadcastRelationsTags.php +++ b/lib/Model/BroadcastRelationsTags.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastRelationsTags Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastRelationsTags implements ArrayAccess +class BroadcastRelationsTags implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastRelations_tags'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class BroadcastRelationsTags implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class BroadcastRelationsTags implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BroadcastRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BroadcastRelationsItemsParams $params + * + * @param \RadioManager\Model\BroadcastRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastResult.php b/lib/Model/BroadcastResult.php index 14fb3d7..c2e85b7 100644 --- a/lib/Model/BroadcastResult.php +++ b/lib/Model/BroadcastResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastResult implements ArrayAccess +class BroadcastResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -81,6 +84,7 @@ class BroadcastResult implements ArrayAccess 'repetition_start' => '\DateTime', 'repetition_days' => 'string', 'pty_code_id' => 'int', + 'genre' => '\RadioManager\Model\BroadcastRelationsGenre', 'items' => '\RadioManager\Model\BroadcastRelationsItems', 'blocks' => '\RadioManager\Model\BroadcastRelationsBlocks', 'program' => '\RadioManager\Model\BlockRelationsProgram', @@ -91,6 +95,7 @@ class BroadcastResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -121,6 +126,7 @@ class BroadcastResult implements ArrayAccess 'repetition_start' => 'date-time', 'repetition_days' => null, 'pty_code_id' => 'int64', + 'genre' => null, 'items' => null, 'blocks' => null, 'program' => null, @@ -129,18 +135,30 @@ class BroadcastResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -171,6 +189,7 @@ public static function swaggerFormats() 'repetition_start' => 'repetition_start', 'repetition_days' => 'repetition_days', 'pty_code_id' => 'pty_code_id', + 'genre' => 'genre', 'items' => 'items', 'blocks' => 'blocks', 'program' => 'program', @@ -179,9 +198,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -212,6 +231,7 @@ public static function swaggerFormats() 'repetition_start' => 'setRepetitionStart', 'repetition_days' => 'setRepetitionDays', 'pty_code_id' => 'setPtyCodeId', + 'genre' => 'setGenre', 'items' => 'setItems', 'blocks' => 'setBlocks', 'program' => 'setProgram', @@ -220,9 +240,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -253,6 +273,7 @@ public static function swaggerFormats() 'repetition_start' => 'getRepetitionStart', 'repetition_days' => 'getRepetitionDays', 'pty_code_id' => 'getPtyCodeId', + 'genre' => 'getGenre', 'items' => 'getItems', 'blocks' => 'getBlocks', 'program' => 'getProgram', @@ -261,38 +282,65 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 REPETITION_TYPE__1_WEEK = '1 week'; - const REPETITION_TYPE__2_WEEKS = '2 weeks'; - const REPETITION_TYPE__4_WEEKS = '4 weeks'; + const REPETITION_TYPE__2_WEEK = '2 week'; + const REPETITION_TYPE__4_WEEK = '4 week'; const REPETITION_TYPE__1_MONTH = '1 month'; /** * Gets allowable values of the enum + * * @return string[] */ public function getRepetitionTypeAllowableValues() { return [ self::REPETITION_TYPE__1_WEEK, - self::REPETITION_TYPE__2_WEEKS, - self::REPETITION_TYPE__4_WEEKS, + self::REPETITION_TYPE__2_WEEK, + self::REPETITION_TYPE__4_WEEK, self::REPETITION_TYPE__1_MONTH, ]; } @@ -300,13 +348,16 @@ public function getRepetitionTypeAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -337,6 +388,7 @@ public function __construct(array $data = null) $this->container['repetition_start'] = isset($data['repetition_start']) ? $data['repetition_start'] : null; $this->container['repetition_days'] = isset($data['repetition_days']) ? $data['repetition_days'] : null; $this->container['pty_code_id'] = isset($data['pty_code_id']) ? $data['pty_code_id'] : null; + $this->container['genre'] = isset($data['genre']) ? $data['genre'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['blocks'] = isset($data['blocks']) ? $data['blocks'] : null; $this->container['program'] = isset($data['program']) ? $data['program'] : null; @@ -346,43 +398,39 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - if (!is_null($this->container['pty_code_id']) && ($this->container['pty_code_id'] < 1)) { - $invalid_properties[] = "invalid value for 'pty_code_id', must be bigger than or equal to 1."; - } - - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -402,11 +450,8 @@ public function valid() if ($this->container['deleted_at'] === null) { return false; } - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!in_array($this->container['repetition_type'], $allowed_values)) { - return false; - } - if ($this->container['pty_code_id'] < 1) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!in_array($this->container['repetition_type'], $allowedValues)) { return false; } return true; @@ -415,6 +460,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -424,7 +470,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -436,6 +484,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -445,7 +494,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -457,6 +508,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -466,7 +518,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -478,6 +532,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -487,7 +542,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -499,6 +556,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -508,7 +566,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -520,6 +580,7 @@ public function setExternalStationId($_external_station_id) /** * Gets program_id + * * @return int */ public function getProgramId() @@ -529,7 +590,9 @@ public function getProgramId() /** * Sets program_id - * @param int $program_id + * + * @param int $program_id program_id + * * @return $this */ public function setProgramId($program_id) @@ -541,6 +604,7 @@ public function setProgramId($program_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -550,7 +614,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -562,6 +628,7 @@ public function setModelTypeId($model_type_id) /** * Gets station_id + * * @return int */ public function getStationId() @@ -571,7 +638,9 @@ public function getStationId() /** * Sets station_id - * @param int $station_id + * + * @param int $station_id station_id + * * @return $this */ public function setStationId($station_id) @@ -583,6 +652,7 @@ public function setStationId($station_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -592,7 +662,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -604,6 +676,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -613,7 +686,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -625,6 +700,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -634,7 +710,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -646,6 +724,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -655,7 +734,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -667,6 +748,7 @@ public function setStop($stop) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -676,7 +758,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -688,6 +772,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -697,7 +782,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -709,6 +796,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -718,7 +806,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -730,6 +820,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -739,7 +830,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -751,6 +844,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -760,7 +854,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -772,6 +868,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -781,7 +878,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -793,6 +892,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -802,7 +902,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -814,6 +916,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -823,7 +926,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -835,6 +940,7 @@ public function setLanguage($language) /** * Gets published + * * @return bool */ public function getPublished() @@ -844,7 +950,9 @@ public function getPublished() /** * Sets published - * @param bool $published + * + * @param bool $published published + * * @return $this */ public function setPublished($published) @@ -856,6 +964,7 @@ public function setPublished($published) /** * Gets repetition_uid + * * @return string */ public function getRepetitionUid() @@ -865,7 +974,9 @@ public function getRepetitionUid() /** * Sets repetition_uid - * @param string $repetition_uid + * + * @param string $repetition_uid repetition_uid + * * @return $this */ public function setRepetitionUid($repetition_uid) @@ -877,6 +988,7 @@ public function setRepetitionUid($repetition_uid) /** * Gets repetition_type + * * @return string */ public function getRepetitionType() @@ -886,17 +998,19 @@ public function getRepetitionType() /** * Sets repetition_type - * @param string $repetition_type + * + * @param string $repetition_type repetition_type + * * @return $this */ public function setRepetitionType($repetition_type) { - $allowed_values = $this->getRepetitionTypeAllowableValues(); - if (!is_null($repetition_type) && !in_array($repetition_type, $allowed_values)) { + $allowedValues = $this->getRepetitionTypeAllowableValues(); + if (!is_null($repetition_type) && !in_array($repetition_type, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'repetition_type', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -907,6 +1021,7 @@ public function setRepetitionType($repetition_type) /** * Gets repetition_end + * * @return \DateTime */ public function getRepetitionEnd() @@ -916,7 +1031,9 @@ public function getRepetitionEnd() /** * Sets repetition_end - * @param \DateTime $repetition_end + * + * @param \DateTime $repetition_end repetition_end + * * @return $this */ public function setRepetitionEnd($repetition_end) @@ -928,6 +1045,7 @@ public function setRepetitionEnd($repetition_end) /** * Gets repetition_start + * * @return \DateTime */ public function getRepetitionStart() @@ -937,7 +1055,9 @@ public function getRepetitionStart() /** * Sets repetition_start - * @param \DateTime $repetition_start + * + * @param \DateTime $repetition_start repetition_start + * * @return $this */ public function setRepetitionStart($repetition_start) @@ -949,6 +1069,7 @@ public function setRepetitionStart($repetition_start) /** * Gets repetition_days + * * @return string */ public function getRepetitionDays() @@ -958,7 +1079,9 @@ public function getRepetitionDays() /** * Sets repetition_days - * @param string $repetition_days + * + * @param string $repetition_days repetition_days + * * @return $this */ public function setRepetitionDays($repetition_days) @@ -970,6 +1093,7 @@ public function setRepetitionDays($repetition_days) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -979,23 +1103,45 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) { + $this->container['pty_code_id'] = $pty_code_id; - if (!is_null($pty_code_id) && ($pty_code_id < 1)) { - throw new \InvalidArgumentException('invalid value for $pty_code_id when calling BroadcastResult., must be bigger than or equal to 1.'); - } + return $this; + } - $this->container['pty_code_id'] = $pty_code_id; + /** + * Gets genre + * + * @return \RadioManager\Model\BroadcastRelationsGenre + */ + public function getGenre() + { + return $this->container['genre']; + } + + /** + * Sets genre + * + * @param \RadioManager\Model\BroadcastRelationsGenre $genre genre + * + * @return $this + */ + public function setGenre($genre) + { + $this->container['genre'] = $genre; return $this; } /** * Gets items + * * @return \RadioManager\Model\BroadcastRelationsItems */ public function getItems() @@ -1005,7 +1151,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\BroadcastRelationsItems $items + * + * @param \RadioManager\Model\BroadcastRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -1017,6 +1165,7 @@ public function setItems($items) /** * Gets blocks + * * @return \RadioManager\Model\BroadcastRelationsBlocks */ public function getBlocks() @@ -1026,7 +1175,9 @@ public function getBlocks() /** * Sets blocks - * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks + * + * @param \RadioManager\Model\BroadcastRelationsBlocks $blocks blocks + * * @return $this */ public function setBlocks($blocks) @@ -1038,6 +1189,7 @@ public function setBlocks($blocks) /** * Gets program + * * @return \RadioManager\Model\BlockRelationsProgram */ public function getProgram() @@ -1047,7 +1199,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\BlockRelationsProgram $program + * + * @param \RadioManager\Model\BlockRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -1059,6 +1213,7 @@ public function setProgram($program) /** * Gets tags + * * @return \RadioManager\Model\BroadcastRelationsTags */ public function getTags() @@ -1068,7 +1223,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\BroadcastRelationsTags $tags + * + * @param \RadioManager\Model\BroadcastRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -1080,6 +1237,7 @@ public function setTags($tags) /** * Gets presenters + * * @return \RadioManager\Model\BroadcastRelationsPresenters */ public function getPresenters() @@ -1089,7 +1247,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\BroadcastRelationsPresenters $presenters + * + * @param \RadioManager\Model\BroadcastRelationsPresenters $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -1101,6 +1261,7 @@ public function setPresenters($presenters) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -1110,7 +1271,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -1121,7 +1284,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -1131,7 +1296,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -1141,8 +1308,10 @@ 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 */ public function offsetSet($offset, $value) @@ -1156,7 +1325,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -1166,15 +1337,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/BroadcastResults.php b/lib/Model/BroadcastResults.php index b68e82e..2ca6f4a 100644 --- a/lib/Model/BroadcastResults.php +++ b/lib/Model/BroadcastResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * BroadcastResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class BroadcastResults implements ArrayAccess +class BroadcastResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'BroadcastResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class BroadcastResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class BroadcastResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\BroadcastResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\BroadcastResult[] $results + * + * @param \RadioManager\Model\BroadcastResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Campaign.php b/lib/Model/Campaign.php index 05c1458..490d163 100644 --- a/lib/Model/Campaign.php +++ b/lib/Model/Campaign.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Campaign Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Campaign implements ArrayAccess +class Campaign implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Campaign'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -65,6 +68,7 @@ class Campaign implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -77,18 +81,30 @@ class Campaign implements ArrayAccess 'description' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,9 +117,9 @@ public static function swaggerFormats() 'description' => 'description' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -116,9 +132,9 @@ public static function swaggerFormats() 'description' => 'setDescription' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -131,34 +147,63 @@ public static function swaggerFormats() 'description' => 'getDescription' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -172,28 +217,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['start'] === null) { - $invalid_properties[] = "'start' can't be null"; + $invalidProperties[] = "'start' can't be null"; } if ($this->container['stop'] === null) { - $invalid_properties[] = "'stop' can't be null"; + $invalidProperties[] = "'stop' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -225,7 +271,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -237,6 +285,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -246,7 +295,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -258,6 +309,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -267,7 +319,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -279,6 +333,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -288,7 +343,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -300,6 +357,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -309,7 +367,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -321,6 +381,7 @@ public function setStop($stop) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -330,7 +391,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -342,6 +405,7 @@ public function setRecommended($recommended) /** * Gets description + * * @return string */ public function getDescription() @@ -351,7 +415,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -362,7 +428,9 @@ public function setDescription($description) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -372,7 +440,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -382,8 +452,10 @@ 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 */ public function offsetSet($offset, $value) @@ -397,7 +469,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -407,15 +481,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignDataInput.php b/lib/Model/CampaignDataInput.php index 44d484c..945f450 100644 --- a/lib/Model/CampaignDataInput.php +++ b/lib/Model/CampaignDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignDataInput implements ArrayAccess +class CampaignDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -65,6 +68,7 @@ class CampaignDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -77,18 +81,30 @@ class CampaignDataInput implements ArrayAccess 'description' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,9 +117,9 @@ public static function swaggerFormats() 'description' => 'description' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -116,9 +132,9 @@ public static function swaggerFormats() 'description' => 'setDescription' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -131,34 +147,63 @@ public static function swaggerFormats() 'description' => 'getDescription' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -172,28 +217,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['start'] === null) { - $invalid_properties[] = "'start' can't be null"; + $invalidProperties[] = "'start' can't be null"; } if ($this->container['stop'] === null) { - $invalid_properties[] = "'stop' can't be null"; + $invalidProperties[] = "'stop' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -225,7 +271,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -237,6 +285,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -246,7 +295,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -258,6 +309,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -267,7 +319,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -279,6 +333,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -288,7 +343,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -300,6 +357,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -309,7 +367,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -321,6 +381,7 @@ public function setStop($stop) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -330,7 +391,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -342,6 +405,7 @@ public function setRecommended($recommended) /** * Gets description + * * @return string */ public function getDescription() @@ -351,7 +415,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -362,7 +428,9 @@ public function setDescription($description) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -372,7 +440,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -382,8 +452,10 @@ 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 */ public function offsetSet($offset, $value) @@ -397,7 +469,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -407,15 +481,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignOutputOnly.php b/lib/Model/CampaignOutputOnly.php index 3ba72bf..c1624ad 100644 --- a/lib/Model/CampaignOutputOnly.php +++ b/lib/Model/CampaignOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignOutputOnly implements ArrayAccess +class CampaignOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -58,12 +61,13 @@ class CampaignOutputOnly implements ArrayAccess 'updated_at' => '\DateTime', 'created_at' => '\DateTime', 'deleted_at' => '\DateTime', - 'item' => '\RadioManager\Model\Item[]', + 'item' => '\RadioManager\Model\CampaignTemplateItem', '_external_station_id' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class CampaignOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,31 +211,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -225,7 +271,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -237,6 +285,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -246,7 +295,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -258,6 +309,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -267,7 +319,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -279,6 +333,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -288,7 +343,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -300,7 +357,8 @@ public function setDeletedAt($deleted_at) /** * Gets item - * @return \RadioManager\Model\Item[] + * + * @return \RadioManager\Model\CampaignTemplateItem */ public function getItem() { @@ -309,7 +367,9 @@ public function getItem() /** * Sets item - * @param \RadioManager\Model\Item[] $item + * + * @param \RadioManager\Model\CampaignTemplateItem $item item + * * @return $this */ public function setItem($item) @@ -321,6 +381,7 @@ public function setItem($item) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -330,7 +391,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -341,7 +404,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -351,7 +416,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -361,8 +428,10 @@ 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 */ public function offsetSet($offset, $value) @@ -376,7 +445,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -386,15 +457,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignRelations.php b/lib/Model/CampaignRelations.php index e017804..0840cd0 100644 --- a/lib/Model/CampaignRelations.php +++ b/lib/Model/CampaignRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignRelations implements ArrayAccess +class CampaignRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class CampaignRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class CampaignRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,19 +187,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets items + * * @return \RadioManager\Model\CampaignRelationsItems */ public function getItems() @@ -177,7 +223,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\CampaignRelationsItems $items + * + * @param \RadioManager\Model\CampaignRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -189,6 +237,7 @@ public function setItems($items) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -198,7 +247,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -209,7 +260,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +272,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +284,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +301,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +313,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignRelationsItems.php b/lib/Model/CampaignRelationsItems.php index f718111..75ea1c4 100644 --- a/lib/Model/CampaignRelationsItems.php +++ b/lib/Model/CampaignRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignRelationsItems implements ArrayAccess +class CampaignRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class CampaignRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class CampaignRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\CampaignRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\CampaignRelationsItemsParams $params + * + * @param \RadioManager\Model\CampaignRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignRelationsItemsParams.php b/lib/Model/CampaignRelationsItemsParams.php index 8408f72..dcbe819 100644 --- a/lib/Model/CampaignRelationsItemsParams.php +++ b/lib/Model/CampaignRelationsItemsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignRelationsItemsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignRelationsItemsParams implements ArrayAccess +class CampaignRelationsItemsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignRelations_items_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class CampaignRelationsItemsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'campaign_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'campaign_id' => 'campaign_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'campaign_id' => 'setCampaignId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'campaign_id' => 'getCampaignId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets campaign_id + * * @return int */ public function getCampaignId() @@ -171,7 +217,9 @@ public function getCampaignId() /** * Sets campaign_id - * @param int $campaign_id + * + * @param int $campaign_id campaign_id + * * @return $this */ public function setCampaignId($campaign_id) @@ -182,7 +230,9 @@ public function setCampaignId($campaign_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignResult.php b/lib/Model/CampaignResult.php index 8bc6c9e..b956ec8 100644 --- a/lib/Model/CampaignResult.php +++ b/lib/Model/CampaignResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignResult implements ArrayAccess +class CampaignResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -58,7 +61,7 @@ class CampaignResult implements ArrayAccess 'updated_at' => '\DateTime', 'created_at' => '\DateTime', 'deleted_at' => '\DateTime', - 'item' => '\RadioManager\Model\Item[]', + 'item' => '\RadioManager\Model\CampaignTemplateItem', '_external_station_id' => 'int', 'model_type_id' => 'int', 'field_values' => 'object', @@ -73,6 +76,7 @@ class CampaignResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -93,18 +97,30 @@ class CampaignResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -125,9 +141,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -148,9 +164,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -171,34 +187,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -220,40 +265,40 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['start'] === null) { - $invalid_properties[] = "'start' can't be null"; + $invalidProperties[] = "'start' can't be null"; } if ($this->container['stop'] === null) { - $invalid_properties[] = "'stop' can't be null"; + $invalidProperties[] = "'stop' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -288,6 +333,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -297,7 +343,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -309,6 +357,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -318,7 +367,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -330,6 +381,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -339,7 +391,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -351,6 +405,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -360,7 +415,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -372,7 +429,8 @@ public function setDeletedAt($deleted_at) /** * Gets item - * @return \RadioManager\Model\Item[] + * + * @return \RadioManager\Model\CampaignTemplateItem */ public function getItem() { @@ -381,7 +439,9 @@ public function getItem() /** * Sets item - * @param \RadioManager\Model\Item[] $item + * + * @param \RadioManager\Model\CampaignTemplateItem $item item + * * @return $this */ public function setItem($item) @@ -393,6 +453,7 @@ public function setItem($item) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -402,7 +463,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -414,6 +477,7 @@ public function setExternalStationId($_external_station_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -423,7 +487,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -435,6 +501,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -444,7 +511,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -456,6 +525,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -465,7 +535,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -477,6 +549,7 @@ public function setTitle($title) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -486,7 +559,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -498,6 +573,7 @@ public function setStart($start) /** * Gets stop + * * @return \DateTime */ public function getStop() @@ -507,7 +583,9 @@ public function getStop() /** * Sets stop - * @param \DateTime $stop + * + * @param \DateTime $stop stop + * * @return $this */ public function setStop($stop) @@ -519,6 +597,7 @@ public function setStop($stop) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -528,7 +607,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -540,6 +621,7 @@ public function setRecommended($recommended) /** * Gets description + * * @return string */ public function getDescription() @@ -549,7 +631,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -561,6 +645,7 @@ public function setDescription($description) /** * Gets items + * * @return \RadioManager\Model\CampaignRelationsItems */ public function getItems() @@ -570,7 +655,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\CampaignRelationsItems $items + * + * @param \RadioManager\Model\CampaignRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -582,6 +669,7 @@ public function setItems($items) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -591,7 +679,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -602,7 +692,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -612,7 +704,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -622,8 +716,10 @@ 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 */ public function offsetSet($offset, $value) @@ -637,7 +733,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -647,15 +745,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignResults.php b/lib/Model/CampaignResults.php index 74ff483..bfc6820 100644 --- a/lib/Model/CampaignResults.php +++ b/lib/Model/CampaignResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * CampaignResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class CampaignResults implements ArrayAccess +class CampaignResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'CampaignResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class CampaignResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class CampaignResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\CampaignResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\CampaignResult[] $results + * + * @param \RadioManager\Model\CampaignResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/CampaignTemplateItem.php b/lib/Model/CampaignTemplateItem.php new file mode 100644 index 0000000..3b9af8c --- /dev/null +++ b/lib/Model/CampaignTemplateItem.php @@ -0,0 +1,512 @@ + 'int', + 'external_id' => 'string', + 'field_values' => 'object', + 'title' => 'string', + 'duration' => 'int', + 'recommended' => 'bool', + 'static_start' => 'bool', + '_deltas' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'model_type_id' => 'int64', + 'external_id' => null, + 'field_values' => null, + 'title' => null, + 'duration' => 'int64', + 'recommended' => null, + 'static_start' => null, + '_deltas' => 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 = [ + 'model_type_id' => 'model_type_id', + 'external_id' => 'external_id', + 'field_values' => 'field_values', + 'title' => 'title', + 'duration' => 'duration', + 'recommended' => 'recommended', + 'static_start' => 'static_start', + '_deltas' => '_deltas' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model_type_id' => 'setModelTypeId', + 'external_id' => 'setExternalId', + 'field_values' => 'setFieldValues', + 'title' => 'setTitle', + 'duration' => 'setDuration', + 'recommended' => 'setRecommended', + 'static_start' => 'setStaticStart', + '_deltas' => 'setDeltas' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model_type_id' => 'getModelTypeId', + 'external_id' => 'getExternalId', + 'field_values' => 'getFieldValues', + 'title' => 'getTitle', + 'duration' => 'getDuration', + 'recommended' => 'getRecommended', + 'static_start' => 'getStaticStart', + '_deltas' => 'getDeltas' + ]; + + /** + * 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['model_type_id'] = isset($data['model_type_id']) ? $data['model_type_id'] : null; + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + $this->container['field_values'] = isset($data['field_values']) ? $data['field_values'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null; + $this->container['recommended'] = isset($data['recommended']) ? $data['recommended'] : null; + $this->container['static_start'] = isset($data['static_start']) ? $data['static_start'] : null; + $this->container['_deltas'] = isset($data['_deltas']) ? $data['_deltas'] : 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 model_type_id + * + * @return int + */ + public function getModelTypeId() + { + return $this->container['model_type_id']; + } + + /** + * Sets model_type_id + * + * @param int $model_type_id model_type_id + * + * @return $this + */ + public function setModelTypeId($model_type_id) + { + $this->container['model_type_id'] = $model_type_id; + + return $this; + } + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id external_id + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + /** + * Gets field_values + * + * @return object + */ + public function getFieldValues() + { + return $this->container['field_values']; + } + + /** + * Sets field_values + * + * @param object $field_values field_values + * + * @return $this + */ + public function setFieldValues($field_values) + { + $this->container['field_values'] = $field_values; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets duration + * + * @return int + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param int $duration duration + * + * @return $this + */ + public function setDuration($duration) + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets recommended + * + * @return bool + */ + public function getRecommended() + { + return $this->container['recommended']; + } + + /** + * Sets recommended + * + * @param bool $recommended recommended + * + * @return $this + */ + public function setRecommended($recommended) + { + $this->container['recommended'] = $recommended; + + return $this; + } + + /** + * Gets static_start + * + * @return bool + */ + public function getStaticStart() + { + return $this->container['static_start']; + } + + /** + * Sets static_start + * + * @param bool $static_start static_start + * + * @return $this + */ + public function setStaticStart($static_start) + { + $this->container['static_start'] = $static_start; + + return $this; + } + + /** + * Gets _deltas + * + * @return object + */ + public function getDeltas() + { + return $this->container['_deltas']; + } + + /** + * Sets _deltas + * + * @param object $_deltas _deltas + * + * @return $this + */ + public function setDeltas($_deltas) + { + $this->container['_deltas'] = $_deltas; + + 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/Contact.php b/lib/Model/Contact.php index 660f78c..c52e0f9 100644 --- a/lib/Model/Contact.php +++ b/lib/Model/Contact.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,28 +30,31 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Contact Class Doc Comment * - * @category Class + * @category Class * @description Contact - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Contact implements ArrayAccess +class Contact implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Contact'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -65,6 +68,7 @@ class Contact implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -76,18 +80,30 @@ class Contact implements ArrayAccess 'phone' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -99,9 +115,9 @@ public static function swaggerFormats() 'phone' => 'phone' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -113,9 +129,9 @@ public static function swaggerFormats() 'phone' => 'setPhone' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -127,34 +143,63 @@ public static function swaggerFormats() 'phone' => 'getPhone' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -167,28 +212,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['firstname'] === null) { - $invalid_properties[] = "'firstname' can't be null"; + $invalidProperties[] = "'firstname' can't be null"; } if ($this->container['lastname'] === null) { - $invalid_properties[] = "'lastname' can't be null"; + $invalidProperties[] = "'lastname' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -211,6 +256,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -220,7 +266,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -232,6 +280,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -241,7 +290,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -253,6 +304,7 @@ public function setFieldValues($field_values) /** * Gets email + * * @return string */ public function getEmail() @@ -262,7 +314,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -274,6 +328,7 @@ public function setEmail($email) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -283,7 +338,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -295,6 +352,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -304,7 +362,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -316,6 +376,7 @@ public function setLastname($lastname) /** * Gets phone + * * @return string */ public function getPhone() @@ -325,7 +386,9 @@ public function getPhone() /** * Sets phone - * @param string $phone + * + * @param string $phone phone + * * @return $this */ public function setPhone($phone) @@ -336,7 +399,9 @@ public function setPhone($phone) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -346,7 +411,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -356,8 +423,10 @@ 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 */ public function offsetSet($offset, $value) @@ -371,7 +440,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -381,15 +452,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactDataInput.php b/lib/Model/ContactDataInput.php index 9f943d4..669aac2 100644 --- a/lib/Model/ContactDataInput.php +++ b/lib/Model/ContactDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactDataInput implements ArrayAccess +class ContactDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class ContactDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class ContactDataInput implements ArrayAccess 'phone' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'phone' => 'phone' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'phone' => 'setPhone' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'phone' => 'getPhone' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,28 +211,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['firstname'] === null) { - $invalid_properties[] = "'firstname' can't be null"; + $invalidProperties[] = "'firstname' can't be null"; } if ($this->container['lastname'] === null) { - $invalid_properties[] = "'lastname' can't be null"; + $invalidProperties[] = "'lastname' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -219,7 +265,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -231,6 +279,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -240,7 +289,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -252,6 +303,7 @@ public function setFieldValues($field_values) /** * Gets email + * * @return string */ public function getEmail() @@ -261,7 +313,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -273,6 +327,7 @@ public function setEmail($email) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -282,7 +337,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -294,6 +351,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -303,7 +361,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -315,6 +375,7 @@ public function setLastname($lastname) /** * Gets phone + * * @return string */ public function getPhone() @@ -324,7 +385,9 @@ public function getPhone() /** * Sets phone - * @param string $phone + * + * @param string $phone phone + * * @return $this */ public function setPhone($phone) @@ -335,7 +398,9 @@ public function setPhone($phone) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -345,7 +410,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -355,8 +422,10 @@ 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 */ public function offsetSet($offset, $value) @@ -370,7 +439,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -380,15 +451,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactOutputOnly.php b/lib/Model/ContactOutputOnly.php index 0fe1c0e..745e2e3 100644 --- a/lib/Model/ContactOutputOnly.php +++ b/lib/Model/ContactOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,28 +30,31 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactOutputOnly Class Doc Comment * - * @category Class + * @category Class * @description Contact - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactOutputOnly implements ArrayAccess +class ContactOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class ContactOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -74,18 +78,30 @@ class ContactOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -109,9 +125,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -122,34 +138,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -161,19 +206,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -187,6 +232,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -196,7 +242,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -208,6 +256,7 @@ public function setId($id) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -217,7 +266,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -229,6 +280,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -238,7 +290,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -250,6 +304,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -259,7 +314,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -271,6 +328,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -280,7 +338,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -291,7 +351,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -301,7 +363,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -311,8 +375,10 @@ 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 */ public function offsetSet($offset, $value) @@ -326,7 +392,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -336,15 +404,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactRelations.php b/lib/Model/ContactRelations.php index 245e356..f747b7b 100644 --- a/lib/Model/ContactRelations.php +++ b/lib/Model/ContactRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactRelations implements ArrayAccess +class ContactRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +64,7 @@ class ContactRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -69,18 +73,30 @@ class ContactRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -89,9 +105,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -100,9 +116,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,34 +127,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -148,19 +193,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + if ($this->container['tags'] === null) { + $invalidProperties[] = "'tags' can't be null"; + } + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,12 +216,16 @@ public function listInvalidProperties() public function valid() { + if ($this->container['tags'] === null) { + return false; + } return true; } /** * Gets tags + * * @return \RadioManager\Model\ContactRelationsTags */ public function getTags() @@ -183,7 +235,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\ContactRelationsTags $tags + * + * @param \RadioManager\Model\ContactRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -195,6 +249,7 @@ public function setTags($tags) /** * Gets items + * * @return \RadioManager\Model\ContactRelationsItems */ public function getItems() @@ -204,7 +259,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ContactRelationsItems $items + * + * @param \RadioManager\Model\ContactRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -216,6 +273,7 @@ public function setItems($items) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -225,7 +283,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -236,7 +296,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -246,7 +308,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -256,8 +320,10 @@ 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 */ public function offsetSet($offset, $value) @@ -271,7 +337,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -281,15 +349,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactRelationsItems.php b/lib/Model/ContactRelationsItems.php index 7bd15c8..f435b83 100644 --- a/lib/Model/ContactRelationsItems.php +++ b/lib/Model/ContactRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactRelationsItems implements ArrayAccess +class ContactRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ContactRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ContactRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ContactRelationsTagsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ContactRelationsTagsParams $params + * + * @param \RadioManager\Model\ContactRelationsTagsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactRelationsTags.php b/lib/Model/ContactRelationsTags.php index 62cdbd6..00caedc 100644 --- a/lib/Model/ContactRelationsTags.php +++ b/lib/Model/ContactRelationsTags.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactRelationsTags Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactRelationsTags implements ArrayAccess +class ContactRelationsTags implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactRelations_tags'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ContactRelationsTags implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ContactRelationsTags implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ContactRelationsTagsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ContactRelationsTagsParams $params + * + * @param \RadioManager\Model\ContactRelationsTagsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactRelationsTagsParams.php b/lib/Model/ContactRelationsTagsParams.php index 09b4f79..72fa7b9 100644 --- a/lib/Model/ContactRelationsTagsParams.php +++ b/lib/Model/ContactRelationsTagsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactRelationsTagsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactRelationsTagsParams implements ArrayAccess +class ContactRelationsTagsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactRelations_tags_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class ContactRelationsTagsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'contact_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'contact_id' => 'contact_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'contact_id' => 'setContactId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'contact_id' => 'getContactId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets contact_id + * * @return int */ public function getContactId() @@ -171,7 +217,9 @@ public function getContactId() /** * Sets contact_id - * @param int $contact_id + * + * @param int $contact_id contact_id + * * @return $this */ public function setContactId($contact_id) @@ -182,7 +230,9 @@ public function setContactId($contact_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactResult.php b/lib/Model/ContactResult.php index ad5a747..41ffdcf 100644 --- a/lib/Model/ContactResult.php +++ b/lib/Model/ContactResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactResult implements ArrayAccess +class ContactResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -72,6 +75,7 @@ class ContactResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -91,18 +95,30 @@ class ContactResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -122,9 +138,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -144,9 +160,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -166,34 +182,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -214,28 +259,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['firstname'] === null) { - $invalid_properties[] = "'firstname' can't be null"; + $invalidProperties[] = "'firstname' can't be null"; } if ($this->container['lastname'] === null) { - $invalid_properties[] = "'lastname' can't be null"; + $invalidProperties[] = "'lastname' can't be null"; + } + if ($this->container['tags'] === null) { + $invalidProperties[] = "'tags' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -252,12 +300,16 @@ public function valid() if ($this->container['lastname'] === null) { return false; } + if ($this->container['tags'] === null) { + return false; + } return true; } /** * Gets id + * * @return int */ public function getId() @@ -267,7 +319,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -279,6 +333,7 @@ public function setId($id) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -288,7 +343,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -300,6 +357,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -309,7 +367,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -321,6 +381,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -330,7 +391,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -342,6 +405,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -351,7 +415,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -363,6 +429,7 @@ public function setExternalStationId($_external_station_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -372,7 +439,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -384,6 +453,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -393,7 +463,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -405,6 +477,7 @@ public function setFieldValues($field_values) /** * Gets email + * * @return string */ public function getEmail() @@ -414,7 +487,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -426,6 +501,7 @@ public function setEmail($email) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -435,7 +511,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -447,6 +525,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -456,7 +535,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -468,6 +549,7 @@ public function setLastname($lastname) /** * Gets phone + * * @return string */ public function getPhone() @@ -477,7 +559,9 @@ public function getPhone() /** * Sets phone - * @param string $phone + * + * @param string $phone phone + * * @return $this */ public function setPhone($phone) @@ -489,6 +573,7 @@ public function setPhone($phone) /** * Gets tags + * * @return \RadioManager\Model\ContactRelationsTags */ public function getTags() @@ -498,7 +583,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\ContactRelationsTags $tags + * + * @param \RadioManager\Model\ContactRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -510,6 +597,7 @@ public function setTags($tags) /** * Gets items + * * @return \RadioManager\Model\ContactRelationsItems */ public function getItems() @@ -519,7 +607,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ContactRelationsItems $items + * + * @param \RadioManager\Model\ContactRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -531,6 +621,7 @@ public function setItems($items) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -540,7 +631,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -551,7 +644,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -561,7 +656,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -571,8 +668,10 @@ 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 */ public function offsetSet($offset, $value) @@ -586,7 +685,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -596,15 +697,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ContactResults.php b/lib/Model/ContactResults.php index 37ef9b7..bcc2cab 100644 --- a/lib/Model/ContactResults.php +++ b/lib/Model/ContactResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ContactResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ContactResults implements ArrayAccess +class ContactResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ContactResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class ContactResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class ContactResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\ContactResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\ContactResult[] $results + * + * @param \RadioManager\Model\ContactResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Data.php b/lib/Model/Data.php index 4c740e0..f539443 100644 --- a/lib/Model/Data.php +++ b/lib/Model/Data.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,131 +30,182 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Data Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Data implements ArrayAccess +class Data implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'data'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ 'start' => '\DateTime', + 'allow_playlist_past' => 'int', 'items' => '\RadioManager\Model\ImportItem[]' ]; /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'start' => 'date-time', + 'allow_playlist_past' => null, 'items' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'start' => 'start', + 'allow_playlist_past' => 'allow_playlist_past', 'items' => 'items' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'start' => 'setStart', + 'allow_playlist_past' => 'setAllowPlaylistPast', 'items' => 'setItems' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'start' => 'getStart', + 'allow_playlist_past' => 'getAllowPlaylistPast', 'items' => 'getItems' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { $this->container['start'] = isset($data['start']) ? $data['start'] : null; + $this->container['allow_playlist_past'] = isset($data['allow_playlist_past']) ? $data['allow_playlist_past'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +219,7 @@ public function valid() /** * Gets start + * * @return \DateTime */ public function getStart() @@ -177,7 +229,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -187,8 +241,33 @@ public function setStart($start) return $this; } + /** + * Gets allow_playlist_past + * + * @return int + */ + public function getAllowPlaylistPast() + { + return $this->container['allow_playlist_past']; + } + + /** + * Sets allow_playlist_past + * + * @param int $allow_playlist_past allow_playlist_past + * + * @return $this + */ + public function setAllowPlaylistPast($allow_playlist_past) + { + $this->container['allow_playlist_past'] = $allow_playlist_past; + + return $this; + } + /** * Gets items + * * @return \RadioManager\Model\ImportItem[] */ public function getItems() @@ -198,7 +277,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ImportItem[] $items + * + * @param \RadioManager\Model\ImportItem[] $items items + * * @return $this */ public function setItems($items) @@ -209,7 +290,9 @@ public function setItems($items) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +302,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +314,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +331,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +343,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Data1.php b/lib/Model/Data1.php index c5d9f26..10cac0c 100644 --- a/lib/Model/Data1.php +++ b/lib/Model/Data1.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,131 +30,182 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Data1 Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Data1 implements ArrayAccess +class Data1 implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'data_1'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ 'start' => '\DateTime', + 'allow_playlist_past' => 'int', 'items' => '\RadioManager\Model\ImportItem[]' ]; /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'start' => 'date-time', + 'allow_playlist_past' => null, 'items' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'start' => 'start', + 'allow_playlist_past' => 'allow_playlist_past', 'items' => 'items' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'start' => 'setStart', + 'allow_playlist_past' => 'setAllowPlaylistPast', 'items' => 'setItems' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'start' => 'getStart', + 'allow_playlist_past' => 'getAllowPlaylistPast', 'items' => 'getItems' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { $this->container['start'] = isset($data['start']) ? $data['start'] : null; + $this->container['allow_playlist_past'] = isset($data['allow_playlist_past']) ? $data['allow_playlist_past'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +219,7 @@ public function valid() /** * Gets start + * * @return \DateTime */ public function getStart() @@ -177,7 +229,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -187,8 +241,33 @@ public function setStart($start) return $this; } + /** + * Gets allow_playlist_past + * + * @return int + */ + public function getAllowPlaylistPast() + { + return $this->container['allow_playlist_past']; + } + + /** + * Sets allow_playlist_past + * + * @param int $allow_playlist_past allow_playlist_past + * + * @return $this + */ + public function setAllowPlaylistPast($allow_playlist_past) + { + $this->container['allow_playlist_past'] = $allow_playlist_past; + + return $this; + } + /** * Gets items + * * @return \RadioManager\Model\ImportItem[] */ public function getItems() @@ -198,7 +277,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ImportItem[] $items + * + * @param \RadioManager\Model\ImportItem[] $items items + * * @return $this */ public function setItems($items) @@ -209,7 +290,9 @@ public function setItems($items) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +302,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +314,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +331,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +343,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Data2.php b/lib/Model/Data2.php new file mode 100644 index 0000000..24af5e5 --- /dev/null +++ b/lib/Model/Data2.php @@ -0,0 +1,422 @@ + '\DateTime', + 'allow_playlist_past' => 'int', + 'before_id' => 'int', + 'previous_id' => 'int', + 'items' => '\RadioManager\Model\ImportItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'start' => 'date-time', + 'allow_playlist_past' => null, + 'before_id' => null, + 'previous_id' => null, + 'items' => 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 = [ + 'start' => 'start', + 'allow_playlist_past' => 'allow_playlist_past', + 'before_id' => 'before_id', + 'previous_id' => 'previous_id', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'allow_playlist_past' => 'setAllowPlaylistPast', + 'before_id' => 'setBeforeId', + 'previous_id' => 'setPreviousId', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'allow_playlist_past' => 'getAllowPlaylistPast', + 'before_id' => 'getBeforeId', + 'previous_id' => 'getPreviousId', + 'items' => 'getItems' + ]; + + /** + * 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['start'] = isset($data['start']) ? $data['start'] : null; + $this->container['allow_playlist_past'] = isset($data['allow_playlist_past']) ? $data['allow_playlist_past'] : null; + $this->container['before_id'] = isset($data['before_id']) ? $data['before_id'] : null; + $this->container['previous_id'] = isset($data['previous_id']) ? $data['previous_id'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : 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 start + * + * @return \DateTime + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param \DateTime $start start + * + * @return $this + */ + public function setStart($start) + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets allow_playlist_past + * + * @return int + */ + public function getAllowPlaylistPast() + { + return $this->container['allow_playlist_past']; + } + + /** + * Sets allow_playlist_past + * + * @param int $allow_playlist_past allow_playlist_past + * + * @return $this + */ + public function setAllowPlaylistPast($allow_playlist_past) + { + $this->container['allow_playlist_past'] = $allow_playlist_past; + + return $this; + } + + /** + * Gets before_id + * + * @return int + */ + public function getBeforeId() + { + return $this->container['before_id']; + } + + /** + * Sets before_id + * + * @param int $before_id before_id + * + * @return $this + */ + public function setBeforeId($before_id) + { + $this->container['before_id'] = $before_id; + + return $this; + } + + /** + * Gets previous_id + * + * @return int + */ + public function getPreviousId() + { + return $this->container['previous_id']; + } + + /** + * Sets previous_id + * + * @param int $previous_id previous_id + * + * @return $this + */ + public function setPreviousId($previous_id) + { + $this->container['previous_id'] = $previous_id; + + return $this; + } + + /** + * Gets items + * + * @return \RadioManager\Model\ImportItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \RadioManager\Model\ImportItem[] $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + 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/Data3.php b/lib/Model/Data3.php new file mode 100644 index 0000000..36aabe6 --- /dev/null +++ b/lib/Model/Data3.php @@ -0,0 +1,302 @@ + '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/EPGResults.php b/lib/Model/EPGResults.php index de0b81c..200b327 100644 --- a/lib/Model/EPGResults.php +++ b/lib/Model/EPGResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * EPGResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class EPGResults implements ArrayAccess +class EPGResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'EPGResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +64,7 @@ class EPGResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -69,18 +73,30 @@ class EPGResults implements ArrayAccess 'prev_page_url' => 'url' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -89,9 +105,9 @@ public static function swaggerFormats() 'prev_page_url' => 'prev_page_url' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -100,9 +116,9 @@ public static function swaggerFormats() 'prev_page_url' => 'setPrevPageUrl' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,34 +127,63 @@ public static function swaggerFormats() 'prev_page_url' => 'getPrevPageUrl' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -148,28 +193,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['days'] === null) { - $invalid_properties[] = "'days' can't be null"; + $invalidProperties[] = "'days' can't be null"; } if ($this->container['next_page_url'] === null) { - $invalid_properties[] = "'next_page_url' can't be null"; + $invalidProperties[] = "'next_page_url' can't be null"; } if ($this->container['prev_page_url'] === null) { - $invalid_properties[] = "'prev_page_url' can't be null"; + $invalidProperties[] = "'prev_page_url' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -192,6 +237,7 @@ public function valid() /** * Gets days + * * @return \RadioManager\Model\BroadcastEPGDay[] */ public function getDays() @@ -201,7 +247,9 @@ public function getDays() /** * Sets days - * @param \RadioManager\Model\BroadcastEPGDay[] $days + * + * @param \RadioManager\Model\BroadcastEPGDay[] $days days + * * @return $this */ public function setDays($days) @@ -213,6 +261,7 @@ public function setDays($days) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -222,7 +271,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -234,6 +285,7 @@ public function setNextPageUrl($next_page_url) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -243,7 +295,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -254,7 +308,9 @@ public function setPrevPageUrl($prev_page_url) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -264,7 +320,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -274,8 +332,10 @@ 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 */ public function offsetSet($offset, $value) @@ -289,7 +349,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -299,15 +361,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Forbidden.php b/lib/Model/Forbidden.php index d454fdd..a79d425 100644 --- a/lib/Model/Forbidden.php +++ b/lib/Model/Forbidden.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Forbidden Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Forbidden implements ArrayAccess +class Forbidden implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Forbidden'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class Forbidden implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class Forbidden implements ArrayAccess 'status_code' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'status_code' => 'statusCode' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'status_code' => 'setStatusCode' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'status_code' => 'getStatusCode' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,25 +187,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['error'] === null) { - $invalid_properties[] = "'error' can't be null"; + $invalidProperties[] = "'error' can't be null"; } if ($this->container['status_code'] === null) { - $invalid_properties[] = "'status_code' can't be null"; + $invalidProperties[] = "'status_code' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets error + * * @return string */ public function getError() @@ -189,7 +235,9 @@ public function getError() /** * Sets error + * * @param string $error Given error, describes the problem. + * * @return $this */ public function setError($error) @@ -201,6 +249,7 @@ public function setError($error) /** * Gets status_code + * * @return int */ public function getStatusCode() @@ -210,7 +259,9 @@ public function getStatusCode() /** * Sets status_code + * * @param int $status_code Assigned StatusCode, is used in order to create a relationship between Error and Response. + * * @return $this */ public function setStatusCode($status_code) @@ -221,7 +272,9 @@ public function setStatusCode($status_code) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -231,7 +284,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -241,8 +296,10 @@ 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 */ public function offsetSet($offset, $value) @@ -256,7 +313,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -266,15 +325,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Genre.php b/lib/Model/Genre.php index 72065b3..cbaad8a 100644 --- a/lib/Model/Genre.php +++ b/lib/Model/Genre.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Genre Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Genre implements ArrayAccess +class Genre implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Genre'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class Genre implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class Genre implements ArrayAccess 'name' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'name' => 'name' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'name' => 'setName' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'name' => 'getName' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,25 +199,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -192,6 +237,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -201,7 +247,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -213,6 +261,7 @@ public function setId($id) /** * Gets urn + * * @return string */ public function getUrn() @@ -222,7 +271,9 @@ public function getUrn() /** * Sets urn - * @param string $urn + * + * @param string $urn urn + * * @return $this */ public function setUrn($urn) @@ -234,6 +285,7 @@ public function setUrn($urn) /** * Gets parent_id + * * @return int */ public function getParentId() @@ -243,7 +295,9 @@ public function getParentId() /** * Sets parent_id - * @param int $parent_id + * + * @param int $parent_id parent_id + * * @return $this */ public function setParentId($parent_id) @@ -255,6 +309,7 @@ public function setParentId($parent_id) /** * Gets name + * * @return string */ public function getName() @@ -264,7 +319,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -275,7 +332,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -285,7 +344,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -295,8 +356,10 @@ 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 */ public function offsetSet($offset, $value) @@ -310,7 +373,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -320,15 +385,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreOutputOnly.php b/lib/Model/GenreOutputOnly.php index 0ff380c..5f72264 100644 --- a/lib/Model/GenreOutputOnly.php +++ b/lib/Model/GenreOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreOutputOnly implements ArrayAccess +class GenreOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class GenreOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -171,7 +217,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -182,7 +230,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreRelations.php b/lib/Model/GenreRelations.php index 69acd79..86e7809 100644 --- a/lib/Model/GenreRelations.php +++ b/lib/Model/GenreRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreRelations implements ArrayAccess +class GenreRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class GenreRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class GenreRelations implements ArrayAccess 'programs' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'programs' => 'programs' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'programs' => 'setPrograms' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'programs' => 'getPrograms' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,19 +187,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets broadcasts + * * @return \RadioManager\Model\GenreRelationsBroadcasts */ public function getBroadcasts() @@ -177,7 +223,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\GenreRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\GenreRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -189,6 +237,7 @@ public function setBroadcasts($broadcasts) /** * Gets programs + * * @return \RadioManager\Model\GenreRelationsPrograms */ public function getPrograms() @@ -198,7 +247,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\GenreRelationsPrograms $programs + * + * @param \RadioManager\Model\GenreRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -209,7 +260,9 @@ public function setPrograms($programs) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +272,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +284,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +301,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +313,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreRelationsBroadcasts.php b/lib/Model/GenreRelationsBroadcasts.php index d4f83a1..faff7f7 100644 --- a/lib/Model/GenreRelationsBroadcasts.php +++ b/lib/Model/GenreRelationsBroadcasts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreRelationsBroadcasts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreRelationsBroadcasts implements ArrayAccess +class GenreRelationsBroadcasts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreRelations_broadcasts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class GenreRelationsBroadcasts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class GenreRelationsBroadcasts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\GenreRelationsBroadcastsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\GenreRelationsBroadcastsParams $params + * + * @param \RadioManager\Model\GenreRelationsBroadcastsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreRelationsBroadcastsParams.php b/lib/Model/GenreRelationsBroadcastsParams.php index 750bb62..99c259b 100644 --- a/lib/Model/GenreRelationsBroadcastsParams.php +++ b/lib/Model/GenreRelationsBroadcastsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreRelationsBroadcastsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreRelationsBroadcastsParams implements ArrayAccess +class GenreRelationsBroadcastsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreRelations_broadcasts_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class GenreRelationsBroadcastsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'genre_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'genre_id' => 'genre_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'genre_id' => 'setGenreId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'genre_id' => 'getGenreId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -171,7 +217,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -182,7 +230,9 @@ public function setGenreId($genre_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreRelationsPrograms.php b/lib/Model/GenreRelationsPrograms.php index 9212e40..d798dcc 100644 --- a/lib/Model/GenreRelationsPrograms.php +++ b/lib/Model/GenreRelationsPrograms.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreRelationsPrograms Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreRelationsPrograms implements ArrayAccess +class GenreRelationsPrograms implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreRelations_programs'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class GenreRelationsPrograms implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class GenreRelationsPrograms implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\GenreRelationsBroadcastsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\GenreRelationsBroadcastsParams $params + * + * @param \RadioManager\Model\GenreRelationsBroadcastsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreResult.php b/lib/Model/GenreResult.php index c2531ec..ac7e716 100644 --- a/lib/Model/GenreResult.php +++ b/lib/Model/GenreResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreResult implements ArrayAccess +class GenreResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -65,6 +68,7 @@ class GenreResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -77,18 +81,30 @@ class GenreResult implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,9 +117,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -116,9 +132,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -131,34 +147,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -172,25 +217,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -219,7 +265,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -231,6 +279,7 @@ public function setId($id) /** * Gets urn + * * @return string */ public function getUrn() @@ -240,7 +289,9 @@ public function getUrn() /** * Sets urn - * @param string $urn + * + * @param string $urn urn + * * @return $this */ public function setUrn($urn) @@ -252,6 +303,7 @@ public function setUrn($urn) /** * Gets parent_id + * * @return int */ public function getParentId() @@ -261,7 +313,9 @@ public function getParentId() /** * Sets parent_id - * @param int $parent_id + * + * @param int $parent_id parent_id + * * @return $this */ public function setParentId($parent_id) @@ -273,6 +327,7 @@ public function setParentId($parent_id) /** * Gets name + * * @return string */ public function getName() @@ -282,7 +337,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -294,6 +351,7 @@ public function setName($name) /** * Gets broadcasts + * * @return \RadioManager\Model\GenreRelationsBroadcasts */ public function getBroadcasts() @@ -303,7 +361,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\GenreRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\GenreRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -315,6 +375,7 @@ public function setBroadcasts($broadcasts) /** * Gets programs + * * @return \RadioManager\Model\GenreRelationsPrograms */ public function getPrograms() @@ -324,7 +385,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\GenreRelationsPrograms $programs + * + * @param \RadioManager\Model\GenreRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -336,6 +399,7 @@ public function setPrograms($programs) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -345,7 +409,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -356,7 +422,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -366,7 +434,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -376,8 +446,10 @@ 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 */ public function offsetSet($offset, $value) @@ -391,7 +463,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -401,15 +475,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/GenreResults.php b/lib/Model/GenreResults.php index f359c19..aa9388a 100644 --- a/lib/Model/GenreResults.php +++ b/lib/Model/GenreResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * GenreResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class GenreResults implements ArrayAccess +class GenreResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'GenreResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class GenreResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class GenreResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\GenreResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\GenreResult[] $results + * + * @param \RadioManager\Model\GenreResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ImportItem.php b/lib/Model/ImportItem.php index 05c6cdc..174ac2e 100644 --- a/lib/Model/ImportItem.php +++ b/lib/Model/ImportItem.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ImportItem Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ImportItem implements ArrayAccess +class ImportItem implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ImportItem'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -69,6 +72,7 @@ class ImportItem implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -85,18 +89,30 @@ class ImportItem implements ArrayAccess 'tags' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -113,9 +129,9 @@ public static function swaggerFormats() 'tags' => 'tags' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -132,9 +148,9 @@ public static function swaggerFormats() 'tags' => 'setTags' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -151,34 +167,63 @@ public static function swaggerFormats() 'tags' => 'getTags' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -196,25 +241,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['external_id'] === null) { - $invalid_properties[] = "'external_id' can't be null"; + $invalidProperties[] = "'external_id' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -234,6 +279,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -243,7 +289,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -255,6 +303,7 @@ public function setModelTypeId($model_type_id) /** * Gets external_id + * * @return string */ public function getExternalId() @@ -264,7 +313,9 @@ public function getExternalId() /** * Sets external_id - * @param string $external_id + * + * @param string $external_id external_id + * * @return $this */ public function setExternalId($external_id) @@ -276,6 +327,7 @@ public function setExternalId($external_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -285,7 +337,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -297,6 +351,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -306,7 +361,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -318,6 +375,7 @@ public function setTitle($title) /** * Gets duration + * * @return int */ public function getDuration() @@ -327,7 +385,9 @@ public function getDuration() /** * Sets duration - * @param int $duration + * + * @param int $duration duration + * * @return $this */ public function setDuration($duration) @@ -339,6 +399,7 @@ public function setDuration($duration) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -348,7 +409,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -360,6 +423,7 @@ public function setStart($start) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -369,7 +433,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -381,6 +447,7 @@ public function setRecommended($recommended) /** * Gets static_start + * * @return bool */ public function getStaticStart() @@ -390,7 +457,9 @@ public function getStaticStart() /** * Sets static_start - * @param bool $static_start + * + * @param bool $static_start static_start + * * @return $this */ public function setStaticStart($static_start) @@ -402,6 +471,7 @@ public function setStaticStart($static_start) /** * Gets details + * * @return string */ public function getDetails() @@ -411,7 +481,9 @@ public function getDetails() /** * Sets details - * @param string $details + * + * @param string $details details + * * @return $this */ public function setDetails($details) @@ -423,6 +495,7 @@ public function setDetails($details) /** * Gets contacts + * * @return int[] */ public function getContacts() @@ -432,7 +505,9 @@ public function getContacts() /** * Sets contacts - * @param int[] $contacts + * + * @param int[] $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -444,6 +519,7 @@ public function setContacts($contacts) /** * Gets tags + * * @return int[] */ public function getTags() @@ -453,7 +529,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -464,7 +542,9 @@ public function setTags($tags) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -474,7 +554,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -484,8 +566,10 @@ 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 */ public function offsetSet($offset, $value) @@ -499,7 +583,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -509,15 +595,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/InlineResponse202.php b/lib/Model/InlineResponse202.php index d9253a4..bd47e40 100644 --- a/lib/Model/InlineResponse202.php +++ b/lib/Model/InlineResponse202.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * InlineResponse202 Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class InlineResponse202 implements ArrayAccess +class InlineResponse202 implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'inline_response_202'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class InlineResponse202 implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'success' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'success' => 'success' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'success' => 'setSuccess' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'success' => 'getSuccess' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets success + * * @return bool */ public function getSuccess() @@ -171,7 +217,9 @@ public function getSuccess() /** * Sets success - * @param bool $success + * + * @param bool $success success + * * @return $this */ public function setSuccess($success) @@ -182,7 +230,9 @@ public function setSuccess($success) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/InternalServerError.php b/lib/Model/InternalServerError.php index db6f226..43a7095 100644 --- a/lib/Model/InternalServerError.php +++ b/lib/Model/InternalServerError.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * InternalServerError Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class InternalServerError implements ArrayAccess +class InternalServerError implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'InternalServerError'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class InternalServerError implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class InternalServerError implements ArrayAccess 'status_code' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'status_code' => 'statusCode' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'status_code' => 'setStatusCode' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'status_code' => 'getStatusCode' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,25 +187,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['error'] === null) { - $invalid_properties[] = "'error' can't be null"; + $invalidProperties[] = "'error' can't be null"; } if ($this->container['status_code'] === null) { - $invalid_properties[] = "'status_code' can't be null"; + $invalidProperties[] = "'status_code' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets error + * * @return string */ public function getError() @@ -189,7 +235,9 @@ public function getError() /** * Sets error + * * @param string $error Given error (not formatted), describes the problem. + * * @return $this */ public function setError($error) @@ -201,6 +249,7 @@ public function setError($error) /** * Gets status_code + * * @return int */ public function getStatusCode() @@ -210,7 +259,9 @@ public function getStatusCode() /** * Sets status_code + * * @param int $status_code Assigned StatusCode, is used in order to create a relationship between Error and Response. + * * @return $this */ public function setStatusCode($status_code) @@ -221,7 +272,9 @@ public function setStatusCode($status_code) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -231,7 +284,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -241,8 +296,10 @@ 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 */ public function offsetSet($offset, $value) @@ -256,7 +313,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -266,15 +325,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/InviteUserData.php b/lib/Model/InviteUserData.php index 4cce7eb..ca7f9e5 100644 --- a/lib/Model/InviteUserData.php +++ b/lib/Model/InviteUserData.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * InviteUserData Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class InviteUserData implements ArrayAccess +class InviteUserData implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'InviteUserData'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class InviteUserData implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class InviteUserData implements ArrayAccess 'role_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'role_ids' => 'role_ids' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'role_ids' => 'setRoleIds' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'role_ids' => 'getRoleIds' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,25 +187,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['email'] === null) { - $invalid_properties[] = "'email' can't be null"; + $invalidProperties[] = "'email' can't be null"; } if ($this->container['role_ids'] === null) { - $invalid_properties[] = "'role_ids' can't be null"; + $invalidProperties[] = "'role_ids' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets email + * * @return string */ public function getEmail() @@ -189,7 +235,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -201,6 +249,7 @@ public function setEmail($email) /** * Gets role_ids + * * @return int[] */ public function getRoleIds() @@ -210,7 +259,9 @@ public function getRoleIds() /** * Sets role_ids - * @param int[] $role_ids + * + * @param int[] $role_ids role_ids + * * @return $this */ public function setRoleIds($role_ids) @@ -221,7 +272,9 @@ public function setRoleIds($role_ids) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -231,7 +284,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -241,8 +296,10 @@ 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 */ public function offsetSet($offset, $value) @@ -256,7 +313,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -266,15 +325,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/InviteUserSuccess.php b/lib/Model/InviteUserSuccess.php index a9cacbc..661dccc 100644 --- a/lib/Model/InviteUserSuccess.php +++ b/lib/Model/InviteUserSuccess.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * InviteUserSuccess Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class InviteUserSuccess implements ArrayAccess +class InviteUserSuccess implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'InviteUserSuccess'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class InviteUserSuccess implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'success' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'success' => 'success' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'success' => 'setSuccess' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'success' => 'getSuccess' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets success + * * @return string */ public function getSuccess() @@ -171,7 +217,9 @@ public function getSuccess() /** * Sets success - * @param string $success + * + * @param string $success success + * * @return $this */ public function setSuccess($success) @@ -182,7 +230,9 @@ public function setSuccess($success) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Item.php b/lib/Model/Item.php index f7cd023..6a0182f 100644 --- a/lib/Model/Item.php +++ b/lib/Model/Item.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Item Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Item implements ArrayAccess +class Item implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Item'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -74,6 +77,7 @@ class Item implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -95,18 +99,30 @@ class Item implements ArrayAccess 'details' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'details' => 'details' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -152,9 +168,9 @@ public static function swaggerFormats() 'details' => 'setDetails' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -176,21 +192,47 @@ public static function swaggerFormats() 'details' => 'getDetails' ]; + /** + * 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 STATUS_SCHEDULED = 'scheduled'; const STATUS_PLAYING = 'playing'; const STATUS_PLAYED = 'played'; @@ -199,6 +241,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getStatusAllowableValues() @@ -213,13 +256,16 @@ public function getStatusAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -242,30 +288,30 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -276,8 +322,8 @@ public function valid() if ($this->container['model_type_id'] === null) { return false; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { return false; } return true; @@ -286,6 +332,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -295,7 +342,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -307,6 +356,7 @@ public function setModelTypeId($model_type_id) /** * Gets block_id + * * @return int */ public function getBlockId() @@ -316,7 +366,9 @@ public function getBlockId() /** * Sets block_id - * @param int $block_id + * + * @param int $block_id block_id + * * @return $this */ public function setBlockId($block_id) @@ -328,6 +380,7 @@ public function setBlockId($block_id) /** * Gets external_id + * * @return string */ public function getExternalId() @@ -337,7 +390,9 @@ public function getExternalId() /** * Sets external_id - * @param string $external_id + * + * @param string $external_id external_id + * * @return $this */ public function setExternalId($external_id) @@ -349,6 +404,7 @@ public function setExternalId($external_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -358,7 +414,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -370,6 +428,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -379,7 +438,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -391,6 +452,7 @@ public function setTitle($title) /** * Gets duration + * * @return int */ public function getDuration() @@ -400,7 +462,9 @@ public function getDuration() /** * Sets duration - * @param int $duration + * + * @param int $duration duration + * * @return $this */ public function setDuration($duration) @@ -412,6 +476,7 @@ public function setDuration($duration) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -421,7 +486,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -433,6 +500,7 @@ public function setStart($start) /** * Gets status + * * @return string */ public function getStatus() @@ -442,17 +510,19 @@ public function getStatus() /** * Sets status - * @param string $status + * + * @param string $status status + * * @return $this */ public function setStatus($status) { - $allowed_values = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -463,6 +533,7 @@ public function setStatus($status) /** * Gets import + * * @return int */ public function getImport() @@ -472,7 +543,9 @@ public function getImport() /** * Sets import - * @param int $import + * + * @param int $import import + * * @return $this */ public function setImport($import) @@ -484,6 +557,7 @@ public function setImport($import) /** * Gets campaign_id + * * @return int */ public function getCampaignId() @@ -493,7 +567,9 @@ public function getCampaignId() /** * Sets campaign_id - * @param int $campaign_id + * + * @param int $campaign_id campaign_id + * * @return $this */ public function setCampaignId($campaign_id) @@ -505,6 +581,7 @@ public function setCampaignId($campaign_id) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -514,7 +591,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -526,6 +605,7 @@ public function setRecommended($recommended) /** * Gets station_draft_id + * * @return int */ public function getStationDraftId() @@ -535,7 +615,9 @@ public function getStationDraftId() /** * Sets station_draft_id - * @param int $station_draft_id + * + * @param int $station_draft_id station_draft_id + * * @return $this */ public function setStationDraftId($station_draft_id) @@ -547,6 +629,7 @@ public function setStationDraftId($station_draft_id) /** * Gets program_draft_id + * * @return int */ public function getProgramDraftId() @@ -556,7 +639,9 @@ public function getProgramDraftId() /** * Sets program_draft_id - * @param int $program_draft_id + * + * @param int $program_draft_id program_draft_id + * * @return $this */ public function setProgramDraftId($program_draft_id) @@ -568,6 +653,7 @@ public function setProgramDraftId($program_draft_id) /** * Gets user_draft_id + * * @return int */ public function getUserDraftId() @@ -577,7 +663,9 @@ public function getUserDraftId() /** * Sets user_draft_id - * @param int $user_draft_id + * + * @param int $user_draft_id user_draft_id + * * @return $this */ public function setUserDraftId($user_draft_id) @@ -589,6 +677,7 @@ public function setUserDraftId($user_draft_id) /** * Gets static_start + * * @return bool */ public function getStaticStart() @@ -598,7 +687,9 @@ public function getStaticStart() /** * Sets static_start - * @param bool $static_start + * + * @param bool $static_start static_start + * * @return $this */ public function setStaticStart($static_start) @@ -610,6 +701,7 @@ public function setStaticStart($static_start) /** * Gets details + * * @return string */ public function getDetails() @@ -619,7 +711,9 @@ public function getDetails() /** * Sets details - * @param string $details + * + * @param string $details details + * * @return $this */ public function setDetails($details) @@ -630,7 +724,9 @@ public function setDetails($details) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -640,7 +736,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -650,8 +748,10 @@ 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 */ public function offsetSet($offset, $value) @@ -665,7 +765,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -675,15 +777,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemDataInput.php b/lib/Model/ItemDataInput.php index 0883716..f65b051 100644 --- a/lib/Model/ItemDataInput.php +++ b/lib/Model/ItemDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemDataInput implements ArrayAccess +class ItemDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -78,6 +81,7 @@ class ItemDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -103,18 +107,30 @@ class ItemDataInput implements ArrayAccess 'tags' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -140,9 +156,9 @@ public static function swaggerFormats() 'tags' => 'tags' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -168,9 +184,9 @@ public static function swaggerFormats() 'tags' => 'setTags' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -196,21 +212,47 @@ public static function swaggerFormats() 'tags' => 'getTags' ]; + /** + * 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 STATUS_SCHEDULED = 'scheduled'; const STATUS_PLAYING = 'playing'; const STATUS_PLAYED = 'played'; @@ -219,6 +261,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getStatusAllowableValues() @@ -233,13 +276,16 @@ public function getStatusAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -266,30 +312,30 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -300,8 +346,8 @@ public function valid() if ($this->container['model_type_id'] === null) { return false; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { return false; } return true; @@ -310,6 +356,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -319,7 +366,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -331,6 +380,7 @@ public function setModelTypeId($model_type_id) /** * Gets block_id + * * @return int */ public function getBlockId() @@ -340,7 +390,9 @@ public function getBlockId() /** * Sets block_id - * @param int $block_id + * + * @param int $block_id block_id + * * @return $this */ public function setBlockId($block_id) @@ -352,6 +404,7 @@ public function setBlockId($block_id) /** * Gets external_id + * * @return string */ public function getExternalId() @@ -361,7 +414,9 @@ public function getExternalId() /** * Sets external_id - * @param string $external_id + * + * @param string $external_id external_id + * * @return $this */ public function setExternalId($external_id) @@ -373,6 +428,7 @@ public function setExternalId($external_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -382,7 +438,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -394,6 +452,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -403,7 +462,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -415,6 +476,7 @@ public function setTitle($title) /** * Gets duration + * * @return int */ public function getDuration() @@ -424,7 +486,9 @@ public function getDuration() /** * Sets duration - * @param int $duration + * + * @param int $duration duration + * * @return $this */ public function setDuration($duration) @@ -436,6 +500,7 @@ public function setDuration($duration) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -445,7 +510,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -457,6 +524,7 @@ public function setStart($start) /** * Gets status + * * @return string */ public function getStatus() @@ -466,17 +534,19 @@ public function getStatus() /** * Sets status - * @param string $status + * + * @param string $status status + * * @return $this */ public function setStatus($status) { - $allowed_values = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -487,6 +557,7 @@ public function setStatus($status) /** * Gets import + * * @return int */ public function getImport() @@ -496,7 +567,9 @@ public function getImport() /** * Sets import - * @param int $import + * + * @param int $import import + * * @return $this */ public function setImport($import) @@ -508,6 +581,7 @@ public function setImport($import) /** * Gets campaign_id + * * @return int */ public function getCampaignId() @@ -517,7 +591,9 @@ public function getCampaignId() /** * Sets campaign_id - * @param int $campaign_id + * + * @param int $campaign_id campaign_id + * * @return $this */ public function setCampaignId($campaign_id) @@ -529,6 +605,7 @@ public function setCampaignId($campaign_id) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -538,7 +615,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -550,6 +629,7 @@ public function setRecommended($recommended) /** * Gets station_draft_id + * * @return int */ public function getStationDraftId() @@ -559,7 +639,9 @@ public function getStationDraftId() /** * Sets station_draft_id - * @param int $station_draft_id + * + * @param int $station_draft_id station_draft_id + * * @return $this */ public function setStationDraftId($station_draft_id) @@ -571,6 +653,7 @@ public function setStationDraftId($station_draft_id) /** * Gets program_draft_id + * * @return int */ public function getProgramDraftId() @@ -580,7 +663,9 @@ public function getProgramDraftId() /** * Sets program_draft_id - * @param int $program_draft_id + * + * @param int $program_draft_id program_draft_id + * * @return $this */ public function setProgramDraftId($program_draft_id) @@ -592,6 +677,7 @@ public function setProgramDraftId($program_draft_id) /** * Gets user_draft_id + * * @return int */ public function getUserDraftId() @@ -601,7 +687,9 @@ public function getUserDraftId() /** * Sets user_draft_id - * @param int $user_draft_id + * + * @param int $user_draft_id user_draft_id + * * @return $this */ public function setUserDraftId($user_draft_id) @@ -613,6 +701,7 @@ public function setUserDraftId($user_draft_id) /** * Gets static_start + * * @return bool */ public function getStaticStart() @@ -622,7 +711,9 @@ public function getStaticStart() /** * Sets static_start - * @param bool $static_start + * + * @param bool $static_start static_start + * * @return $this */ public function setStaticStart($static_start) @@ -634,6 +725,7 @@ public function setStaticStart($static_start) /** * Gets details + * * @return string */ public function getDetails() @@ -643,7 +735,9 @@ public function getDetails() /** * Sets details - * @param string $details + * + * @param string $details details + * * @return $this */ public function setDetails($details) @@ -655,6 +749,7 @@ public function setDetails($details) /** * Gets _previous_id + * * @return int */ public function getPreviousId() @@ -664,7 +759,9 @@ public function getPreviousId() /** * Sets _previous_id - * @param int $_previous_id + * + * @param int $_previous_id _previous_id + * * @return $this */ public function setPreviousId($_previous_id) @@ -676,6 +773,7 @@ public function setPreviousId($_previous_id) /** * Gets _before_id + * * @return int */ public function getBeforeId() @@ -685,7 +783,9 @@ public function getBeforeId() /** * Sets _before_id - * @param int $_before_id + * + * @param int $_before_id _before_id + * * @return $this */ public function setBeforeId($_before_id) @@ -697,6 +797,7 @@ public function setBeforeId($_before_id) /** * Gets contacts + * * @return int[] */ public function getContacts() @@ -706,7 +807,9 @@ public function getContacts() /** * Sets contacts - * @param int[] $contacts + * + * @param int[] $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -718,6 +821,7 @@ public function setContacts($contacts) /** * Gets tags + * * @return int[] */ public function getTags() @@ -727,7 +831,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -738,7 +844,9 @@ public function setTags($tags) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -748,7 +856,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -758,8 +868,10 @@ 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 */ public function offsetSet($offset, $value) @@ -773,7 +885,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -783,15 +897,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemInputOnly.php b/lib/Model/ItemInputOnly.php index 2524330..a41e98c 100644 --- a/lib/Model/ItemInputOnly.php +++ b/lib/Model/ItemInputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemInputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemInputOnly implements ArrayAccess +class ItemInputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemInputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ItemInputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ItemInputOnly implements ArrayAccess 'tags' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'tags' => 'tags' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'tags' => 'setTags' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'tags' => 'getTags' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets _previous_id + * * @return int */ public function getPreviousId() @@ -189,7 +235,9 @@ public function getPreviousId() /** * Sets _previous_id - * @param int $_previous_id + * + * @param int $_previous_id _previous_id + * * @return $this */ public function setPreviousId($_previous_id) @@ -201,6 +249,7 @@ public function setPreviousId($_previous_id) /** * Gets _before_id + * * @return int */ public function getBeforeId() @@ -210,7 +259,9 @@ public function getBeforeId() /** * Sets _before_id - * @param int $_before_id + * + * @param int $_before_id _before_id + * * @return $this */ public function setBeforeId($_before_id) @@ -222,6 +273,7 @@ public function setBeforeId($_before_id) /** * Gets contacts + * * @return int[] */ public function getContacts() @@ -231,7 +283,9 @@ public function getContacts() /** * Sets contacts - * @param int[] $contacts + * + * @param int[] $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -243,6 +297,7 @@ public function setContacts($contacts) /** * Gets tags + * * @return int[] */ public function getTags() @@ -252,7 +307,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -263,7 +320,9 @@ public function setTags($tags) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemOutputOnly.php b/lib/Model/ItemOutputOnly.php index 63b6b36..d2119ad 100644 --- a/lib/Model/ItemOutputOnly.php +++ b/lib/Model/ItemOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemOutputOnly implements ArrayAccess +class ItemOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -67,6 +70,7 @@ class ItemOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -81,18 +85,30 @@ class ItemOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -107,9 +123,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -124,9 +140,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -141,34 +157,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -184,19 +229,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -219,7 +265,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -231,6 +279,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -240,7 +289,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -252,6 +303,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -261,7 +313,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -273,6 +327,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -282,7 +337,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -294,6 +351,7 @@ public function setDeletedAt($deleted_at) /** * Gets data_modified + * * @return int */ public function getDataModified() @@ -303,7 +361,9 @@ public function getDataModified() /** * Sets data_modified - * @param int $data_modified + * + * @param int $data_modified data_modified + * * @return $this */ public function setDataModified($data_modified) @@ -315,6 +375,7 @@ public function setDataModified($data_modified) /** * Gets order + * * @return int */ public function getOrder() @@ -324,7 +385,9 @@ public function getOrder() /** * Sets order - * @param int $order + * + * @param int $order order + * * @return $this */ public function setOrder($order) @@ -336,6 +399,7 @@ public function setOrder($order) /** * Gets templateblock_id + * * @return int */ public function getTemplateblockId() @@ -345,7 +409,9 @@ public function getTemplateblockId() /** * Sets templateblock_id - * @param int $templateblock_id + * + * @param int $templateblock_id templateblock_id + * * @return $this */ public function setTemplateblockId($templateblock_id) @@ -357,6 +423,7 @@ public function setTemplateblockId($templateblock_id) /** * Gets templateitem_id + * * @return int */ public function getTemplateitemId() @@ -366,7 +433,9 @@ public function getTemplateitemId() /** * Sets templateitem_id - * @param int $templateitem_id + * + * @param int $templateitem_id templateitem_id + * * @return $this */ public function setTemplateitemId($templateitem_id) @@ -378,6 +447,7 @@ public function setTemplateitemId($templateitem_id) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -387,7 +457,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -398,7 +470,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -408,7 +482,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -418,8 +494,10 @@ 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 */ public function offsetSet($offset, $value) @@ -433,7 +511,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -443,15 +523,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelations.php b/lib/Model/ItemRelations.php index 5fc5196..66706ed 100644 --- a/lib/Model/ItemRelations.php +++ b/lib/Model/ItemRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelations implements ArrayAccess +class ItemRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -65,6 +68,7 @@ class ItemRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -77,18 +81,30 @@ class ItemRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,9 +117,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -116,9 +132,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -131,34 +147,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -172,19 +217,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -198,6 +243,7 @@ public function valid() /** * Gets block + * * @return \RadioManager\Model\ItemRelationsBlock */ public function getBlock() @@ -207,7 +253,9 @@ public function getBlock() /** * Sets block - * @param \RadioManager\Model\ItemRelationsBlock $block + * + * @param \RadioManager\Model\ItemRelationsBlock $block block + * * @return $this */ public function setBlock($block) @@ -219,6 +267,7 @@ public function setBlock($block) /** * Gets broadcast + * * @return \RadioManager\Model\BlockRelationsBroadcast */ public function getBroadcast() @@ -228,7 +277,9 @@ public function getBroadcast() /** * Sets broadcast - * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast + * + * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast broadcast + * * @return $this */ public function setBroadcast($broadcast) @@ -240,6 +291,7 @@ public function setBroadcast($broadcast) /** * Gets program + * * @return \RadioManager\Model\ItemRelationsProgram */ public function getProgram() @@ -249,7 +301,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\ItemRelationsProgram $program + * + * @param \RadioManager\Model\ItemRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -261,6 +315,7 @@ public function setProgram($program) /** * Gets contacts + * * @return \RadioManager\Model\ItemRelationsContacts */ public function getContacts() @@ -270,7 +325,9 @@ public function getContacts() /** * Sets contacts - * @param \RadioManager\Model\ItemRelationsContacts $contacts + * + * @param \RadioManager\Model\ItemRelationsContacts $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -282,6 +339,7 @@ public function setContacts($contacts) /** * Gets tags + * * @return \RadioManager\Model\ItemRelationsTags */ public function getTags() @@ -291,7 +349,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\ItemRelationsTags $tags + * + * @param \RadioManager\Model\ItemRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -303,6 +363,7 @@ public function setTags($tags) /** * Gets campaign + * * @return \RadioManager\Model\ItemRelationsCampaign */ public function getCampaign() @@ -312,7 +373,9 @@ public function getCampaign() /** * Sets campaign - * @param \RadioManager\Model\ItemRelationsCampaign $campaign + * + * @param \RadioManager\Model\ItemRelationsCampaign $campaign campaign + * * @return $this */ public function setCampaign($campaign) @@ -324,6 +387,7 @@ public function setCampaign($campaign) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -333,7 +397,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -344,7 +410,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -354,7 +422,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -364,8 +434,10 @@ 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 */ public function offsetSet($offset, $value) @@ -379,7 +451,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -389,15 +463,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelationsBlock.php b/lib/Model/ItemRelationsBlock.php index 65fbf0d..88f94a1 100644 --- a/lib/Model/ItemRelationsBlock.php +++ b/lib/Model/ItemRelationsBlock.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelationsBlock Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelationsBlock implements ArrayAccess +class ItemRelationsBlock implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations_block'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ItemRelationsBlock implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ItemRelationsBlock implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelationsCampaign.php b/lib/Model/ItemRelationsCampaign.php index 206b05a..9e871c2 100644 --- a/lib/Model/ItemRelationsCampaign.php +++ b/lib/Model/ItemRelationsCampaign.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelationsCampaign Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelationsCampaign implements ArrayAccess +class ItemRelationsCampaign implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations_campaign'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ItemRelationsCampaign implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ItemRelationsCampaign implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelationsContacts.php b/lib/Model/ItemRelationsContacts.php index 9ddb77e..2718407 100644 --- a/lib/Model/ItemRelationsContacts.php +++ b/lib/Model/ItemRelationsContacts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelationsContacts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelationsContacts implements ArrayAccess +class ItemRelationsContacts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations_contacts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ItemRelationsContacts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ItemRelationsContacts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ItemRelationsContactsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ItemRelationsContactsParams $params + * + * @param \RadioManager\Model\ItemRelationsContactsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelationsContactsParams.php b/lib/Model/ItemRelationsContactsParams.php index fcfaf63..719dc9c 100644 --- a/lib/Model/ItemRelationsContactsParams.php +++ b/lib/Model/ItemRelationsContactsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelationsContactsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelationsContactsParams implements ArrayAccess +class ItemRelationsContactsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations_contacts_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class ItemRelationsContactsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'item_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'item_id' => 'item_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'item_id' => 'setItemId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'item_id' => 'getItemId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets item_id + * * @return int */ public function getItemId() @@ -171,7 +217,9 @@ public function getItemId() /** * Sets item_id - * @param int $item_id + * + * @param int $item_id item_id + * * @return $this */ public function setItemId($item_id) @@ -182,7 +230,9 @@ public function setItemId($item_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelationsProgram.php b/lib/Model/ItemRelationsProgram.php index 81837a9..dfa216d 100644 --- a/lib/Model/ItemRelationsProgram.php +++ b/lib/Model/ItemRelationsProgram.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelationsProgram Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelationsProgram implements ArrayAccess +class ItemRelationsProgram implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations_program'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ItemRelationsProgram implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ItemRelationsProgram implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\BlockRelationsBroadcastParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\BlockRelationsBroadcastParams $params + * + * @param \RadioManager\Model\BlockRelationsBroadcastParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemRelationsTags.php b/lib/Model/ItemRelationsTags.php index 52a61d3..e10fba0 100644 --- a/lib/Model/ItemRelationsTags.php +++ b/lib/Model/ItemRelationsTags.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemRelationsTags Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemRelationsTags implements ArrayAccess +class ItemRelationsTags implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemRelations_tags'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ItemRelationsTags implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ItemRelationsTags implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ItemRelationsContactsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ItemRelationsContactsParams $params + * + * @param \RadioManager\Model\ItemRelationsContactsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemResult.php b/lib/Model/ItemResult.php index c007a85..c629d83 100644 --- a/lib/Model/ItemResult.php +++ b/lib/Model/ItemResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemResult implements ArrayAccess +class ItemResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -90,6 +93,7 @@ class ItemResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -127,18 +131,30 @@ class ItemResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -176,9 +192,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -216,9 +232,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -256,21 +272,47 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 STATUS_SCHEDULED = 'scheduled'; const STATUS_PLAYING = 'playing'; const STATUS_PLAYED = 'played'; @@ -279,6 +321,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getStatusAllowableValues() @@ -293,13 +336,16 @@ public function getStatusAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -338,30 +384,30 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -372,8 +418,8 @@ public function valid() if ($this->container['model_type_id'] === null) { return false; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { return false; } return true; @@ -382,6 +428,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -391,7 +438,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -403,6 +452,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -412,7 +462,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -424,6 +476,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -433,7 +486,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -445,6 +500,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -454,7 +510,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -466,6 +524,7 @@ public function setDeletedAt($deleted_at) /** * Gets data_modified + * * @return int */ public function getDataModified() @@ -475,7 +534,9 @@ public function getDataModified() /** * Sets data_modified - * @param int $data_modified + * + * @param int $data_modified data_modified + * * @return $this */ public function setDataModified($data_modified) @@ -487,6 +548,7 @@ public function setDataModified($data_modified) /** * Gets order + * * @return int */ public function getOrder() @@ -496,7 +558,9 @@ public function getOrder() /** * Sets order - * @param int $order + * + * @param int $order order + * * @return $this */ public function setOrder($order) @@ -508,6 +572,7 @@ public function setOrder($order) /** * Gets templateblock_id + * * @return int */ public function getTemplateblockId() @@ -517,7 +582,9 @@ public function getTemplateblockId() /** * Sets templateblock_id - * @param int $templateblock_id + * + * @param int $templateblock_id templateblock_id + * * @return $this */ public function setTemplateblockId($templateblock_id) @@ -529,6 +596,7 @@ public function setTemplateblockId($templateblock_id) /** * Gets templateitem_id + * * @return int */ public function getTemplateitemId() @@ -538,7 +606,9 @@ public function getTemplateitemId() /** * Sets templateitem_id - * @param int $templateitem_id + * + * @param int $templateitem_id templateitem_id + * * @return $this */ public function setTemplateitemId($templateitem_id) @@ -550,6 +620,7 @@ public function setTemplateitemId($templateitem_id) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -559,7 +630,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -571,6 +644,7 @@ public function setExternalStationId($_external_station_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -580,7 +654,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -592,6 +668,7 @@ public function setModelTypeId($model_type_id) /** * Gets block_id + * * @return int */ public function getBlockId() @@ -601,7 +678,9 @@ public function getBlockId() /** * Sets block_id - * @param int $block_id + * + * @param int $block_id block_id + * * @return $this */ public function setBlockId($block_id) @@ -613,6 +692,7 @@ public function setBlockId($block_id) /** * Gets external_id + * * @return string */ public function getExternalId() @@ -622,7 +702,9 @@ public function getExternalId() /** * Sets external_id - * @param string $external_id + * + * @param string $external_id external_id + * * @return $this */ public function setExternalId($external_id) @@ -634,6 +716,7 @@ public function setExternalId($external_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -643,7 +726,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -655,6 +740,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -664,7 +750,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -676,6 +764,7 @@ public function setTitle($title) /** * Gets duration + * * @return int */ public function getDuration() @@ -685,7 +774,9 @@ public function getDuration() /** * Sets duration - * @param int $duration + * + * @param int $duration duration + * * @return $this */ public function setDuration($duration) @@ -697,6 +788,7 @@ public function setDuration($duration) /** * Gets start + * * @return \DateTime */ public function getStart() @@ -706,7 +798,9 @@ public function getStart() /** * Sets start - * @param \DateTime $start + * + * @param \DateTime $start start + * * @return $this */ public function setStart($start) @@ -718,6 +812,7 @@ public function setStart($start) /** * Gets status + * * @return string */ public function getStatus() @@ -727,17 +822,19 @@ public function getStatus() /** * Sets status - * @param string $status + * + * @param string $status status + * * @return $this */ public function setStatus($status) { - $allowed_values = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -748,6 +845,7 @@ public function setStatus($status) /** * Gets import + * * @return int */ public function getImport() @@ -757,7 +855,9 @@ public function getImport() /** * Sets import - * @param int $import + * + * @param int $import import + * * @return $this */ public function setImport($import) @@ -769,6 +869,7 @@ public function setImport($import) /** * Gets campaign_id + * * @return int */ public function getCampaignId() @@ -778,7 +879,9 @@ public function getCampaignId() /** * Sets campaign_id - * @param int $campaign_id + * + * @param int $campaign_id campaign_id + * * @return $this */ public function setCampaignId($campaign_id) @@ -790,6 +893,7 @@ public function setCampaignId($campaign_id) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -799,7 +903,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -811,6 +917,7 @@ public function setRecommended($recommended) /** * Gets station_draft_id + * * @return int */ public function getStationDraftId() @@ -820,7 +927,9 @@ public function getStationDraftId() /** * Sets station_draft_id - * @param int $station_draft_id + * + * @param int $station_draft_id station_draft_id + * * @return $this */ public function setStationDraftId($station_draft_id) @@ -832,6 +941,7 @@ public function setStationDraftId($station_draft_id) /** * Gets program_draft_id + * * @return int */ public function getProgramDraftId() @@ -841,7 +951,9 @@ public function getProgramDraftId() /** * Sets program_draft_id - * @param int $program_draft_id + * + * @param int $program_draft_id program_draft_id + * * @return $this */ public function setProgramDraftId($program_draft_id) @@ -853,6 +965,7 @@ public function setProgramDraftId($program_draft_id) /** * Gets user_draft_id + * * @return int */ public function getUserDraftId() @@ -862,7 +975,9 @@ public function getUserDraftId() /** * Sets user_draft_id - * @param int $user_draft_id + * + * @param int $user_draft_id user_draft_id + * * @return $this */ public function setUserDraftId($user_draft_id) @@ -874,6 +989,7 @@ public function setUserDraftId($user_draft_id) /** * Gets static_start + * * @return bool */ public function getStaticStart() @@ -883,7 +999,9 @@ public function getStaticStart() /** * Sets static_start - * @param bool $static_start + * + * @param bool $static_start static_start + * * @return $this */ public function setStaticStart($static_start) @@ -895,6 +1013,7 @@ public function setStaticStart($static_start) /** * Gets details + * * @return string */ public function getDetails() @@ -904,7 +1023,9 @@ public function getDetails() /** * Sets details - * @param string $details + * + * @param string $details details + * * @return $this */ public function setDetails($details) @@ -916,6 +1037,7 @@ public function setDetails($details) /** * Gets block + * * @return \RadioManager\Model\ItemRelationsBlock */ public function getBlock() @@ -925,7 +1047,9 @@ public function getBlock() /** * Sets block - * @param \RadioManager\Model\ItemRelationsBlock $block + * + * @param \RadioManager\Model\ItemRelationsBlock $block block + * * @return $this */ public function setBlock($block) @@ -937,6 +1061,7 @@ public function setBlock($block) /** * Gets broadcast + * * @return \RadioManager\Model\BlockRelationsBroadcast */ public function getBroadcast() @@ -946,7 +1071,9 @@ public function getBroadcast() /** * Sets broadcast - * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast + * + * @param \RadioManager\Model\BlockRelationsBroadcast $broadcast broadcast + * * @return $this */ public function setBroadcast($broadcast) @@ -958,6 +1085,7 @@ public function setBroadcast($broadcast) /** * Gets program + * * @return \RadioManager\Model\ItemRelationsProgram */ public function getProgram() @@ -967,7 +1095,9 @@ public function getProgram() /** * Sets program - * @param \RadioManager\Model\ItemRelationsProgram $program + * + * @param \RadioManager\Model\ItemRelationsProgram $program program + * * @return $this */ public function setProgram($program) @@ -979,6 +1109,7 @@ public function setProgram($program) /** * Gets contacts + * * @return \RadioManager\Model\ItemRelationsContacts */ public function getContacts() @@ -988,7 +1119,9 @@ public function getContacts() /** * Sets contacts - * @param \RadioManager\Model\ItemRelationsContacts $contacts + * + * @param \RadioManager\Model\ItemRelationsContacts $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -1000,6 +1133,7 @@ public function setContacts($contacts) /** * Gets tags + * * @return \RadioManager\Model\ItemRelationsTags */ public function getTags() @@ -1009,7 +1143,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\ItemRelationsTags $tags + * + * @param \RadioManager\Model\ItemRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -1021,6 +1157,7 @@ public function setTags($tags) /** * Gets campaign + * * @return \RadioManager\Model\ItemRelationsCampaign */ public function getCampaign() @@ -1030,7 +1167,9 @@ public function getCampaign() /** * Sets campaign - * @param \RadioManager\Model\ItemRelationsCampaign $campaign + * + * @param \RadioManager\Model\ItemRelationsCampaign $campaign campaign + * * @return $this */ public function setCampaign($campaign) @@ -1042,6 +1181,7 @@ public function setCampaign($campaign) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -1051,7 +1191,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -1062,7 +1204,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -1072,7 +1216,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -1082,8 +1228,10 @@ 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 */ public function offsetSet($offset, $value) @@ -1097,7 +1245,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -1107,15 +1257,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ItemResults.php b/lib/Model/ItemResults.php index 6829e97..688e67c 100644 --- a/lib/Model/ItemResults.php +++ b/lib/Model/ItemResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ItemResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ItemResults implements ArrayAccess +class ItemResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ItemResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -67,6 +70,7 @@ class ItemResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -81,18 +85,30 @@ class ItemResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -107,9 +123,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -124,9 +140,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -141,34 +157,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -184,19 +229,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -219,7 +265,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -231,6 +279,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -240,7 +289,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -252,6 +303,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -261,7 +313,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -273,6 +327,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -282,7 +337,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -294,6 +351,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -303,7 +361,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -315,6 +375,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -324,7 +385,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -336,6 +399,7 @@ public function setPerPage($per_page) /** * Gets to + * * @return int */ public function getTo() @@ -345,7 +409,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -357,6 +423,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -366,7 +433,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -378,6 +447,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\ItemResult[] */ public function getResults() @@ -387,7 +457,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\ItemResult[] $results + * + * @param \RadioManager\Model\ItemResult[] $results results + * * @return $this */ public function setResults($results) @@ -398,7 +470,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -408,7 +482,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -418,8 +494,10 @@ 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 */ public function offsetSet($offset, $value) @@ -433,7 +511,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -443,15 +523,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 0000000..96fabc4 --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,96 @@ + '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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'deleted_at' => 'deleted_at' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -120,9 +136,9 @@ public static function swaggerFormats() 'deleted_at' => 'setDeletedAt' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -136,21 +152,47 @@ public static function swaggerFormats() 'deleted_at' => 'getDeletedAt' ]; + /** + * 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 MODEL_BROADCAST = 'broadcast'; const MODEL_PROGRAM = 'program'; const MODEL_ITEM = 'item'; @@ -163,6 +205,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getModelAllowableValues() @@ -181,13 +224,16 @@ public function getModelAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -202,30 +248,30 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } - $allowed_values = $this->getModelAllowableValues(); - if (!in_array($this->container['model'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getModelAllowableValues(); + if (!in_array($this->container['model'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'model', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -236,8 +282,8 @@ public function valid() if ($this->container['id'] === null) { return false; } - $allowed_values = $this->getModelAllowableValues(); - if (!in_array($this->container['model'], $allowed_values)) { + $allowedValues = $this->getModelAllowableValues(); + if (!in_array($this->container['model'], $allowedValues)) { return false; } return true; @@ -246,6 +292,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -255,7 +302,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -267,6 +316,7 @@ public function setId($id) /** * Gets name + * * @return string */ public function getName() @@ -276,7 +326,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -288,6 +340,7 @@ public function setName($name) /** * Gets model + * * @return string */ public function getModel() @@ -297,17 +350,19 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) { - $allowed_values = $this->getModelAllowableValues(); - if (!is_null($model) && !in_array($model, $allowed_values)) { + $allowedValues = $this->getModelAllowableValues(); + if (!is_null($model) && !in_array($model, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'model', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -318,6 +373,7 @@ public function setModel($model) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -327,7 +383,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -339,6 +397,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -348,7 +407,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -360,6 +421,7 @@ public function setUpdatedAt($updated_at) /** * Gets options + * * @return \RadioManager\Model\ModelTypeOptions */ public function getOptions() @@ -369,7 +431,9 @@ public function getOptions() /** * Sets options - * @param \RadioManager\Model\ModelTypeOptions $options + * + * @param \RadioManager\Model\ModelTypeOptions $options options + * * @return $this */ public function setOptions($options) @@ -381,6 +445,7 @@ public function setOptions($options) /** * Gets order + * * @return int */ public function getOrder() @@ -390,7 +455,9 @@ public function getOrder() /** * Sets order - * @param int $order + * + * @param int $order order + * * @return $this */ public function setOrder($order) @@ -402,6 +469,7 @@ public function setOrder($order) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -411,7 +479,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -422,7 +492,9 @@ public function setDeletedAt($deleted_at) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -432,7 +504,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -442,8 +516,10 @@ 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 */ public function offsetSet($offset, $value) @@ -457,7 +533,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -467,15 +545,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeOptions.php b/lib/Model/ModelTypeOptions.php index f815c3f..bbb7b16 100644 --- a/lib/Model/ModelTypeOptions.php +++ b/lib/Model/ModelTypeOptions.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeOptions Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeOptions implements ArrayAccess +class ModelTypeOptions implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelType_options'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class ModelTypeOptions implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class ModelTypeOptions implements ArrayAccess 'sub_broadcast' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'sub_broadcast' => 'subBroadcast' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'sub_broadcast' => 'setSubBroadcast' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'sub_broadcast' => 'getSubBroadcast' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,19 +187,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets color + * * @return string */ public function getColor() @@ -177,7 +223,9 @@ public function getColor() /** * Sets color - * @param string $color + * + * @param string $color color + * * @return $this */ public function setColor($color) @@ -189,6 +237,7 @@ public function setColor($color) /** * Gets sub_broadcast + * * @return bool */ public function getSubBroadcast() @@ -198,7 +247,9 @@ public function getSubBroadcast() /** * Sets sub_broadcast - * @param bool $sub_broadcast + * + * @param bool $sub_broadcast sub_broadcast + * * @return $this */ public function setSubBroadcast($sub_broadcast) @@ -209,7 +260,9 @@ public function setSubBroadcast($sub_broadcast) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +272,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +284,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +301,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +313,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeOutputOnly.php b/lib/Model/ModelTypeOutputOnly.php index 0d1f402..0a585c1 100644 --- a/lib/Model/ModelTypeOutputOnly.php +++ b/lib/Model/ModelTypeOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeOutputOnly implements ArrayAccess +class ModelTypeOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class ModelTypeOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -171,7 +217,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -182,7 +230,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelations.php b/lib/Model/ModelTypeRelations.php index e6c9286..6205f1c 100644 --- a/lib/Model/ModelTypeRelations.php +++ b/lib/Model/ModelTypeRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelations implements ArrayAccess +class ModelTypeRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class ModelTypeRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class ModelTypeRelations implements ArrayAccess 'items' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'items' => 'items' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'items' => 'setItems' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'items' => 'getItems' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,19 +211,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -192,6 +237,7 @@ public function valid() /** * Gets campaigns + * * @return \RadioManager\Model\ModelTypeRelationsCampaigns */ public function getCampaigns() @@ -201,7 +247,9 @@ public function getCampaigns() /** * Sets campaigns - * @param \RadioManager\Model\ModelTypeRelationsCampaigns $campaigns + * + * @param \RadioManager\Model\ModelTypeRelationsCampaigns $campaigns campaigns + * * @return $this */ public function setCampaigns($campaigns) @@ -213,6 +261,7 @@ public function setCampaigns($campaigns) /** * Gets broadcasts + * * @return \RadioManager\Model\ModelTypeRelationsBroadcasts */ public function getBroadcasts() @@ -222,7 +271,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\ModelTypeRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\ModelTypeRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -234,6 +285,7 @@ public function setBroadcasts($broadcasts) /** * Gets programs + * * @return \RadioManager\Model\ModelTypeRelationsPrograms */ public function getPrograms() @@ -243,7 +295,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\ModelTypeRelationsPrograms $programs + * + * @param \RadioManager\Model\ModelTypeRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -255,6 +309,7 @@ public function setPrograms($programs) /** * Gets contacts + * * @return \RadioManager\Model\ModelTypeRelationsContacts */ public function getContacts() @@ -264,7 +319,9 @@ public function getContacts() /** * Sets contacts - * @param \RadioManager\Model\ModelTypeRelationsContacts $contacts + * + * @param \RadioManager\Model\ModelTypeRelationsContacts $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -276,6 +333,7 @@ public function setContacts($contacts) /** * Gets presenters + * * @return \RadioManager\Model\ModelTypeRelationsPresenters */ public function getPresenters() @@ -285,7 +343,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\ModelTypeRelationsPresenters $presenters + * + * @param \RadioManager\Model\ModelTypeRelationsPresenters $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -297,6 +357,7 @@ public function setPresenters($presenters) /** * Gets items + * * @return \RadioManager\Model\ModelTypeRelationsItems */ public function getItems() @@ -306,7 +367,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ModelTypeRelationsItems $items + * + * @param \RadioManager\Model\ModelTypeRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -317,7 +380,9 @@ public function setItems($items) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -327,7 +392,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -337,8 +404,10 @@ 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 */ public function offsetSet($offset, $value) @@ -352,7 +421,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -362,15 +433,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsBroadcasts.php b/lib/Model/ModelTypeRelationsBroadcasts.php index af69e2e..9f13dde 100644 --- a/lib/Model/ModelTypeRelationsBroadcasts.php +++ b/lib/Model/ModelTypeRelationsBroadcasts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsBroadcasts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsBroadcasts implements ArrayAccess +class ModelTypeRelationsBroadcasts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_broadcasts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ModelTypeRelationsBroadcasts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ModelTypeRelationsBroadcasts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ModelTypeRelationsCampaignsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params + * + * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsCampaigns.php b/lib/Model/ModelTypeRelationsCampaigns.php index a8f3872..e31140c 100644 --- a/lib/Model/ModelTypeRelationsCampaigns.php +++ b/lib/Model/ModelTypeRelationsCampaigns.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsCampaigns Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsCampaigns implements ArrayAccess +class ModelTypeRelationsCampaigns implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_campaigns'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ModelTypeRelationsCampaigns implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ModelTypeRelationsCampaigns implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ModelTypeRelationsCampaignsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params + * + * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsCampaignsParams.php b/lib/Model/ModelTypeRelationsCampaignsParams.php index 484acaa..5452838 100644 --- a/lib/Model/ModelTypeRelationsCampaignsParams.php +++ b/lib/Model/ModelTypeRelationsCampaignsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsCampaignsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsCampaignsParams implements ArrayAccess +class ModelTypeRelationsCampaignsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_campaigns_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class ModelTypeRelationsCampaignsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'model_type_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'model_type_id' => 'model_type_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'model_type_id' => 'setModelTypeId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'model_type_id' => 'getModelTypeId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -171,7 +217,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -182,7 +230,9 @@ public function setModelTypeId($model_type_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsContacts.php b/lib/Model/ModelTypeRelationsContacts.php index ee8b3f7..637f0a4 100644 --- a/lib/Model/ModelTypeRelationsContacts.php +++ b/lib/Model/ModelTypeRelationsContacts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsContacts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsContacts implements ArrayAccess +class ModelTypeRelationsContacts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_contacts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ModelTypeRelationsContacts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ModelTypeRelationsContacts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ModelTypeRelationsCampaignsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params + * + * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsItems.php b/lib/Model/ModelTypeRelationsItems.php index 11a2469..8da37aa 100644 --- a/lib/Model/ModelTypeRelationsItems.php +++ b/lib/Model/ModelTypeRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsItems implements ArrayAccess +class ModelTypeRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ModelTypeRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ModelTypeRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ModelTypeRelationsCampaignsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params + * + * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsPresenters.php b/lib/Model/ModelTypeRelationsPresenters.php index 860f056..25b4cd9 100644 --- a/lib/Model/ModelTypeRelationsPresenters.php +++ b/lib/Model/ModelTypeRelationsPresenters.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsPresenters Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsPresenters implements ArrayAccess +class ModelTypeRelationsPresenters implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_presenters'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ModelTypeRelationsPresenters implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ModelTypeRelationsPresenters implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ModelTypeRelationsCampaignsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params + * + * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeRelationsPrograms.php b/lib/Model/ModelTypeRelationsPrograms.php index 225e605..fd2467d 100644 --- a/lib/Model/ModelTypeRelationsPrograms.php +++ b/lib/Model/ModelTypeRelationsPrograms.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeRelationsPrograms Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeRelationsPrograms implements ArrayAccess +class ModelTypeRelationsPrograms implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeRelations_programs'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ModelTypeRelationsPrograms implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ModelTypeRelationsPrograms implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ModelTypeRelationsCampaignsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params + * + * @param \RadioManager\Model\ModelTypeRelationsCampaignsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeResult.php b/lib/Model/ModelTypeResult.php index 891b90e..1dfbeaf 100644 --- a/lib/Model/ModelTypeResult.php +++ b/lib/Model/ModelTypeResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeResult implements ArrayAccess +class ModelTypeResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -73,6 +76,7 @@ class ModelTypeResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -93,18 +97,30 @@ class ModelTypeResult implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -125,9 +141,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -148,9 +164,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -171,21 +187,47 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 MODEL_BROADCAST = 'broadcast'; const MODEL_PROGRAM = 'program'; const MODEL_ITEM = 'item'; @@ -198,6 +240,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getModelAllowableValues() @@ -216,13 +259,16 @@ public function getModelAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -244,30 +290,30 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } - $allowed_values = $this->getModelAllowableValues(); - if (!in_array($this->container['model'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getModelAllowableValues(); + if (!in_array($this->container['model'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'model', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -278,8 +324,8 @@ public function valid() if ($this->container['id'] === null) { return false; } - $allowed_values = $this->getModelAllowableValues(); - if (!in_array($this->container['model'], $allowed_values)) { + $allowedValues = $this->getModelAllowableValues(); + if (!in_array($this->container['model'], $allowedValues)) { return false; } return true; @@ -288,6 +334,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -297,7 +344,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -309,6 +358,7 @@ public function setId($id) /** * Gets name + * * @return string */ public function getName() @@ -318,7 +368,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -330,6 +382,7 @@ public function setName($name) /** * Gets model + * * @return string */ public function getModel() @@ -339,17 +392,19 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) { - $allowed_values = $this->getModelAllowableValues(); - if (!is_null($model) && !in_array($model, $allowed_values)) { + $allowedValues = $this->getModelAllowableValues(); + if (!is_null($model) && !in_array($model, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'model', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -360,6 +415,7 @@ public function setModel($model) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -369,7 +425,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -381,6 +439,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -390,7 +449,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -402,6 +463,7 @@ public function setUpdatedAt($updated_at) /** * Gets options + * * @return \RadioManager\Model\ModelTypeOptions */ public function getOptions() @@ -411,7 +473,9 @@ public function getOptions() /** * Sets options - * @param \RadioManager\Model\ModelTypeOptions $options + * + * @param \RadioManager\Model\ModelTypeOptions $options options + * * @return $this */ public function setOptions($options) @@ -423,6 +487,7 @@ public function setOptions($options) /** * Gets order + * * @return int */ public function getOrder() @@ -432,7 +497,9 @@ public function getOrder() /** * Sets order - * @param int $order + * + * @param int $order order + * * @return $this */ public function setOrder($order) @@ -444,6 +511,7 @@ public function setOrder($order) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -453,7 +521,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -465,6 +535,7 @@ public function setDeletedAt($deleted_at) /** * Gets campaigns + * * @return \RadioManager\Model\ModelTypeRelationsCampaigns */ public function getCampaigns() @@ -474,7 +545,9 @@ public function getCampaigns() /** * Sets campaigns - * @param \RadioManager\Model\ModelTypeRelationsCampaigns $campaigns + * + * @param \RadioManager\Model\ModelTypeRelationsCampaigns $campaigns campaigns + * * @return $this */ public function setCampaigns($campaigns) @@ -486,6 +559,7 @@ public function setCampaigns($campaigns) /** * Gets broadcasts + * * @return \RadioManager\Model\ModelTypeRelationsBroadcasts */ public function getBroadcasts() @@ -495,7 +569,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\ModelTypeRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\ModelTypeRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -507,6 +583,7 @@ public function setBroadcasts($broadcasts) /** * Gets programs + * * @return \RadioManager\Model\ModelTypeRelationsPrograms */ public function getPrograms() @@ -516,7 +593,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\ModelTypeRelationsPrograms $programs + * + * @param \RadioManager\Model\ModelTypeRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -528,6 +607,7 @@ public function setPrograms($programs) /** * Gets contacts + * * @return \RadioManager\Model\ModelTypeRelationsContacts */ public function getContacts() @@ -537,7 +617,9 @@ public function getContacts() /** * Sets contacts - * @param \RadioManager\Model\ModelTypeRelationsContacts $contacts + * + * @param \RadioManager\Model\ModelTypeRelationsContacts $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -549,6 +631,7 @@ public function setContacts($contacts) /** * Gets presenters + * * @return \RadioManager\Model\ModelTypeRelationsPresenters */ public function getPresenters() @@ -558,7 +641,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\ModelTypeRelationsPresenters $presenters + * + * @param \RadioManager\Model\ModelTypeRelationsPresenters $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -570,6 +655,7 @@ public function setPresenters($presenters) /** * Gets items + * * @return \RadioManager\Model\ModelTypeRelationsItems */ public function getItems() @@ -579,7 +665,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ModelTypeRelationsItems $items + * + * @param \RadioManager\Model\ModelTypeRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -591,6 +679,7 @@ public function setItems($items) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -600,7 +689,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -611,7 +702,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -621,7 +714,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -631,8 +726,10 @@ 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 */ public function offsetSet($offset, $value) @@ -646,7 +743,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -656,15 +755,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ModelTypeResults.php b/lib/Model/ModelTypeResults.php index afd1afc..245c7ff 100644 --- a/lib/Model/ModelTypeResults.php +++ b/lib/Model/ModelTypeResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ModelTypeResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ModelTypeResults implements ArrayAccess +class ModelTypeResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ModelTypeResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class ModelTypeResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class ModelTypeResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\ModelTypeResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\ModelTypeResult[] $results + * + * @param \RadioManager\Model\ModelTypeResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/NotFound.php b/lib/Model/NotFound.php index 2145587..b3889ee 100644 --- a/lib/Model/NotFound.php +++ b/lib/Model/NotFound.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * NotFound Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class NotFound implements ArrayAccess +class NotFound implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'NotFound'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class NotFound implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class NotFound implements ArrayAccess 'status_code' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'status_code' => 'statusCode' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'status_code' => 'setStatusCode' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'status_code' => 'getStatusCode' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,25 +187,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['error'] === null) { - $invalid_properties[] = "'error' can't be null"; + $invalidProperties[] = "'error' can't be null"; } if ($this->container['status_code'] === null) { - $invalid_properties[] = "'status_code' can't be null"; + $invalidProperties[] = "'status_code' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets error + * * @return string */ public function getError() @@ -189,7 +235,9 @@ public function getError() /** * Sets error + * * @param string $error Given error, describes the problem. + * * @return $this */ public function setError($error) @@ -201,6 +249,7 @@ public function setError($error) /** * Gets status_code + * * @return int */ public function getStatusCode() @@ -210,7 +259,9 @@ public function getStatusCode() /** * Sets status_code + * * @param int $status_code Assigned StatusCode, is used in order to create a relationship between Error and Response. + * * @return $this */ public function setStatusCode($status_code) @@ -221,7 +272,9 @@ public function setStatusCode($status_code) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -231,7 +284,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -241,8 +296,10 @@ 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 */ public function offsetSet($offset, $value) @@ -256,7 +313,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -266,15 +325,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PostSuccess.php b/lib/Model/PostSuccess.php index a7311a4..61b3570 100644 --- a/lib/Model/PostSuccess.php +++ b/lib/Model/PostSuccess.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PostSuccess Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PostSuccess implements ArrayAccess +class PostSuccess implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PostSuccess'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class PostSuccess implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class PostSuccess implements ArrayAccess '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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'id' => 'id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'id' => 'setId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() '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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,22 +187,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['success'] === null) { - $invalid_properties[] = "'success' can't be null"; + $invalidProperties[] = "'success' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -174,6 +219,7 @@ public function valid() /** * Gets success + * * @return string */ public function getSuccess() @@ -183,7 +229,9 @@ public function getSuccess() /** * Sets success + * * @param string $success Describes whatever has succeeded + * * @return $this */ public function setSuccess($success) @@ -195,6 +243,7 @@ public function setSuccess($success) /** * Gets id + * * @return int */ public function getId() @@ -204,7 +253,9 @@ public function getId() /** * Sets id + * * @param int $id ID of the newly posted object + * * @return $this */ public function setId($id) @@ -215,7 +266,9 @@ public function setId($id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +278,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +290,10 @@ 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 */ public function offsetSet($offset, $value) @@ -250,7 +307,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +319,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Presenter.php b/lib/Model/Presenter.php index ebbd518..fd11ecc 100644 --- a/lib/Model/Presenter.php +++ b/lib/Model/Presenter.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Presenter Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Presenter implements ArrayAccess +class Presenter implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Presenter'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class Presenter implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class Presenter implements ArrayAccess 'name' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'name' => 'name' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'name' => 'setName' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'name' => 'getName' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,22 +211,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -198,6 +243,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -207,7 +253,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -219,6 +267,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -228,7 +277,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -240,6 +291,7 @@ public function setFieldValues($field_values) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -249,7 +301,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -261,6 +315,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -270,7 +325,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -282,6 +339,7 @@ public function setLastname($lastname) /** * Gets active + * * @return bool */ public function getActive() @@ -291,7 +349,9 @@ public function getActive() /** * Sets active - * @param bool $active + * + * @param bool $active active + * * @return $this */ public function setActive($active) @@ -303,6 +363,7 @@ public function setActive($active) /** * Gets name + * * @return string */ public function getName() @@ -312,7 +373,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -323,7 +386,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -333,7 +398,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -343,8 +410,10 @@ 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 */ public function offsetSet($offset, $value) @@ -358,7 +427,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -368,15 +439,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterDataInput.php b/lib/Model/PresenterDataInput.php index 3e7b93d..317f45b 100644 --- a/lib/Model/PresenterDataInput.php +++ b/lib/Model/PresenterDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterDataInput implements ArrayAccess +class PresenterDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class PresenterDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class PresenterDataInput implements ArrayAccess 'name' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'name' => 'name' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'name' => 'setName' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'name' => 'getName' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,22 +211,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -198,6 +243,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -207,7 +253,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -219,6 +267,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -228,7 +277,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -240,6 +291,7 @@ public function setFieldValues($field_values) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -249,7 +301,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -261,6 +315,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -270,7 +325,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -282,6 +339,7 @@ public function setLastname($lastname) /** * Gets active + * * @return bool */ public function getActive() @@ -291,7 +349,9 @@ public function getActive() /** * Sets active - * @param bool $active + * + * @param bool $active active + * * @return $this */ public function setActive($active) @@ -303,6 +363,7 @@ public function setActive($active) /** * Gets name + * * @return string */ public function getName() @@ -312,7 +373,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -323,7 +386,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -333,7 +398,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -343,8 +410,10 @@ 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 */ public function offsetSet($offset, $value) @@ -358,7 +427,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -368,15 +439,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterEPGResult.php b/lib/Model/PresenterEPGResult.php index 91357fe..ae9439d 100644 --- a/lib/Model/PresenterEPGResult.php +++ b/lib/Model/PresenterEPGResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterEPGResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterEPGResult implements ArrayAccess +class PresenterEPGResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterEPGResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -69,6 +72,7 @@ class PresenterEPGResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -85,18 +89,30 @@ class PresenterEPGResult implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -113,9 +129,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -132,9 +148,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -151,34 +167,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -196,34 +241,34 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -252,6 +297,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -261,7 +307,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -273,6 +321,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -282,7 +331,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -294,6 +345,7 @@ public function setFieldValues($field_values) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -303,7 +355,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -315,6 +369,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -324,7 +379,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -336,6 +393,7 @@ public function setLastname($lastname) /** * Gets active + * * @return bool */ public function getActive() @@ -345,7 +403,9 @@ public function getActive() /** * Sets active - * @param bool $active + * + * @param bool $active active + * * @return $this */ public function setActive($active) @@ -357,6 +417,7 @@ public function setActive($active) /** * Gets name + * * @return string */ public function getName() @@ -366,7 +427,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -378,6 +441,7 @@ public function setName($name) /** * Gets id + * * @return int */ public function getId() @@ -387,7 +451,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -399,6 +465,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -408,7 +475,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -420,6 +489,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -429,7 +499,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -441,6 +513,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -450,7 +523,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -462,6 +537,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -471,7 +547,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -482,7 +560,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -492,7 +572,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -502,8 +584,10 @@ 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 */ public function offsetSet($offset, $value) @@ -517,7 +601,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -527,15 +613,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterOutputOnly.php b/lib/Model/PresenterOutputOnly.php index 3dd7d5a..395e5e2 100644 --- a/lib/Model/PresenterOutputOnly.php +++ b/lib/Model/PresenterOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterOutputOnly implements ArrayAccess +class PresenterOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -63,6 +66,7 @@ class PresenterOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -73,18 +77,30 @@ class PresenterOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,9 +111,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -108,9 +124,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -121,34 +137,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -160,31 +205,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -219,7 +265,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -231,6 +279,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -240,7 +289,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -252,6 +303,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -261,7 +313,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -273,6 +327,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -282,7 +337,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -294,6 +351,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -303,7 +361,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -314,7 +374,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -324,7 +386,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -334,8 +398,10 @@ 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 */ public function offsetSet($offset, $value) @@ -349,7 +415,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -359,15 +427,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterRelations.php b/lib/Model/PresenterRelations.php index 925b5f9..c1a5bf5 100644 --- a/lib/Model/PresenterRelations.php +++ b/lib/Model/PresenterRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterRelations implements ArrayAccess +class PresenterRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +64,7 @@ class PresenterRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -69,18 +73,30 @@ class PresenterRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -89,9 +105,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -100,9 +116,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,34 +127,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -148,19 +193,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -174,6 +219,7 @@ public function valid() /** * Gets programs + * * @return \RadioManager\Model\PresenterRelationsPrograms */ public function getPrograms() @@ -183,7 +229,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\PresenterRelationsPrograms $programs + * + * @param \RadioManager\Model\PresenterRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -195,6 +243,7 @@ public function setPrograms($programs) /** * Gets broadcasts + * * @return \RadioManager\Model\PresenterRelationsBroadcasts */ public function getBroadcasts() @@ -204,7 +253,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\PresenterRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\PresenterRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -216,6 +267,7 @@ public function setBroadcasts($broadcasts) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -225,7 +277,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -236,7 +290,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -246,7 +302,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -256,8 +314,10 @@ 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 */ public function offsetSet($offset, $value) @@ -271,7 +331,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -281,15 +343,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterRelationsBroadcasts.php b/lib/Model/PresenterRelationsBroadcasts.php index 90f95e8..c5c699a 100644 --- a/lib/Model/PresenterRelationsBroadcasts.php +++ b/lib/Model/PresenterRelationsBroadcasts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterRelationsBroadcasts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterRelationsBroadcasts implements ArrayAccess +class PresenterRelationsBroadcasts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterRelations_broadcasts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class PresenterRelationsBroadcasts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class PresenterRelationsBroadcasts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\PresenterRelationsProgramsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\PresenterRelationsProgramsParams $params + * + * @param \RadioManager\Model\PresenterRelationsProgramsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterRelationsPrograms.php b/lib/Model/PresenterRelationsPrograms.php index 3b96133..7d59d0c 100644 --- a/lib/Model/PresenterRelationsPrograms.php +++ b/lib/Model/PresenterRelationsPrograms.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterRelationsPrograms Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterRelationsPrograms implements ArrayAccess +class PresenterRelationsPrograms implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterRelations_programs'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class PresenterRelationsPrograms implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class PresenterRelationsPrograms implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\PresenterRelationsProgramsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\PresenterRelationsProgramsParams $params + * + * @param \RadioManager\Model\PresenterRelationsProgramsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterRelationsProgramsParams.php b/lib/Model/PresenterRelationsProgramsParams.php index cc2c82f..01c85a4 100644 --- a/lib/Model/PresenterRelationsProgramsParams.php +++ b/lib/Model/PresenterRelationsProgramsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterRelationsProgramsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterRelationsProgramsParams implements ArrayAccess +class PresenterRelationsProgramsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterRelations_programs_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class PresenterRelationsProgramsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'presenter_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'presenter_id' => 'presenter_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'presenter_id' => 'setPresenterId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'presenter_id' => 'getPresenterId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets presenter_id + * * @return int */ public function getPresenterId() @@ -171,7 +217,9 @@ public function getPresenterId() /** * Sets presenter_id - * @param int $presenter_id + * + * @param int $presenter_id presenter_id + * * @return $this */ public function setPresenterId($presenter_id) @@ -182,7 +230,9 @@ public function setPresenterId($presenter_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterResult.php b/lib/Model/PresenterResult.php index ade6e9f..53063ee 100644 --- a/lib/Model/PresenterResult.php +++ b/lib/Model/PresenterResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterResult implements ArrayAccess +class PresenterResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -72,6 +75,7 @@ class PresenterResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -91,18 +95,30 @@ class PresenterResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -122,9 +138,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -144,9 +160,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -166,34 +182,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -214,34 +259,34 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -270,6 +315,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -279,7 +325,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -291,6 +339,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -300,7 +349,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -312,6 +363,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -321,7 +373,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -333,6 +387,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -342,7 +397,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -354,6 +411,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -363,7 +421,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -375,6 +435,7 @@ public function setExternalStationId($_external_station_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -384,7 +445,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -396,6 +459,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -405,7 +469,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -417,6 +483,7 @@ public function setFieldValues($field_values) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -426,7 +493,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -438,6 +507,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -447,7 +517,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -459,6 +531,7 @@ public function setLastname($lastname) /** * Gets active + * * @return bool */ public function getActive() @@ -468,7 +541,9 @@ public function getActive() /** * Sets active - * @param bool $active + * + * @param bool $active active + * * @return $this */ public function setActive($active) @@ -480,6 +555,7 @@ public function setActive($active) /** * Gets name + * * @return string */ public function getName() @@ -489,7 +565,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -501,6 +579,7 @@ public function setName($name) /** * Gets programs + * * @return \RadioManager\Model\PresenterRelationsPrograms */ public function getPrograms() @@ -510,7 +589,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\PresenterRelationsPrograms $programs + * + * @param \RadioManager\Model\PresenterRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -522,6 +603,7 @@ public function setPrograms($programs) /** * Gets broadcasts + * * @return \RadioManager\Model\PresenterRelationsBroadcasts */ public function getBroadcasts() @@ -531,7 +613,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\PresenterRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\PresenterRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -543,6 +627,7 @@ public function setBroadcasts($broadcasts) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -552,7 +637,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -563,7 +650,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -573,7 +662,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -583,8 +674,10 @@ 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 */ public function offsetSet($offset, $value) @@ -598,7 +691,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -608,15 +703,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/PresenterResults.php b/lib/Model/PresenterResults.php index 1642e2d..e24e473 100644 --- a/lib/Model/PresenterResults.php +++ b/lib/Model/PresenterResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * PresenterResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class PresenterResults implements ArrayAccess +class PresenterResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'PresenterResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class PresenterResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class PresenterResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\PresenterResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\PresenterResult[] $results + * + * @param \RadioManager\Model\PresenterResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Program.php b/lib/Model/Program.php index 7ecb76b..cb032d2 100644 --- a/lib/Model/Program.php +++ b/lib/Model/Program.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Program Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Program implements ArrayAccess +class Program implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Program'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -71,6 +74,7 @@ class Program implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -89,18 +93,30 @@ class Program implements ArrayAccess 'pty_code_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -119,9 +135,9 @@ public static function swaggerFormats() 'pty_code_id' => 'pty_code_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -140,9 +156,9 @@ public static function swaggerFormats() 'pty_code_id' => 'setPtyCodeId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -161,34 +177,63 @@ public static function swaggerFormats() 'pty_code_id' => 'getPtyCodeId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -208,25 +253,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['title'] === null) { - $invalid_properties[] = "'title' can't be null"; + $invalidProperties[] = "'title' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -246,6 +291,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -255,7 +301,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -267,6 +315,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -276,7 +325,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -288,6 +339,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -297,7 +349,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -309,6 +363,7 @@ public function setTitle($title) /** * Gets disabled + * * @return bool */ public function getDisabled() @@ -318,7 +373,9 @@ public function getDisabled() /** * Sets disabled - * @param bool $disabled + * + * @param bool $disabled disabled + * * @return $this */ public function setDisabled($disabled) @@ -330,6 +387,7 @@ public function setDisabled($disabled) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -339,7 +397,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -351,6 +411,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -360,7 +421,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -372,6 +435,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -381,7 +445,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -393,6 +459,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -402,7 +469,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -414,6 +483,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -423,7 +493,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -435,6 +507,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -444,7 +517,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -456,6 +531,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -465,7 +541,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -477,6 +555,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -486,7 +565,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -498,6 +579,7 @@ public function setLanguage($language) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -507,7 +589,9 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) @@ -518,7 +602,9 @@ public function setPtyCodeId($pty_code_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -528,7 +614,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -538,8 +626,10 @@ 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 */ public function offsetSet($offset, $value) @@ -553,7 +643,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -563,15 +655,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramDataInput.php b/lib/Model/ProgramDataInput.php index 4f5937e..66efa11 100644 --- a/lib/Model/ProgramDataInput.php +++ b/lib/Model/ProgramDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramDataInput implements ArrayAccess +class ProgramDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -73,6 +76,7 @@ class ProgramDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -93,18 +97,30 @@ class ProgramDataInput implements ArrayAccess 'presenters' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -125,9 +141,9 @@ public static function swaggerFormats() 'presenters' => 'presenters' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -148,9 +164,9 @@ public static function swaggerFormats() 'presenters' => 'setPresenters' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -171,34 +187,63 @@ public static function swaggerFormats() 'presenters' => 'getPresenters' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -220,25 +265,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['title'] === null) { - $invalid_properties[] = "'title' can't be null"; + $invalidProperties[] = "'title' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -258,6 +303,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -267,7 +313,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -279,6 +327,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -288,7 +337,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -300,6 +351,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -309,7 +361,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -321,6 +375,7 @@ public function setTitle($title) /** * Gets disabled + * * @return bool */ public function getDisabled() @@ -330,7 +385,9 @@ public function getDisabled() /** * Sets disabled - * @param bool $disabled + * + * @param bool $disabled disabled + * * @return $this */ public function setDisabled($disabled) @@ -342,6 +399,7 @@ public function setDisabled($disabled) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -351,7 +409,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -363,6 +423,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -372,7 +433,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -384,6 +447,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -393,7 +457,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -405,6 +471,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -414,7 +481,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -426,6 +495,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -435,7 +505,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -447,6 +519,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -456,7 +529,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -468,6 +543,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -477,7 +553,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -489,6 +567,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -498,7 +577,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -510,6 +591,7 @@ public function setLanguage($language) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -519,7 +601,9 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) @@ -531,6 +615,7 @@ public function setPtyCodeId($pty_code_id) /** * Gets tags + * * @return int[] */ public function getTags() @@ -540,7 +625,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -552,6 +639,7 @@ public function setTags($tags) /** * Gets presenters + * * @return int[] */ public function getPresenters() @@ -561,7 +649,9 @@ public function getPresenters() /** * Sets presenters - * @param int[] $presenters + * + * @param int[] $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -572,7 +662,9 @@ public function setPresenters($presenters) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -582,7 +674,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -592,8 +686,10 @@ 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 */ public function offsetSet($offset, $value) @@ -607,7 +703,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -617,15 +715,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramInputOnly.php b/lib/Model/ProgramInputOnly.php index 0177a96..81ef809 100644 --- a/lib/Model/ProgramInputOnly.php +++ b/lib/Model/ProgramInputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramInputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramInputOnly implements ArrayAccess +class ProgramInputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramInputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class ProgramInputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class ProgramInputOnly implements ArrayAccess 'presenters' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'presenters' => 'presenters' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'presenters' => 'setPresenters' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'presenters' => 'getPresenters' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,19 +187,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets tags + * * @return int[] */ public function getTags() @@ -177,7 +223,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -189,6 +237,7 @@ public function setTags($tags) /** * Gets presenters + * * @return int[] */ public function getPresenters() @@ -198,7 +247,9 @@ public function getPresenters() /** * Sets presenters - * @param int[] $presenters + * + * @param int[] $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -209,7 +260,9 @@ public function setPresenters($presenters) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -219,7 +272,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -229,8 +284,10 @@ 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 */ public function offsetSet($offset, $value) @@ -244,7 +301,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -254,15 +313,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramOutputOnly.php b/lib/Model/ProgramOutputOnly.php index ff5f4ac..d7d8725 100644 --- a/lib/Model/ProgramOutputOnly.php +++ b/lib/Model/ProgramOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramOutputOnly implements ArrayAccess +class ProgramOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -63,6 +66,7 @@ class ProgramOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -73,18 +77,30 @@ class ProgramOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,9 +111,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -108,9 +124,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -121,34 +137,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -160,31 +205,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -219,7 +265,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -231,6 +279,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -240,7 +289,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -252,6 +303,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -261,7 +313,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -273,6 +327,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -282,7 +337,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -294,6 +351,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -303,7 +361,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -314,7 +374,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -324,7 +386,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -334,8 +398,10 @@ 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 */ public function offsetSet($offset, $value) @@ -349,7 +415,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -359,15 +427,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelations.php b/lib/Model/ProgramRelations.php index d63a458..1f4da72 100644 --- a/lib/Model/ProgramRelations.php +++ b/lib/Model/ProgramRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,30 +30,34 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelations implements ArrayAccess +class ProgramRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ + 'genre' => '\RadioManager\Model\BroadcastRelationsGenre', 'items' => '\RadioManager\Model\ProgramRelationsItems', 'blocks' => '\RadioManager\Model\ProgramRelationsBlocks', 'broadcasts' => '\RadioManager\Model\ProgramRelationsBroadcasts', @@ -64,9 +68,11 @@ class ProgramRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ + 'genre' => null, 'items' => null, 'blocks' => null, 'broadcasts' => null, @@ -75,21 +81,34 @@ class ProgramRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'genre' => 'genre', 'items' => 'items', 'blocks' => 'blocks', 'broadcasts' => 'broadcasts', @@ -98,12 +117,13 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'genre' => 'setGenre', 'items' => 'setItems', 'blocks' => 'setBlocks', 'broadcasts' => 'setBroadcasts', @@ -112,12 +132,13 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'genre' => 'getGenre', 'items' => 'getItems', 'blocks' => 'getBlocks', 'broadcasts' => 'getBroadcasts', @@ -126,37 +147,67 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['genre'] = isset($data['genre']) ? $data['genre'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['blocks'] = isset($data['blocks']) ? $data['blocks'] : null; $this->container['broadcasts'] = isset($data['broadcasts']) ? $data['broadcasts'] : null; @@ -166,19 +217,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -190,8 +241,33 @@ public function valid() } + /** + * Gets genre + * + * @return \RadioManager\Model\BroadcastRelationsGenre + */ + public function getGenre() + { + return $this->container['genre']; + } + + /** + * Sets genre + * + * @param \RadioManager\Model\BroadcastRelationsGenre $genre genre + * + * @return $this + */ + public function setGenre($genre) + { + $this->container['genre'] = $genre; + + return $this; + } + /** * Gets items + * * @return \RadioManager\Model\ProgramRelationsItems */ public function getItems() @@ -201,7 +277,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ProgramRelationsItems $items + * + * @param \RadioManager\Model\ProgramRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -213,6 +291,7 @@ public function setItems($items) /** * Gets blocks + * * @return \RadioManager\Model\ProgramRelationsBlocks */ public function getBlocks() @@ -222,7 +301,9 @@ public function getBlocks() /** * Sets blocks - * @param \RadioManager\Model\ProgramRelationsBlocks $blocks + * + * @param \RadioManager\Model\ProgramRelationsBlocks $blocks blocks + * * @return $this */ public function setBlocks($blocks) @@ -234,6 +315,7 @@ public function setBlocks($blocks) /** * Gets broadcasts + * * @return \RadioManager\Model\ProgramRelationsBroadcasts */ public function getBroadcasts() @@ -243,7 +325,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\ProgramRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\ProgramRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -255,6 +339,7 @@ public function setBroadcasts($broadcasts) /** * Gets presenters + * * @return \RadioManager\Model\ProgramRelationsPresenters */ public function getPresenters() @@ -264,7 +349,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\ProgramRelationsPresenters $presenters + * + * @param \RadioManager\Model\ProgramRelationsPresenters $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -276,6 +363,7 @@ public function setPresenters($presenters) /** * Gets tags + * * @return \RadioManager\Model\ProgramRelationsTags */ public function getTags() @@ -285,7 +373,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\ProgramRelationsTags $tags + * + * @param \RadioManager\Model\ProgramRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -297,6 +387,7 @@ public function setTags($tags) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -306,7 +397,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -317,7 +410,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -327,7 +422,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -337,8 +434,10 @@ 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 */ public function offsetSet($offset, $value) @@ -352,7 +451,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -362,15 +463,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelationsBlocks.php b/lib/Model/ProgramRelationsBlocks.php index 808204d..d8398fd 100644 --- a/lib/Model/ProgramRelationsBlocks.php +++ b/lib/Model/ProgramRelationsBlocks.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelationsBlocks Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelationsBlocks implements ArrayAccess +class ProgramRelationsBlocks implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations_blocks'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ProgramRelationsBlocks implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ProgramRelationsBlocks implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ProgramRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ProgramRelationsItemsParams $params + * + * @param \RadioManager\Model\ProgramRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelationsBroadcasts.php b/lib/Model/ProgramRelationsBroadcasts.php index d07ca83..342b3c9 100644 --- a/lib/Model/ProgramRelationsBroadcasts.php +++ b/lib/Model/ProgramRelationsBroadcasts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelationsBroadcasts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelationsBroadcasts implements ArrayAccess +class ProgramRelationsBroadcasts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations_broadcasts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ProgramRelationsBroadcasts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ProgramRelationsBroadcasts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ProgramRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ProgramRelationsItemsParams $params + * + * @param \RadioManager\Model\ProgramRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelationsItems.php b/lib/Model/ProgramRelationsItems.php index e92afbf..914f96c 100644 --- a/lib/Model/ProgramRelationsItems.php +++ b/lib/Model/ProgramRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelationsItems implements ArrayAccess +class ProgramRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ProgramRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ProgramRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ProgramRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ProgramRelationsItemsParams $params + * + * @param \RadioManager\Model\ProgramRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelationsItemsParams.php b/lib/Model/ProgramRelationsItemsParams.php index e834838..088e81a 100644 --- a/lib/Model/ProgramRelationsItemsParams.php +++ b/lib/Model/ProgramRelationsItemsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelationsItemsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelationsItemsParams implements ArrayAccess +class ProgramRelationsItemsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations_items_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class ProgramRelationsItemsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'program_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'program_id' => 'program_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'program_id' => 'setProgramId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'program_id' => 'getProgramId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets program_id + * * @return int */ public function getProgramId() @@ -171,7 +217,9 @@ public function getProgramId() /** * Sets program_id - * @param int $program_id + * + * @param int $program_id program_id + * * @return $this */ public function setProgramId($program_id) @@ -182,7 +230,9 @@ public function setProgramId($program_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelationsPresenters.php b/lib/Model/ProgramRelationsPresenters.php index e110c92..b9345c5 100644 --- a/lib/Model/ProgramRelationsPresenters.php +++ b/lib/Model/ProgramRelationsPresenters.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelationsPresenters Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelationsPresenters implements ArrayAccess +class ProgramRelationsPresenters implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations_presenters'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ProgramRelationsPresenters implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ProgramRelationsPresenters implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ProgramRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ProgramRelationsItemsParams $params + * + * @param \RadioManager\Model\ProgramRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramRelationsTags.php b/lib/Model/ProgramRelationsTags.php index 4acb904..6ac2d87 100644 --- a/lib/Model/ProgramRelationsTags.php +++ b/lib/Model/ProgramRelationsTags.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramRelationsTags Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramRelationsTags implements ArrayAccess +class ProgramRelationsTags implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramRelations_tags'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class ProgramRelationsTags implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class ProgramRelationsTags implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\ProgramRelationsItemsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\ProgramRelationsItemsParams $params + * + * @param \RadioManager\Model\ProgramRelationsItemsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramResult.php b/lib/Model/ProgramResult.php index a9c8fb1..c4ea71b 100644 --- a/lib/Model/ProgramResult.php +++ b/lib/Model/ProgramResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramResult implements ArrayAccess +class ProgramResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -72,6 +75,7 @@ class ProgramResult implements ArrayAccess 'recommended' => 'bool', 'language' => 'string', 'pty_code_id' => 'int', + 'genre' => '\RadioManager\Model\BroadcastRelationsGenre', 'items' => '\RadioManager\Model\ProgramRelationsItems', 'blocks' => '\RadioManager\Model\ProgramRelationsBlocks', 'broadcasts' => '\RadioManager\Model\ProgramRelationsBroadcasts', @@ -82,6 +86,7 @@ class ProgramResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -103,6 +108,7 @@ class ProgramResult implements ArrayAccess 'recommended' => null, 'language' => null, 'pty_code_id' => 'int64', + 'genre' => null, 'items' => null, 'blocks' => null, 'broadcasts' => null, @@ -111,18 +117,30 @@ class ProgramResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -144,6 +162,7 @@ public static function swaggerFormats() 'recommended' => 'recommended', 'language' => 'language', 'pty_code_id' => 'pty_code_id', + 'genre' => 'genre', 'items' => 'items', 'blocks' => 'blocks', 'broadcasts' => 'broadcasts', @@ -152,9 +171,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -176,6 +195,7 @@ public static function swaggerFormats() 'recommended' => 'setRecommended', 'language' => 'setLanguage', 'pty_code_id' => 'setPtyCodeId', + 'genre' => 'setGenre', 'items' => 'setItems', 'blocks' => 'setBlocks', 'broadcasts' => 'setBroadcasts', @@ -184,9 +204,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -208,6 +228,7 @@ public static function swaggerFormats() 'recommended' => 'getRecommended', 'language' => 'getLanguage', 'pty_code_id' => 'getPtyCodeId', + 'genre' => 'getGenre', 'items' => 'getItems', 'blocks' => 'getBlocks', 'broadcasts' => 'getBroadcasts', @@ -216,34 +237,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -265,6 +315,7 @@ public function __construct(array $data = null) $this->container['recommended'] = isset($data['recommended']) ? $data['recommended'] : null; $this->container['language'] = isset($data['language']) ? $data['language'] : null; $this->container['pty_code_id'] = isset($data['pty_code_id']) ? $data['pty_code_id'] : null; + $this->container['genre'] = isset($data['genre']) ? $data['genre'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['blocks'] = isset($data['blocks']) ? $data['blocks'] : null; $this->container['broadcasts'] = isset($data['broadcasts']) ? $data['broadcasts'] : null; @@ -274,37 +325,37 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['updated_at'] === null) { - $invalid_properties[] = "'updated_at' can't be null"; + $invalidProperties[] = "'updated_at' can't be null"; } if ($this->container['created_at'] === null) { - $invalid_properties[] = "'created_at' can't be null"; + $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['deleted_at'] === null) { - $invalid_properties[] = "'deleted_at' can't be null"; + $invalidProperties[] = "'deleted_at' can't be null"; } if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['title'] === null) { - $invalid_properties[] = "'title' can't be null"; + $invalidProperties[] = "'title' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -336,6 +387,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -345,7 +397,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -357,6 +411,7 @@ public function setId($id) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -366,7 +421,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -378,6 +435,7 @@ public function setUpdatedAt($updated_at) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -387,7 +445,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -399,6 +459,7 @@ public function setCreatedAt($created_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -408,7 +469,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -420,6 +483,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -429,7 +493,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -441,6 +507,7 @@ public function setExternalStationId($_external_station_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -450,7 +517,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -462,6 +531,7 @@ public function setModelTypeId($model_type_id) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -471,7 +541,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -483,6 +555,7 @@ public function setFieldValues($field_values) /** * Gets title + * * @return string */ public function getTitle() @@ -492,7 +565,9 @@ public function getTitle() /** * Sets title - * @param string $title + * + * @param string $title title + * * @return $this */ public function setTitle($title) @@ -504,6 +579,7 @@ public function setTitle($title) /** * Gets disabled + * * @return bool */ public function getDisabled() @@ -513,7 +589,9 @@ public function getDisabled() /** * Sets disabled - * @param bool $disabled + * + * @param bool $disabled disabled + * * @return $this */ public function setDisabled($disabled) @@ -525,6 +603,7 @@ public function setDisabled($disabled) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -534,7 +613,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -546,6 +627,7 @@ public function setGenreId($genre_id) /** * Gets description + * * @return string */ public function getDescription() @@ -555,7 +637,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -567,6 +651,7 @@ public function setDescription($description) /** * Gets short_name + * * @return string */ public function getShortName() @@ -576,7 +661,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -588,6 +675,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -597,7 +685,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -609,6 +699,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -618,7 +709,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -630,6 +723,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -639,7 +733,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -651,6 +747,7 @@ public function setEmail($email) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -660,7 +757,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -672,6 +771,7 @@ public function setRecommended($recommended) /** * Gets language + * * @return string */ public function getLanguage() @@ -681,7 +781,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -693,6 +795,7 @@ public function setLanguage($language) /** * Gets pty_code_id + * * @return int */ public function getPtyCodeId() @@ -702,7 +805,9 @@ public function getPtyCodeId() /** * Sets pty_code_id - * @param int $pty_code_id + * + * @param int $pty_code_id pty_code_id + * * @return $this */ public function setPtyCodeId($pty_code_id) @@ -712,8 +817,33 @@ public function setPtyCodeId($pty_code_id) return $this; } + /** + * Gets genre + * + * @return \RadioManager\Model\BroadcastRelationsGenre + */ + public function getGenre() + { + return $this->container['genre']; + } + + /** + * Sets genre + * + * @param \RadioManager\Model\BroadcastRelationsGenre $genre genre + * + * @return $this + */ + public function setGenre($genre) + { + $this->container['genre'] = $genre; + + return $this; + } + /** * Gets items + * * @return \RadioManager\Model\ProgramRelationsItems */ public function getItems() @@ -723,7 +853,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\ProgramRelationsItems $items + * + * @param \RadioManager\Model\ProgramRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -735,6 +867,7 @@ public function setItems($items) /** * Gets blocks + * * @return \RadioManager\Model\ProgramRelationsBlocks */ public function getBlocks() @@ -744,7 +877,9 @@ public function getBlocks() /** * Sets blocks - * @param \RadioManager\Model\ProgramRelationsBlocks $blocks + * + * @param \RadioManager\Model\ProgramRelationsBlocks $blocks blocks + * * @return $this */ public function setBlocks($blocks) @@ -756,6 +891,7 @@ public function setBlocks($blocks) /** * Gets broadcasts + * * @return \RadioManager\Model\ProgramRelationsBroadcasts */ public function getBroadcasts() @@ -765,7 +901,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\ProgramRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\ProgramRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -777,6 +915,7 @@ public function setBroadcasts($broadcasts) /** * Gets presenters + * * @return \RadioManager\Model\ProgramRelationsPresenters */ public function getPresenters() @@ -786,7 +925,9 @@ public function getPresenters() /** * Sets presenters - * @param \RadioManager\Model\ProgramRelationsPresenters $presenters + * + * @param \RadioManager\Model\ProgramRelationsPresenters $presenters presenters + * * @return $this */ public function setPresenters($presenters) @@ -798,6 +939,7 @@ public function setPresenters($presenters) /** * Gets tags + * * @return \RadioManager\Model\ProgramRelationsTags */ public function getTags() @@ -807,7 +949,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\ProgramRelationsTags $tags + * + * @param \RadioManager\Model\ProgramRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -819,6 +963,7 @@ public function setTags($tags) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -828,7 +973,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -839,7 +986,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -849,7 +998,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -859,8 +1010,10 @@ 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 */ public function offsetSet($offset, $value) @@ -874,7 +1027,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -884,15 +1039,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ProgramResults.php b/lib/Model/ProgramResults.php index c81d915..9406c58 100644 --- a/lib/Model/ProgramResults.php +++ b/lib/Model/ProgramResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ProgramResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ProgramResults implements ArrayAccess +class ProgramResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ProgramResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class ProgramResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class ProgramResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\ProgramResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\ProgramResult[] $results + * + * @param \RadioManager\Model\ProgramResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/ReadOnly.php b/lib/Model/ReadOnly.php index 1f29371..daca04b 100644 --- a/lib/Model/ReadOnly.php +++ b/lib/Model/ReadOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * ReadOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class ReadOnly implements ArrayAccess +class ReadOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ReadOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +63,7 @@ class ReadOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -67,18 +71,30 @@ class ReadOnly implements ArrayAccess 'status_code' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -86,9 +102,9 @@ public static function swaggerFormats() 'status_code' => 'statusCode' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'status_code' => 'setStatusCode' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -106,34 +122,63 @@ public static function swaggerFormats() 'status_code' => 'getStatusCode' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -142,25 +187,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['error'] === null) { - $invalid_properties[] = "'error' can't be null"; + $invalidProperties[] = "'error' can't be null"; } if ($this->container['status_code'] === null) { - $invalid_properties[] = "'status_code' can't be null"; + $invalidProperties[] = "'status_code' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets error + * * @return string */ public function getError() @@ -189,7 +235,9 @@ public function getError() /** * Sets error + * * @param string $error Given error (not formatted), describes the problem. + * * @return $this */ public function setError($error) @@ -201,6 +249,7 @@ public function setError($error) /** * Gets status_code + * * @return int */ public function getStatusCode() @@ -210,7 +259,9 @@ public function getStatusCode() /** * Sets status_code + * * @param int $status_code Assigned StatusCode, is used in order to create a relationship between Error and Response. + * * @return $this */ public function setStatusCode($status_code) @@ -221,7 +272,9 @@ public function setStatusCode($status_code) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -231,7 +284,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -241,8 +296,10 @@ 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 */ public function offsetSet($offset, $value) @@ -256,7 +313,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -266,15 +325,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/RelationsPlaceholder.php b/lib/Model/RelationsPlaceholder.php index a0d3188..dbd34f4 100644 --- a/lib/Model/RelationsPlaceholder.php +++ b/lib/Model/RelationsPlaceholder.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * RelationsPlaceholder Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class RelationsPlaceholder implements ArrayAccess +class RelationsPlaceholder implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'RelationsPlaceholder'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class RelationsPlaceholder implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class RelationsPlaceholder implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,31 +199,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['href'] === null) { - $invalid_properties[] = "'href' can't be null"; + $invalidProperties[] = "'href' can't be null"; } if ($this->container['model'] === null) { - $invalid_properties[] = "'model' can't be null"; + $invalidProperties[] = "'model' can't be null"; } if ($this->container['operation'] === null) { - $invalid_properties[] = "'operation' can't be null"; + $invalidProperties[] = "'operation' can't be null"; } if ($this->container['params'] === null) { - $invalid_properties[] = "'params' can't be null"; + $invalidProperties[] = "'params' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -204,6 +249,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -213,7 +259,9 @@ public function getHref() /** * Sets href + * * @param string $href HREF + * * @return $this */ public function setHref($href) @@ -225,6 +273,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -234,7 +283,9 @@ public function getModel() /** * Sets model + * * @param string $model MODEL + * * @return $this */ public function setModel($model) @@ -246,6 +297,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -255,7 +307,9 @@ public function getOperation() /** * Sets operation + * * @param string $operation OPERATION + * * @return $this */ public function setOperation($operation) @@ -267,6 +321,7 @@ public function setOperation($operation) /** * Gets params + * * @return object */ public function getParams() @@ -276,7 +331,9 @@ public function getParams() /** * Sets params + * * @param object $params PARAMS + * * @return $this */ public function setParams($params) @@ -287,7 +344,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -297,7 +356,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -307,8 +368,10 @@ 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 */ public function offsetSet($offset, $value) @@ -322,7 +385,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -332,15 +397,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StationResult.php b/lib/Model/StationResult.php index d09c5ff..0819a28 100644 --- a/lib/Model/StationResult.php +++ b/lib/Model/StationResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StationResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StationResult implements ArrayAccess +class StationResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StationResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class StationResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'station' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'station' => 'station' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'station' => 'setStation' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'station' => 'getStation' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets station + * * @return \RadioManager\Model\StationResultStation */ public function getStation() @@ -171,7 +217,9 @@ public function getStation() /** * Sets station - * @param \RadioManager\Model\StationResultStation $station + * + * @param \RadioManager\Model\StationResultStation $station station + * * @return $this */ public function setStation($station) @@ -182,7 +230,9 @@ public function setStation($station) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StationResultStation.php b/lib/Model/StationResultStation.php index f62fb0d..249c321 100644 --- a/lib/Model/StationResultStation.php +++ b/lib/Model/StationResultStation.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StationResultStation Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StationResultStation implements ArrayAccess +class StationResultStation implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StationResult_station'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -78,11 +81,15 @@ class StationResultStation implements ArrayAccess 'pty_code' => 'int', 'pty_type' => 'string', 'station_key' => 'string', - 'timezone' => 'string' + 'timezone' => 'string', + 'metadataradio_organisation' => 'string', + 'metadataradio_station_id' => 'string', + 'start_days' => '\RadioManager\Model\StationResultStationStartDays' ]; /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -110,21 +117,36 @@ class StationResultStation implements ArrayAccess 'pty_code' => null, 'pty_type' => null, 'station_key' => null, - 'timezone' => null + 'timezone' => null, + 'metadataradio_organisation' => null, + 'metadataradio_station_id' => null, + 'start_days' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -152,12 +174,15 @@ public static function swaggerFormats() 'pty_code' => 'pty_code', 'pty_type' => 'pty_type', 'station_key' => 'station_key', - 'timezone' => 'timezone' + 'timezone' => 'timezone', + 'metadataradio_organisation' => 'metadataradio_organisation', + 'metadataradio_station_id' => 'metadataradio_station_id', + 'start_days' => 'start_days' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -185,12 +210,15 @@ public static function swaggerFormats() 'pty_code' => 'setPtyCode', 'pty_type' => 'setPtyType', 'station_key' => 'setStationKey', - 'timezone' => 'setTimezone' + 'timezone' => 'setTimezone', + 'metadataradio_organisation' => 'setMetadataradioOrganisation', + 'metadataradio_station_id' => 'setMetadataradioStationId', + 'start_days' => 'setStartDays' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -218,37 +246,69 @@ public static function swaggerFormats() 'pty_code' => 'getPtyCode', 'pty_type' => 'getPtyType', 'station_key' => 'getStationKey', - 'timezone' => 'getTimezone' + 'timezone' => 'getTimezone', + 'metadataradio_organisation' => 'getMetadataradioOrganisation', + 'metadataradio_station_id' => 'getMetadataradioStationId', + 'start_days' => 'getStartDays' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -277,22 +337,25 @@ public function __construct(array $data = null) $this->container['pty_type'] = isset($data['pty_type']) ? $data['pty_type'] : null; $this->container['station_key'] = isset($data['station_key']) ? $data['station_key'] : null; $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; + $this->container['metadataradio_organisation'] = isset($data['metadataradio_organisation']) ? $data['metadataradio_organisation'] : null; + $this->container['metadataradio_station_id'] = isset($data['metadataradio_station_id']) ? $data['metadataradio_station_id'] : null; + $this->container['start_days'] = isset($data['start_days']) ? $data['start_days'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -306,6 +369,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -315,7 +379,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -327,6 +393,7 @@ public function setId($id) /** * Gets name + * * @return string */ public function getName() @@ -336,7 +403,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -348,6 +417,7 @@ public function setName($name) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -357,7 +427,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -369,6 +441,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -378,7 +451,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -390,6 +465,7 @@ public function setUpdatedAt($updated_at) /** * Gets system_name + * * @return string */ public function getSystemName() @@ -399,7 +475,9 @@ public function getSystemName() /** * Sets system_name - * @param string $system_name + * + * @param string $system_name system_name + * * @return $this */ public function setSystemName($system_name) @@ -411,6 +489,7 @@ public function setSystemName($system_name) /** * Gets short_name + * * @return string */ public function getShortName() @@ -420,7 +499,9 @@ public function getShortName() /** * Sets short_name - * @param string $short_name + * + * @param string $short_name short_name + * * @return $this */ public function setShortName($short_name) @@ -432,6 +513,7 @@ public function setShortName($short_name) /** * Gets medium_name + * * @return string */ public function getMediumName() @@ -441,7 +523,9 @@ public function getMediumName() /** * Sets medium_name - * @param string $medium_name + * + * @param string $medium_name medium_name + * * @return $this */ public function setMediumName($medium_name) @@ -453,6 +537,7 @@ public function setMediumName($medium_name) /** * Gets website + * * @return string */ public function getWebsite() @@ -462,7 +547,9 @@ public function getWebsite() /** * Sets website - * @param string $website + * + * @param string $website website + * * @return $this */ public function setWebsite($website) @@ -474,6 +561,7 @@ public function setWebsite($website) /** * Gets email + * * @return string */ public function getEmail() @@ -483,7 +571,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -495,6 +585,7 @@ public function setEmail($email) /** * Gets keywords + * * @return string[] */ public function getKeywords() @@ -504,7 +595,9 @@ public function getKeywords() /** * Sets keywords - * @param string[] $keywords + * + * @param string[] $keywords keywords + * * @return $this */ public function setKeywords($keywords) @@ -516,6 +609,7 @@ public function setKeywords($keywords) /** * Gets description + * * @return string */ public function getDescription() @@ -525,7 +619,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -537,6 +633,7 @@ public function setDescription($description) /** * Gets sms + * * @return string */ public function getSms() @@ -546,7 +643,9 @@ public function getSms() /** * Sets sms - * @param string $sms + * + * @param string $sms sms + * * @return $this */ public function setSms($sms) @@ -558,6 +657,7 @@ public function setSms($sms) /** * Gets telephone + * * @return string */ public function getTelephone() @@ -567,7 +667,9 @@ public function getTelephone() /** * Sets telephone - * @param string $telephone + * + * @param string $telephone telephone + * * @return $this */ public function setTelephone($telephone) @@ -579,6 +681,7 @@ public function setTelephone($telephone) /** * Gets genre_id + * * @return int */ public function getGenreId() @@ -588,7 +691,9 @@ public function getGenreId() /** * Sets genre_id - * @param int $genre_id + * + * @param int $genre_id genre_id + * * @return $this */ public function setGenreId($genre_id) @@ -600,6 +705,7 @@ public function setGenreId($genre_id) /** * Gets language + * * @return string */ public function getLanguage() @@ -609,7 +715,9 @@ public function getLanguage() /** * Sets language - * @param string $language + * + * @param string $language language + * * @return $this */ public function setLanguage($language) @@ -621,6 +729,7 @@ public function setLanguage($language) /** * Gets active + * * @return bool */ public function getActive() @@ -630,7 +739,9 @@ public function getActive() /** * Sets active - * @param bool $active + * + * @param bool $active active + * * @return $this */ public function setActive($active) @@ -642,6 +753,7 @@ public function setActive($active) /** * Gets logo_rectangle + * * @return string */ public function getLogoRectangle() @@ -651,7 +763,9 @@ public function getLogoRectangle() /** * Sets logo_rectangle - * @param string $logo_rectangle + * + * @param string $logo_rectangle logo_rectangle + * * @return $this */ public function setLogoRectangle($logo_rectangle) @@ -663,6 +777,7 @@ public function setLogoRectangle($logo_rectangle) /** * Gets logo_128x128 + * * @return string */ public function getLogo128x128() @@ -672,7 +787,9 @@ public function getLogo128x128() /** * Sets logo_128x128 - * @param string $logo_128x128 + * + * @param string $logo_128x128 logo_128x128 + * * @return $this */ public function setLogo128x128($logo_128x128) @@ -684,6 +801,7 @@ public function setLogo128x128($logo_128x128) /** * Gets logo_320x320 + * * @return string */ public function getLogo320x320() @@ -693,7 +811,9 @@ public function getLogo320x320() /** * Sets logo_320x320 - * @param string $logo_320x320 + * + * @param string $logo_320x320 logo_320x320 + * * @return $this */ public function setLogo320x320($logo_320x320) @@ -705,6 +825,7 @@ public function setLogo320x320($logo_320x320) /** * Gets logo_600x600 + * * @return string */ public function getLogo600x600() @@ -714,7 +835,9 @@ public function getLogo600x600() /** * Sets logo_600x600 - * @param string $logo_600x600 + * + * @param string $logo_600x600 logo_600x600 + * * @return $this */ public function setLogo600x600($logo_600x600) @@ -726,6 +849,7 @@ public function setLogo600x600($logo_600x600) /** * Gets pay_off + * * @return string */ public function getPayOff() @@ -735,7 +859,9 @@ public function getPayOff() /** * Sets pay_off - * @param string $pay_off + * + * @param string $pay_off pay_off + * * @return $this */ public function setPayOff($pay_off) @@ -747,6 +873,7 @@ public function setPayOff($pay_off) /** * Gets pty_code + * * @return int */ public function getPtyCode() @@ -756,7 +883,9 @@ public function getPtyCode() /** * Sets pty_code - * @param int $pty_code + * + * @param int $pty_code pty_code + * * @return $this */ public function setPtyCode($pty_code) @@ -768,6 +897,7 @@ public function setPtyCode($pty_code) /** * Gets pty_type + * * @return string */ public function getPtyType() @@ -777,7 +907,9 @@ public function getPtyType() /** * Sets pty_type - * @param string $pty_type + * + * @param string $pty_type pty_type + * * @return $this */ public function setPtyType($pty_type) @@ -789,6 +921,7 @@ public function setPtyType($pty_type) /** * Gets station_key + * * @return string */ public function getStationKey() @@ -798,7 +931,9 @@ public function getStationKey() /** * Sets station_key - * @param string $station_key + * + * @param string $station_key station_key + * * @return $this */ public function setStationKey($station_key) @@ -810,6 +945,7 @@ public function setStationKey($station_key) /** * Gets timezone + * * @return string */ public function getTimezone() @@ -819,7 +955,9 @@ public function getTimezone() /** * Sets timezone - * @param string $timezone + * + * @param string $timezone timezone + * * @return $this */ public function setTimezone($timezone) @@ -828,9 +966,83 @@ public function setTimezone($timezone) return $this; } + + /** + * Gets metadataradio_organisation + * + * @return string + */ + public function getMetadataradioOrganisation() + { + return $this->container['metadataradio_organisation']; + } + + /** + * Sets metadataradio_organisation + * + * @param string $metadataradio_organisation metadataradio_organisation + * + * @return $this + */ + public function setMetadataradioOrganisation($metadataradio_organisation) + { + $this->container['metadataradio_organisation'] = $metadataradio_organisation; + + return $this; + } + + /** + * Gets metadataradio_station_id + * + * @return string + */ + public function getMetadataradioStationId() + { + return $this->container['metadataradio_station_id']; + } + + /** + * Sets metadataradio_station_id + * + * @param string $metadataradio_station_id metadataradio_station_id + * + * @return $this + */ + public function setMetadataradioStationId($metadataradio_station_id) + { + $this->container['metadataradio_station_id'] = $metadataradio_station_id; + + return $this; + } + + /** + * Gets start_days + * + * @return \RadioManager\Model\StationResultStationStartDays + */ + public function getStartDays() + { + return $this->container['start_days']; + } + + /** + * Sets start_days + * + * @param \RadioManager\Model\StationResultStationStartDays $start_days start_days + * + * @return $this + */ + public function setStartDays($start_days) + { + $this->container['start_days'] = $start_days; + + return $this; + } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -840,7 +1052,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -850,8 +1064,10 @@ 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 */ public function offsetSet($offset, $value) @@ -865,7 +1081,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -875,15 +1093,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StationResultStationStartDays.php b/lib/Model/StationResultStationStartDays.php index fd3ed71..e54398f 100644 --- a/lib/Model/StationResultStationStartDays.php +++ b/lib/Model/StationResultStationStartDays.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StationResultStationStartDays Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StationResultStationStartDays implements ArrayAccess +class StationResultStationStartDays implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StationResult_station_start_days'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -65,6 +68,7 @@ class StationResultStationStartDays implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -77,18 +81,30 @@ class StationResultStationStartDays implements ArrayAccess 'sunday' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,9 +117,9 @@ public static function swaggerFormats() 'sunday' => 'sunday' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -116,9 +132,9 @@ public static function swaggerFormats() 'sunday' => 'setSunday' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -131,34 +147,63 @@ public static function swaggerFormats() 'sunday' => 'getSunday' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -172,19 +217,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -198,6 +243,7 @@ public function valid() /** * Gets monday + * * @return string */ public function getMonday() @@ -207,7 +253,9 @@ public function getMonday() /** * Sets monday - * @param string $monday + * + * @param string $monday monday + * * @return $this */ public function setMonday($monday) @@ -219,6 +267,7 @@ public function setMonday($monday) /** * Gets tuesday + * * @return string */ public function getTuesday() @@ -228,7 +277,9 @@ public function getTuesday() /** * Sets tuesday - * @param string $tuesday + * + * @param string $tuesday tuesday + * * @return $this */ public function setTuesday($tuesday) @@ -240,6 +291,7 @@ public function setTuesday($tuesday) /** * Gets wednesday + * * @return string */ public function getWednesday() @@ -249,7 +301,9 @@ public function getWednesday() /** * Sets wednesday - * @param string $wednesday + * + * @param string $wednesday wednesday + * * @return $this */ public function setWednesday($wednesday) @@ -261,6 +315,7 @@ public function setWednesday($wednesday) /** * Gets thursday + * * @return string */ public function getThursday() @@ -270,7 +325,9 @@ public function getThursday() /** * Sets thursday - * @param string $thursday + * + * @param string $thursday thursday + * * @return $this */ public function setThursday($thursday) @@ -282,6 +339,7 @@ public function setThursday($thursday) /** * Gets friday + * * @return string */ public function getFriday() @@ -291,7 +349,9 @@ public function getFriday() /** * Sets friday - * @param string $friday + * + * @param string $friday friday + * * @return $this */ public function setFriday($friday) @@ -303,6 +363,7 @@ public function setFriday($friday) /** * Gets saturday + * * @return string */ public function getSaturday() @@ -312,7 +373,9 @@ public function getSaturday() /** * Sets saturday - * @param string $saturday + * + * @param string $saturday saturday + * * @return $this */ public function setSaturday($saturday) @@ -324,6 +387,7 @@ public function setSaturday($saturday) /** * Gets sunday + * * @return string */ public function getSunday() @@ -333,7 +397,9 @@ public function getSunday() /** * Sets sunday - * @param string $sunday + * + * @param string $sunday sunday + * * @return $this */ public function setSunday($sunday) @@ -344,7 +410,9 @@ public function setSunday($sunday) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -354,7 +422,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -364,8 +434,10 @@ 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 */ public function offsetSet($offset, $value) @@ -379,7 +451,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -389,15 +463,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Story.php b/lib/Model/Story.php index eb186dc..b36f64e 100644 --- a/lib/Model/Story.php +++ b/lib/Model/Story.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,28 +30,31 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Story Class Doc Comment * - * @category Class + * @category Class * @description Story - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Story implements ArrayAccess +class Story implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Story'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class Story implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -74,18 +78,30 @@ class Story implements ArrayAccess 'description' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() 'description' => 'description' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -109,9 +125,9 @@ public static function swaggerFormats() 'description' => 'setDescription' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -122,34 +138,63 @@ public static function swaggerFormats() 'description' => 'getDescription' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -161,25 +206,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -199,6 +244,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -208,7 +254,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -220,6 +268,7 @@ public function setModelTypeId($model_type_id) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -229,7 +278,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -241,6 +292,7 @@ public function setRecommended($recommended) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -250,7 +302,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -262,6 +316,7 @@ public function setFieldValues($field_values) /** * Gets name + * * @return string */ public function getName() @@ -271,7 +326,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -283,6 +340,7 @@ public function setName($name) /** * Gets description + * * @return string */ public function getDescription() @@ -292,7 +350,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -303,7 +363,9 @@ public function setDescription($description) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -313,7 +375,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -323,8 +387,10 @@ 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 */ public function offsetSet($offset, $value) @@ -338,7 +404,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -348,15 +416,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryDataInput.php b/lib/Model/StoryDataInput.php index 41b9e21..4f55309 100644 --- a/lib/Model/StoryDataInput.php +++ b/lib/Model/StoryDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryDataInput implements ArrayAccess +class StoryDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class StoryDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class StoryDataInput implements ArrayAccess 'tags' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'tags' => 'tags' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'tags' => 'setTags' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'tags' => 'getTags' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,25 +211,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -204,6 +249,7 @@ public function valid() /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -213,7 +259,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -225,6 +273,7 @@ public function setModelTypeId($model_type_id) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -234,7 +283,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -246,6 +297,7 @@ public function setRecommended($recommended) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -255,7 +307,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -267,6 +321,7 @@ public function setFieldValues($field_values) /** * Gets name + * * @return string */ public function getName() @@ -276,7 +331,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -288,6 +345,7 @@ public function setName($name) /** * Gets description + * * @return string */ public function getDescription() @@ -297,7 +355,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -309,6 +369,7 @@ public function setDescription($description) /** * Gets tags + * * @return int[] */ public function getTags() @@ -318,7 +379,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -329,7 +392,9 @@ public function setTags($tags) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -339,7 +404,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -349,8 +416,10 @@ 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 */ public function offsetSet($offset, $value) @@ -364,7 +433,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -374,15 +445,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryInputOnly.php b/lib/Model/StoryInputOnly.php index 42814a4..9ff823a 100644 --- a/lib/Model/StoryInputOnly.php +++ b/lib/Model/StoryInputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryInputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryInputOnly implements ArrayAccess +class StoryInputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryInputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class StoryInputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'tags' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'tags' => 'tags' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'tags' => 'setTags' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'tags' => 'getTags' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets tags + * * @return int[] */ public function getTags() @@ -171,7 +217,9 @@ public function getTags() /** * Sets tags - * @param int[] $tags + * + * @param int[] $tags tags + * * @return $this */ public function setTags($tags) @@ -182,7 +230,9 @@ public function setTags($tags) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryOutputOnly.php b/lib/Model/StoryOutputOnly.php index c58012f..0466301 100644 --- a/lib/Model/StoryOutputOnly.php +++ b/lib/Model/StoryOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,28 +30,31 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryOutputOnly Class Doc Comment * - * @category Class + * @category Class * @description Story - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryOutputOnly implements ArrayAccess +class StoryOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class StoryOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -74,18 +78,30 @@ class StoryOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -96,9 +112,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -109,9 +125,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -122,34 +138,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -161,19 +206,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -187,6 +232,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -196,7 +242,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -208,6 +256,7 @@ public function setId($id) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -217,7 +266,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -229,6 +280,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -238,7 +290,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -250,6 +304,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -259,7 +314,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -271,6 +328,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -280,7 +338,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -291,7 +351,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -301,7 +363,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -311,8 +375,10 @@ 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 */ public function offsetSet($offset, $value) @@ -326,7 +392,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -336,15 +404,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryRelations.php b/lib/Model/StoryRelations.php index 6d58dc4..83b03dc 100644 --- a/lib/Model/StoryRelations.php +++ b/lib/Model/StoryRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryRelations implements ArrayAccess +class StoryRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +64,7 @@ class StoryRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -69,18 +73,30 @@ class StoryRelations implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -89,9 +105,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -100,9 +116,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,34 +127,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -148,19 +193,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + if ($this->container['tags'] === null) { + $invalidProperties[] = "'tags' can't be null"; + } + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,12 +216,16 @@ public function listInvalidProperties() public function valid() { + if ($this->container['tags'] === null) { + return false; + } return true; } /** * Gets tags + * * @return \RadioManager\Model\StoryRelationsTags */ public function getTags() @@ -183,7 +235,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\StoryRelationsTags $tags + * + * @param \RadioManager\Model\StoryRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -195,6 +249,7 @@ public function setTags($tags) /** * Gets items + * * @return \RadioManager\Model\StoryRelationsItems */ public function getItems() @@ -204,7 +259,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\StoryRelationsItems $items + * + * @param \RadioManager\Model\StoryRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -216,6 +273,7 @@ public function setItems($items) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -225,7 +283,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -236,7 +296,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -246,7 +308,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -256,8 +320,10 @@ 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 */ public function offsetSet($offset, $value) @@ -271,7 +337,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -281,15 +349,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryRelationsItems.php b/lib/Model/StoryRelationsItems.php index 8349473..3cc01f5 100644 --- a/lib/Model/StoryRelationsItems.php +++ b/lib/Model/StoryRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryRelationsItems implements ArrayAccess +class StoryRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class StoryRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class StoryRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\StoryRelationsTagsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\StoryRelationsTagsParams $params + * + * @param \RadioManager\Model\StoryRelationsTagsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryRelationsTags.php b/lib/Model/StoryRelationsTags.php index a7070c5..a224b4f 100644 --- a/lib/Model/StoryRelationsTags.php +++ b/lib/Model/StoryRelationsTags.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryRelationsTags Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryRelationsTags implements ArrayAccess +class StoryRelationsTags implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryRelations_tags'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class StoryRelationsTags implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class StoryRelationsTags implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\StoryRelationsTagsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\StoryRelationsTagsParams $params + * + * @param \RadioManager\Model\StoryRelationsTagsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryRelationsTagsParams.php b/lib/Model/StoryRelationsTagsParams.php index 7324dd4..358735e 100644 --- a/lib/Model/StoryRelationsTagsParams.php +++ b/lib/Model/StoryRelationsTagsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryRelationsTagsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryRelationsTagsParams implements ArrayAccess +class StoryRelationsTagsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryRelations_tags_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class StoryRelationsTagsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'story_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'story_id' => 'story_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'story_id' => 'setStoryId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'story_id' => 'getStoryId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets story_id + * * @return int */ public function getStoryId() @@ -171,7 +217,9 @@ public function getStoryId() /** * Sets story_id - * @param int $story_id + * + * @param int $story_id story_id + * * @return $this */ public function setStoryId($story_id) @@ -182,7 +230,9 @@ public function setStoryId($story_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryResult.php b/lib/Model/StoryResult.php index 2ab6888..dedfe1b 100644 --- a/lib/Model/StoryResult.php +++ b/lib/Model/StoryResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryResult implements ArrayAccess +class StoryResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -71,6 +74,7 @@ class StoryResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -89,18 +93,30 @@ class StoryResult implements ArrayAccess 'model_type' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -119,9 +135,9 @@ public static function swaggerFormats() 'model_type' => 'model_type' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -140,9 +156,9 @@ public static function swaggerFormats() 'model_type' => 'setModelType' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -161,34 +177,63 @@ public static function swaggerFormats() 'model_type' => 'getModelType' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -208,25 +253,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['model_type_id'] === null) { - $invalid_properties[] = "'model_type_id' can't be null"; + $invalidProperties[] = "'model_type_id' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['tags'] === null) { + $invalidProperties[] = "'tags' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -240,12 +288,16 @@ public function valid() if ($this->container['name'] === null) { return false; } + if ($this->container['tags'] === null) { + return false; + } return true; } /** * Gets id + * * @return int */ public function getId() @@ -255,7 +307,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -267,6 +321,7 @@ public function setId($id) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -276,7 +331,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -288,6 +345,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -297,7 +355,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -309,6 +369,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -318,7 +379,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -330,6 +393,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -339,7 +403,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -351,6 +417,7 @@ public function setExternalStationId($_external_station_id) /** * Gets model_type_id + * * @return int */ public function getModelTypeId() @@ -360,7 +427,9 @@ public function getModelTypeId() /** * Sets model_type_id - * @param int $model_type_id + * + * @param int $model_type_id model_type_id + * * @return $this */ public function setModelTypeId($model_type_id) @@ -372,6 +441,7 @@ public function setModelTypeId($model_type_id) /** * Gets recommended + * * @return bool */ public function getRecommended() @@ -381,7 +451,9 @@ public function getRecommended() /** * Sets recommended - * @param bool $recommended + * + * @param bool $recommended recommended + * * @return $this */ public function setRecommended($recommended) @@ -393,6 +465,7 @@ public function setRecommended($recommended) /** * Gets field_values + * * @return object */ public function getFieldValues() @@ -402,7 +475,9 @@ public function getFieldValues() /** * Sets field_values - * @param object $field_values + * + * @param object $field_values field_values + * * @return $this */ public function setFieldValues($field_values) @@ -414,6 +489,7 @@ public function setFieldValues($field_values) /** * Gets name + * * @return string */ public function getName() @@ -423,7 +499,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -435,6 +513,7 @@ public function setName($name) /** * Gets description + * * @return string */ public function getDescription() @@ -444,7 +523,9 @@ public function getDescription() /** * Sets description - * @param string $description + * + * @param string $description description + * * @return $this */ public function setDescription($description) @@ -456,6 +537,7 @@ public function setDescription($description) /** * Gets tags + * * @return \RadioManager\Model\StoryRelationsTags */ public function getTags() @@ -465,7 +547,9 @@ public function getTags() /** * Sets tags - * @param \RadioManager\Model\StoryRelationsTags $tags + * + * @param \RadioManager\Model\StoryRelationsTags $tags tags + * * @return $this */ public function setTags($tags) @@ -477,6 +561,7 @@ public function setTags($tags) /** * Gets items + * * @return \RadioManager\Model\StoryRelationsItems */ public function getItems() @@ -486,7 +571,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\StoryRelationsItems $items + * + * @param \RadioManager\Model\StoryRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -498,6 +585,7 @@ public function setItems($items) /** * Gets model_type + * * @return \RadioManager\Model\BroadcastRelationsModelType */ public function getModelType() @@ -507,7 +595,9 @@ public function getModelType() /** * Sets model_type - * @param \RadioManager\Model\BroadcastRelationsModelType $model_type + * + * @param \RadioManager\Model\BroadcastRelationsModelType $model_type model_type + * * @return $this */ public function setModelType($model_type) @@ -518,7 +608,9 @@ public function setModelType($model_type) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -528,7 +620,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -538,8 +632,10 @@ 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 */ public function offsetSet($offset, $value) @@ -553,7 +649,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -563,15 +661,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/StoryResults.php b/lib/Model/StoryResults.php index 1ab0130..157de37 100644 --- a/lib/Model/StoryResults.php +++ b/lib/Model/StoryResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * StoryResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class StoryResults implements ArrayAccess +class StoryResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'StoryResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class StoryResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class StoryResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\StoryResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\StoryResult[] $results + * + * @param \RadioManager\Model\StoryResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Success.php b/lib/Model/Success.php index 5628208..eacd23a 100644 --- a/lib/Model/Success.php +++ b/lib/Model/Success.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Success Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Success implements ArrayAccess +class Success implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Success'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class Success implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'success' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'success' => 'success' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'success' => 'setSuccess' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'success' => 'getSuccess' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,22 +181,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['success'] === null) { - $invalid_properties[] = "'success' can't be null"; + $invalidProperties[] = "'success' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets success + * * @return string */ public function getSuccess() @@ -177,7 +223,9 @@ public function getSuccess() /** * Sets success + * * @param string $success Describes whatever has succeeded + * * @return $this */ public function setSuccess($success) @@ -188,7 +236,9 @@ public function setSuccess($success) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -198,7 +248,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -208,8 +260,10 @@ 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 */ public function offsetSet($offset, $value) @@ -223,7 +277,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -233,15 +289,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/Tag.php b/lib/Model/Tag.php index f2b9616..b1536a4 100644 --- a/lib/Model/Tag.php +++ b/lib/Model/Tag.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * Tag Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Tag implements ArrayAccess +class Tag implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Tag'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class Tag implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'name' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'name' => 'name' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'name' => 'setName' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'name' => 'getName' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,22 +181,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets name + * * @return string */ public function getName() @@ -177,7 +223,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -188,7 +236,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -198,7 +248,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -208,8 +260,10 @@ 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 */ public function offsetSet($offset, $value) @@ -223,7 +277,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -233,15 +289,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagDataInput.php b/lib/Model/TagDataInput.php index 10b5f03..36b9777 100644 --- a/lib/Model/TagDataInput.php +++ b/lib/Model/TagDataInput.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagDataInput Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagDataInput implements ArrayAccess +class TagDataInput implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagDataInput'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class TagDataInput implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'name' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'name' => 'name' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'name' => 'setName' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'name' => 'getName' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,22 +181,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets name + * * @return string */ public function getName() @@ -177,7 +223,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -188,7 +236,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -198,7 +248,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -208,8 +260,10 @@ 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 */ public function offsetSet($offset, $value) @@ -223,7 +277,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -233,15 +289,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagOutputOnly.php b/lib/Model/TagOutputOnly.php index 1a36dd5..1f005b0 100644 --- a/lib/Model/TagOutputOnly.php +++ b/lib/Model/TagOutputOnly.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagOutputOnly Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagOutputOnly implements ArrayAccess +class TagOutputOnly implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagOutputOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -63,6 +66,7 @@ class TagOutputOnly implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -73,18 +77,30 @@ class TagOutputOnly implements ArrayAccess '_external_station_id' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,9 +111,9 @@ public static function swaggerFormats() '_external_station_id' => '_external_station_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -108,9 +124,9 @@ public static function swaggerFormats() '_external_station_id' => 'setExternalStationId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -121,34 +137,63 @@ public static function swaggerFormats() '_external_station_id' => 'getExternalStationId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -160,22 +205,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -192,6 +237,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -201,7 +247,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -213,6 +261,7 @@ public function setId($id) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -222,7 +271,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -234,6 +285,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -243,7 +295,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -255,6 +309,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -264,7 +319,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -276,6 +333,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -285,7 +343,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -296,7 +356,9 @@ public function setExternalStationId($_external_station_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -306,7 +368,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -316,8 +380,10 @@ 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 */ public function offsetSet($offset, $value) @@ -331,7 +397,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -341,15 +409,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagRelations.php b/lib/Model/TagRelations.php index e9d49d8..932aa85 100644 --- a/lib/Model/TagRelations.php +++ b/lib/Model/TagRelations.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagRelations Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagRelations implements ArrayAccess +class TagRelations implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagRelations'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class TagRelations implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class TagRelations implements ArrayAccess 'items' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'items' => 'items' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'items' => 'setItems' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'items' => 'getItems' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets broadcasts + * * @return \RadioManager\Model\TagRelationsBroadcasts */ public function getBroadcasts() @@ -189,7 +235,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\TagRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\TagRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -201,6 +249,7 @@ public function setBroadcasts($broadcasts) /** * Gets programs + * * @return \RadioManager\Model\TagRelationsPrograms */ public function getPrograms() @@ -210,7 +259,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\TagRelationsPrograms $programs + * + * @param \RadioManager\Model\TagRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -222,6 +273,7 @@ public function setPrograms($programs) /** * Gets contacts + * * @return \RadioManager\Model\TagRelationsContacts */ public function getContacts() @@ -231,7 +283,9 @@ public function getContacts() /** * Sets contacts - * @param \RadioManager\Model\TagRelationsContacts $contacts + * + * @param \RadioManager\Model\TagRelationsContacts $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -243,6 +297,7 @@ public function setContacts($contacts) /** * Gets items + * * @return \RadioManager\Model\TagRelationsItems */ public function getItems() @@ -252,7 +307,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\TagRelationsItems $items + * + * @param \RadioManager\Model\TagRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -263,7 +320,9 @@ public function setItems($items) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagRelationsBroadcasts.php b/lib/Model/TagRelationsBroadcasts.php index c922a54..f47a5bc 100644 --- a/lib/Model/TagRelationsBroadcasts.php +++ b/lib/Model/TagRelationsBroadcasts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagRelationsBroadcasts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagRelationsBroadcasts implements ArrayAccess +class TagRelationsBroadcasts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagRelations_broadcasts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class TagRelationsBroadcasts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class TagRelationsBroadcasts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\TagRelationsBroadcastsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\TagRelationsBroadcastsParams $params + * + * @param \RadioManager\Model\TagRelationsBroadcastsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagRelationsBroadcastsParams.php b/lib/Model/TagRelationsBroadcastsParams.php index 7e8b49b..b227189 100644 --- a/lib/Model/TagRelationsBroadcastsParams.php +++ b/lib/Model/TagRelationsBroadcastsParams.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagRelationsBroadcastsParams Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagRelationsBroadcastsParams implements ArrayAccess +class TagRelationsBroadcastsParams implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagRelations_broadcasts_params'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class TagRelationsBroadcastsParams implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'tag_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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'tag_id' => 'tag_id' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'tag_id' => 'setTagId' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'tag_id' => 'getTagId' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets tag_id + * * @return int */ public function getTagId() @@ -171,7 +217,9 @@ public function getTagId() /** * Sets tag_id - * @param int $tag_id + * + * @param int $tag_id tag_id + * * @return $this */ public function setTagId($tag_id) @@ -182,7 +230,9 @@ public function setTagId($tag_id) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagRelationsContacts.php b/lib/Model/TagRelationsContacts.php index 706a187..15eda22 100644 --- a/lib/Model/TagRelationsContacts.php +++ b/lib/Model/TagRelationsContacts.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagRelationsContacts Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagRelationsContacts implements ArrayAccess +class TagRelationsContacts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagRelations_contacts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class TagRelationsContacts implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class TagRelationsContacts implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\TagRelationsBroadcastsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\TagRelationsBroadcastsParams $params + * + * @param \RadioManager\Model\TagRelationsBroadcastsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagRelationsItems.php b/lib/Model/TagRelationsItems.php index da67823..75c59ab 100644 --- a/lib/Model/TagRelationsItems.php +++ b/lib/Model/TagRelationsItems.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagRelationsItems Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagRelationsItems implements ArrayAccess +class TagRelationsItems implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagRelations_items'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class TagRelationsItems implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class TagRelationsItems implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\TagRelationsBroadcastsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\TagRelationsBroadcastsParams $params + * + * @param \RadioManager\Model\TagRelationsBroadcastsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagRelationsPrograms.php b/lib/Model/TagRelationsPrograms.php index c7b92ce..8311635 100644 --- a/lib/Model/TagRelationsPrograms.php +++ b/lib/Model/TagRelationsPrograms.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagRelationsPrograms Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagRelationsPrograms implements ArrayAccess +class TagRelationsPrograms implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagRelations_programs'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class TagRelationsPrograms implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class TagRelationsPrograms implements ArrayAccess 'params' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return \RadioManager\Model\TagRelationsBroadcastsParams */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param \RadioManager\Model\TagRelationsBroadcastsParams $params + * + * @param \RadioManager\Model\TagRelationsBroadcastsParams $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagResult.php b/lib/Model/TagResult.php index ed13b21..cff4fd7 100644 --- a/lib/Model/TagResult.php +++ b/lib/Model/TagResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagResult implements ArrayAccess +class TagResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class TagResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class TagResult implements ArrayAccess 'items' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'items' => 'items' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'items' => 'setItems' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'items' => 'getItems' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,25 +235,25 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -228,6 +273,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -237,7 +283,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -249,6 +297,7 @@ public function setId($id) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -258,7 +307,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -270,6 +321,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -279,7 +331,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -291,6 +345,7 @@ public function setUpdatedAt($updated_at) /** * Gets deleted_at + * * @return \DateTime */ public function getDeletedAt() @@ -300,7 +355,9 @@ public function getDeletedAt() /** * Sets deleted_at - * @param \DateTime $deleted_at + * + * @param \DateTime $deleted_at deleted_at + * * @return $this */ public function setDeletedAt($deleted_at) @@ -312,6 +369,7 @@ public function setDeletedAt($deleted_at) /** * Gets _external_station_id + * * @return int */ public function getExternalStationId() @@ -321,7 +379,9 @@ public function getExternalStationId() /** * Sets _external_station_id - * @param int $_external_station_id + * + * @param int $_external_station_id _external_station_id + * * @return $this */ public function setExternalStationId($_external_station_id) @@ -333,6 +393,7 @@ public function setExternalStationId($_external_station_id) /** * Gets name + * * @return string */ public function getName() @@ -342,7 +403,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -354,6 +417,7 @@ public function setName($name) /** * Gets broadcasts + * * @return \RadioManager\Model\TagRelationsBroadcasts */ public function getBroadcasts() @@ -363,7 +427,9 @@ public function getBroadcasts() /** * Sets broadcasts - * @param \RadioManager\Model\TagRelationsBroadcasts $broadcasts + * + * @param \RadioManager\Model\TagRelationsBroadcasts $broadcasts broadcasts + * * @return $this */ public function setBroadcasts($broadcasts) @@ -375,6 +441,7 @@ public function setBroadcasts($broadcasts) /** * Gets programs + * * @return \RadioManager\Model\TagRelationsPrograms */ public function getPrograms() @@ -384,7 +451,9 @@ public function getPrograms() /** * Sets programs - * @param \RadioManager\Model\TagRelationsPrograms $programs + * + * @param \RadioManager\Model\TagRelationsPrograms $programs programs + * * @return $this */ public function setPrograms($programs) @@ -396,6 +465,7 @@ public function setPrograms($programs) /** * Gets contacts + * * @return \RadioManager\Model\TagRelationsContacts */ public function getContacts() @@ -405,7 +475,9 @@ public function getContacts() /** * Sets contacts - * @param \RadioManager\Model\TagRelationsContacts $contacts + * + * @param \RadioManager\Model\TagRelationsContacts $contacts contacts + * * @return $this */ public function setContacts($contacts) @@ -417,6 +489,7 @@ public function setContacts($contacts) /** * Gets items + * * @return \RadioManager\Model\TagRelationsItems */ public function getItems() @@ -426,7 +499,9 @@ public function getItems() /** * Sets items - * @param \RadioManager\Model\TagRelationsItems $items + * + * @param \RadioManager\Model\TagRelationsItems $items items + * * @return $this */ public function setItems($items) @@ -437,7 +512,9 @@ public function setItems($items) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -447,7 +524,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -457,8 +536,10 @@ 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 */ public function offsetSet($offset, $value) @@ -472,7 +553,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -482,15 +565,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TagResults.php b/lib/Model/TagResults.php index a858156..ed020df 100644 --- a/lib/Model/TagResults.php +++ b/lib/Model/TagResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TagResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TagResults implements ArrayAccess +class TagResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TagResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -67,6 +70,7 @@ class TagResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -81,18 +85,30 @@ class TagResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -107,9 +123,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -124,9 +140,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -141,34 +157,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -184,19 +229,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -210,6 +255,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -219,7 +265,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -231,6 +279,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -240,7 +289,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -252,6 +303,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -261,7 +313,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -273,6 +327,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -282,7 +337,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -294,6 +351,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -303,7 +361,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -315,6 +375,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -324,7 +385,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -336,6 +399,7 @@ public function setPerPage($per_page) /** * Gets to + * * @return int */ public function getTo() @@ -345,7 +409,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -357,6 +423,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -366,7 +433,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -378,6 +447,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\TagResult[] */ public function getResults() @@ -387,7 +457,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\TagResult[] $results + * + * @param \RadioManager\Model\TagResult[] $results results + * * @return $this */ public function setResults($results) @@ -398,7 +470,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -408,7 +482,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -418,8 +494,10 @@ 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 */ public function offsetSet($offset, $value) @@ -433,7 +511,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -443,15 +523,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TextString.php b/lib/Model/TextString.php index f547a0b..698daa2 100644 --- a/lib/Model/TextString.php +++ b/lib/Model/TextString.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TextString Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TextString implements ArrayAccess +class TextString implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TextString'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -63,6 +66,7 @@ class TextString implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -73,18 +77,30 @@ class TextString implements ArrayAccess 'updated_at' => '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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,9 +111,9 @@ public static function swaggerFormats() 'updated_at' => 'updated_at' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -108,9 +124,9 @@ public static function swaggerFormats() 'updated_at' => 'setUpdatedAt' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -121,34 +137,63 @@ public static function swaggerFormats() 'updated_at' => 'getUpdatedAt' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -160,28 +205,28 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['content'] === null) { - $invalid_properties[] = "'content' can't be null"; + $invalidProperties[] = "'content' can't be null"; } if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -204,6 +249,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -213,7 +259,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -225,6 +273,7 @@ public function setId($id) /** * Gets content + * * @return string */ public function getContent() @@ -234,7 +283,9 @@ public function getContent() /** * Sets content - * @param string $content + * + * @param string $content content + * * @return $this */ public function setContent($content) @@ -246,6 +297,7 @@ public function setContent($content) /** * Gets name + * * @return string */ public function getName() @@ -255,7 +307,9 @@ public function getName() /** * Sets name - * @param string $name + * + * @param string $name name + * * @return $this */ public function setName($name) @@ -267,6 +321,7 @@ public function setName($name) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -276,7 +331,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -288,6 +345,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -297,7 +355,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -308,7 +368,9 @@ public function setUpdatedAt($updated_at) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -318,7 +380,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -328,8 +392,10 @@ 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 */ public function offsetSet($offset, $value) @@ -343,7 +409,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -353,15 +421,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/TooManyRequests.php b/lib/Model/TooManyRequests.php index 06d24f0..2b92c21 100644 --- a/lib/Model/TooManyRequests.php +++ b/lib/Model/TooManyRequests.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * TooManyRequests Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class TooManyRequests implements ArrayAccess +class TooManyRequests implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'TooManyRequests'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class TooManyRequests implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ '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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'message' => 'message' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'message' => 'setMessage' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ '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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,22 +181,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['message'] === null) { - $invalid_properties[] = "'message' can't be null"; + $invalidProperties[] = "'message' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets message + * * @return string */ public function getMessage() @@ -177,7 +223,9 @@ public function getMessage() /** * Sets message - * @param string $message + * + * @param string $message message + * * @return $this */ public function setMessage($message) @@ -188,7 +236,9 @@ public function setMessage($message) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -198,7 +248,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -208,8 +260,10 @@ 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 */ public function offsetSet($offset, $value) @@ -223,7 +277,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -233,15 +289,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/UnprocessableEntity.php b/lib/Model/UnprocessableEntity.php index 1f67dda..8677df6 100644 --- a/lib/Model/UnprocessableEntity.php +++ b/lib/Model/UnprocessableEntity.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * UnprocessableEntity Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class UnprocessableEntity implements ArrayAccess +class UnprocessableEntity implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'UnprocessableEntity'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class UnprocessableEntity implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'errors' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'errors' => 'errors' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'errors' => 'setErrors' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'errors' => 'getErrors' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,22 +181,22 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['errors'] === null) { - $invalid_properties[] = "'errors' can't be null"; + $invalidProperties[] = "'errors' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -168,6 +213,7 @@ public function valid() /** * Gets errors + * * @return string[] */ public function getErrors() @@ -177,7 +223,9 @@ public function getErrors() /** * Sets errors + * * @param string[] $errors A list that displays all the missing properties. + * * @return $this */ public function setErrors($errors) @@ -188,7 +236,9 @@ public function setErrors($errors) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -198,7 +248,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -208,8 +260,10 @@ 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 */ public function offsetSet($offset, $value) @@ -223,7 +277,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -233,15 +289,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/UserResult.php b/lib/Model/UserResult.php index 5946f96..7a0b093 100644 --- a/lib/Model/UserResult.php +++ b/lib/Model/UserResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * UserResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class UserResult implements ArrayAccess +class UserResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'UserResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -70,6 +73,7 @@ class UserResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -87,18 +91,30 @@ class UserResult implements ArrayAccess 'roles' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -116,9 +132,9 @@ public static function swaggerFormats() 'roles' => 'roles' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -136,9 +152,9 @@ public static function swaggerFormats() 'roles' => 'setRoles' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -156,34 +172,63 @@ public static function swaggerFormats() 'roles' => 'getRoles' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -202,31 +247,31 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['id'] === null) { - $invalid_properties[] = "'id' can't be null"; + $invalidProperties[] = "'id' can't be null"; } if ($this->container['email'] === null) { - $invalid_properties[] = "'email' can't be null"; + $invalidProperties[] = "'email' can't be null"; } if ($this->container['firstname'] === null) { - $invalid_properties[] = "'firstname' can't be null"; + $invalidProperties[] = "'firstname' can't be null"; } if ($this->container['lastname'] === null) { - $invalid_properties[] = "'lastname' can't be null"; + $invalidProperties[] = "'lastname' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -252,6 +297,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -261,7 +307,9 @@ public function getId() /** * Sets id - * @param int $id + * + * @param int $id id + * * @return $this */ public function setId($id) @@ -273,6 +321,7 @@ public function setId($id) /** * Gets email + * * @return string */ public function getEmail() @@ -282,7 +331,9 @@ public function getEmail() /** * Sets email - * @param string $email + * + * @param string $email email + * * @return $this */ public function setEmail($email) @@ -294,6 +345,7 @@ public function setEmail($email) /** * Gets firstname + * * @return string */ public function getFirstname() @@ -303,7 +355,9 @@ public function getFirstname() /** * Sets firstname - * @param string $firstname + * + * @param string $firstname firstname + * * @return $this */ public function setFirstname($firstname) @@ -315,6 +369,7 @@ public function setFirstname($firstname) /** * Gets lastname + * * @return string */ public function getLastname() @@ -324,7 +379,9 @@ public function getLastname() /** * Sets lastname - * @param string $lastname + * + * @param string $lastname lastname + * * @return $this */ public function setLastname($lastname) @@ -336,6 +393,7 @@ public function setLastname($lastname) /** * Gets phone + * * @return string */ public function getPhone() @@ -345,7 +403,9 @@ public function getPhone() /** * Sets phone - * @param string $phone + * + * @param string $phone phone + * * @return $this */ public function setPhone($phone) @@ -357,6 +417,7 @@ public function setPhone($phone) /** * Gets created_at + * * @return \DateTime */ public function getCreatedAt() @@ -366,7 +427,9 @@ public function getCreatedAt() /** * Sets created_at - * @param \DateTime $created_at + * + * @param \DateTime $created_at created_at + * * @return $this */ public function setCreatedAt($created_at) @@ -378,6 +441,7 @@ public function setCreatedAt($created_at) /** * Gets updated_at + * * @return \DateTime */ public function getUpdatedAt() @@ -387,7 +451,9 @@ public function getUpdatedAt() /** * Sets updated_at - * @param \DateTime $updated_at + * + * @param \DateTime $updated_at updated_at + * * @return $this */ public function setUpdatedAt($updated_at) @@ -399,6 +465,7 @@ public function setUpdatedAt($updated_at) /** * Gets active + * * @return bool */ public function getActive() @@ -408,7 +475,9 @@ public function getActive() /** * Sets active - * @param bool $active + * + * @param bool $active active + * * @return $this */ public function setActive($active) @@ -420,6 +489,7 @@ public function setActive($active) /** * Gets settings + * * @return \RadioManager\Model\UserResultSettings */ public function getSettings() @@ -429,7 +499,9 @@ public function getSettings() /** * Sets settings - * @param \RadioManager\Model\UserResultSettings $settings + * + * @param \RadioManager\Model\UserResultSettings $settings settings + * * @return $this */ public function setSettings($settings) @@ -441,6 +513,7 @@ public function setSettings($settings) /** * Gets language + * * @return bool */ public function getLanguage() @@ -450,7 +523,9 @@ public function getLanguage() /** * Sets language - * @param bool $language + * + * @param bool $language language + * * @return $this */ public function setLanguage($language) @@ -462,6 +537,7 @@ public function setLanguage($language) /** * Gets active_external_station_id + * * @return int */ public function getActiveExternalStationId() @@ -471,7 +547,9 @@ public function getActiveExternalStationId() /** * Sets active_external_station_id - * @param int $active_external_station_id + * + * @param int $active_external_station_id active_external_station_id + * * @return $this */ public function setActiveExternalStationId($active_external_station_id) @@ -483,6 +561,7 @@ public function setActiveExternalStationId($active_external_station_id) /** * Gets roles + * * @return \RadioManager\Model\UserResultRoles[] */ public function getRoles() @@ -492,7 +571,9 @@ public function getRoles() /** * Sets roles - * @param \RadioManager\Model\UserResultRoles[] $roles + * + * @param \RadioManager\Model\UserResultRoles[] $roles roles + * * @return $this */ public function setRoles($roles) @@ -503,7 +584,9 @@ public function setRoles($roles) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -513,7 +596,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -523,8 +608,10 @@ 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 */ public function offsetSet($offset, $value) @@ -538,7 +625,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -548,15 +637,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/UserResultRoles.php b/lib/Model/UserResultRoles.php index bc44288..e22cce3 100644 --- a/lib/Model/UserResultRoles.php +++ b/lib/Model/UserResultRoles.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * UserResultRoles Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class UserResultRoles implements ArrayAccess +class UserResultRoles implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'UserResult_roles'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +65,7 @@ class UserResultRoles implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -71,18 +75,30 @@ class UserResultRoles implements ArrayAccess 'params' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -92,9 +108,9 @@ public static function swaggerFormats() 'params' => 'params' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,9 +120,9 @@ public static function swaggerFormats() 'params' => 'setParams' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,34 +132,63 @@ public static function swaggerFormats() 'params' => 'getParams' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -154,19 +199,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -180,6 +225,7 @@ public function valid() /** * Gets href + * * @return string */ public function getHref() @@ -189,7 +235,9 @@ public function getHref() /** * Sets href - * @param string $href + * + * @param string $href href + * * @return $this */ public function setHref($href) @@ -201,6 +249,7 @@ public function setHref($href) /** * Gets model + * * @return string */ public function getModel() @@ -210,7 +259,9 @@ public function getModel() /** * Sets model - * @param string $model + * + * @param string $model model + * * @return $this */ public function setModel($model) @@ -222,6 +273,7 @@ public function setModel($model) /** * Gets operation + * * @return string */ public function getOperation() @@ -231,7 +283,9 @@ public function getOperation() /** * Sets operation - * @param string $operation + * + * @param string $operation operation + * * @return $this */ public function setOperation($operation) @@ -243,6 +297,7 @@ public function setOperation($operation) /** * Gets params + * * @return int */ public function getParams() @@ -252,7 +307,9 @@ public function getParams() /** * Sets params - * @param int $params + * + * @param int $params params + * * @return $this */ public function setParams($params) @@ -263,7 +320,9 @@ public function setParams($params) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -273,7 +332,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -283,8 +344,10 @@ 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 */ public function offsetSet($offset, $value) @@ -298,7 +361,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -308,15 +373,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/UserResultSettings.php b/lib/Model/UserResultSettings.php index fe9d8a7..155e997 100644 --- a/lib/Model/UserResultSettings.php +++ b/lib/Model/UserResultSettings.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * UserResultSettings Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class UserResultSettings implements ArrayAccess +class UserResultSettings implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'UserResult_settings'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +67,7 @@ class UserResultSettings implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -75,18 +79,30 @@ class UserResultSettings implements ArrayAccess 'zoom_factor' => 'int64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,9 +114,9 @@ public static function swaggerFormats() 'zoom_factor' => 'zoomFactor' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -112,9 +128,9 @@ public static function swaggerFormats() 'zoom_factor' => 'setZoomFactor' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,34 +142,63 @@ public static function swaggerFormats() 'zoom_factor' => 'getZoomFactor' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -166,19 +211,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -192,6 +237,7 @@ public function valid() /** * Gets show_side_bar + * * @return bool */ public function getShowSideBar() @@ -201,7 +247,9 @@ public function getShowSideBar() /** * Sets show_side_bar - * @param bool $show_side_bar + * + * @param bool $show_side_bar show_side_bar + * * @return $this */ public function setShowSideBar($show_side_bar) @@ -213,6 +261,7 @@ public function setShowSideBar($show_side_bar) /** * Gets show_social_bar + * * @return bool */ public function getShowSocialBar() @@ -222,7 +271,9 @@ public function getShowSocialBar() /** * Sets show_social_bar - * @param bool $show_social_bar + * + * @param bool $show_social_bar show_social_bar + * * @return $this */ public function setShowSocialBar($show_social_bar) @@ -234,6 +285,7 @@ public function setShowSocialBar($show_social_bar) /** * Gets show_checkbox_column + * * @return bool */ public function getShowCheckboxColumn() @@ -243,7 +295,9 @@ public function getShowCheckboxColumn() /** * Sets show_checkbox_column - * @param bool $show_checkbox_column + * + * @param bool $show_checkbox_column show_checkbox_column + * * @return $this */ public function setShowCheckboxColumn($show_checkbox_column) @@ -255,6 +309,7 @@ public function setShowCheckboxColumn($show_checkbox_column) /** * Gets show_time_column + * * @return bool */ public function getShowTimeColumn() @@ -264,7 +319,9 @@ public function getShowTimeColumn() /** * Sets show_time_column - * @param bool $show_time_column + * + * @param bool $show_time_column show_time_column + * * @return $this */ public function setShowTimeColumn($show_time_column) @@ -276,6 +333,7 @@ public function setShowTimeColumn($show_time_column) /** * Gets show_speech_time + * * @return bool */ public function getShowSpeechTime() @@ -285,7 +343,9 @@ public function getShowSpeechTime() /** * Sets show_speech_time - * @param bool $show_speech_time + * + * @param bool $show_speech_time show_speech_time + * * @return $this */ public function setShowSpeechTime($show_speech_time) @@ -297,6 +357,7 @@ public function setShowSpeechTime($show_speech_time) /** * Gets zoom_factor + * * @return int */ public function getZoomFactor() @@ -306,7 +367,9 @@ public function getZoomFactor() /** * Sets zoom_factor - * @param int $zoom_factor + * + * @param int $zoom_factor zoom_factor + * * @return $this */ public function setZoomFactor($zoom_factor) @@ -317,7 +380,9 @@ public function setZoomFactor($zoom_factor) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -327,7 +392,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -337,8 +404,10 @@ 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 */ public function offsetSet($offset, $value) @@ -352,7 +421,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -362,15 +433,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/UserResults.php b/lib/Model/UserResults.php index 6e03a72..dfc0b25 100644 --- a/lib/Model/UserResults.php +++ b/lib/Model/UserResults.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * UserResults Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class UserResults implements ArrayAccess +class UserResults implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'UserResults'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -68,6 +71,7 @@ class UserResults implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -83,18 +87,30 @@ class UserResults implements ArrayAccess 'results' => 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,9 +126,9 @@ public static function swaggerFormats() 'results' => 'results' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -128,9 +144,9 @@ public static function swaggerFormats() 'results' => 'setResults' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -146,34 +162,63 @@ public static function swaggerFormats() 'results' => 'getResults' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -190,19 +235,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -216,6 +261,7 @@ public function valid() /** * Gets current_page + * * @return int */ public function getCurrentPage() @@ -225,7 +271,9 @@ public function getCurrentPage() /** * Sets current_page - * @param int $current_page + * + * @param int $current_page current_page + * * @return $this */ public function setCurrentPage($current_page) @@ -237,6 +285,7 @@ public function setCurrentPage($current_page) /** * Gets from + * * @return int */ public function getFrom() @@ -246,7 +295,9 @@ public function getFrom() /** * Sets from - * @param int $from + * + * @param int $from from + * * @return $this */ public function setFrom($from) @@ -258,6 +309,7 @@ public function setFrom($from) /** * Gets last_page + * * @return int */ public function getLastPage() @@ -267,7 +319,9 @@ public function getLastPage() /** * Sets last_page - * @param int $last_page + * + * @param int $last_page last_page + * * @return $this */ public function setLastPage($last_page) @@ -279,6 +333,7 @@ public function setLastPage($last_page) /** * Gets next_page_url + * * @return string */ public function getNextPageUrl() @@ -288,7 +343,9 @@ public function getNextPageUrl() /** * Sets next_page_url - * @param string $next_page_url + * + * @param string $next_page_url next_page_url + * * @return $this */ public function setNextPageUrl($next_page_url) @@ -300,6 +357,7 @@ public function setNextPageUrl($next_page_url) /** * Gets path + * * @return string */ public function getPath() @@ -309,7 +367,9 @@ public function getPath() /** * Sets path - * @param string $path + * + * @param string $path path + * * @return $this */ public function setPath($path) @@ -321,6 +381,7 @@ public function setPath($path) /** * Gets per_page + * * @return int */ public function getPerPage() @@ -330,7 +391,9 @@ public function getPerPage() /** * Sets per_page - * @param int $per_page + * + * @param int $per_page per_page + * * @return $this */ public function setPerPage($per_page) @@ -342,6 +405,7 @@ public function setPerPage($per_page) /** * Gets prev_page_url + * * @return string */ public function getPrevPageUrl() @@ -351,7 +415,9 @@ public function getPrevPageUrl() /** * Sets prev_page_url - * @param string $prev_page_url + * + * @param string $prev_page_url prev_page_url + * * @return $this */ public function setPrevPageUrl($prev_page_url) @@ -363,6 +429,7 @@ public function setPrevPageUrl($prev_page_url) /** * Gets to + * * @return int */ public function getTo() @@ -372,7 +439,9 @@ public function getTo() /** * Sets to - * @param int $to + * + * @param int $to to + * * @return $this */ public function setTo($to) @@ -384,6 +453,7 @@ public function setTo($to) /** * Gets total + * * @return int */ public function getTotal() @@ -393,7 +463,9 @@ public function getTotal() /** * Sets total - * @param int $total + * + * @param int $total total + * * @return $this */ public function setTotal($total) @@ -405,6 +477,7 @@ public function setTotal($total) /** * Gets results + * * @return \RadioManager\Model\UserResult[] */ public function getResults() @@ -414,7 +487,9 @@ public function getResults() /** * Sets results - * @param \RadioManager\Model\UserResult[] $results + * + * @param \RadioManager\Model\UserResult[] $results results + * * @return $this */ public function setResults($results) @@ -425,7 +500,9 @@ public function setResults($results) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -435,7 +512,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -445,8 +524,10 @@ 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 */ public function offsetSet($offset, $value) @@ -460,7 +541,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -470,15 +553,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/Model/VisualResult.php b/lib/Model/VisualResult.php index e61d2e4..2c0dd87 100644 --- a/lib/Model/VisualResult.php +++ b/lib/Model/VisualResult.php @@ -6,7 +6,7 @@ * * @category Class * @package RadioManager - * @author Swaagger Codegen team + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -30,27 +30,30 @@ namespace RadioManager\Model; use \ArrayAccess; +use \RadioManager\ObjectSerializer; /** * VisualResult Class Doc Comment * - * @category Class - * @package RadioManager - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package RadioManager + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class VisualResult implements ArrayAccess +class VisualResult implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'VisualResult'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,76 +62,118 @@ class VisualResult implements ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ 'value' => 'base64' ]; + /** + * 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 + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'value' => 'value' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'value' => 'setValue' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'value' => 'getValue' ]; + /** + * 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 + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -136,19 +181,19 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -162,6 +207,7 @@ public function valid() /** * Gets value + * * @return string */ public function getValue() @@ -171,7 +217,9 @@ public function getValue() /** * Sets value - * @param string $value + * + * @param string $value value + * * @return $this */ public function setValue($value) @@ -182,7 +230,9 @@ public function setValue($value) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -192,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -202,8 +254,10 @@ 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 */ public function offsetSet($offset, $value) @@ -217,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -227,15 +283,19 @@ public function offsetUnset($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(\RadioManager\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\RadioManager\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index da4876e..ec59e26 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -65,7 +65,9 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && method_exists($swaggerType, 'getAllowableEnumValues') + 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'"); @@ -105,9 +107,9 @@ public static function sanitizeFilename($filename) * * @return string the serialized object */ - public function toPathValue($value) + public static function toPathValue($value) { - return rawurlencode($this->toString($value)); + return rawurlencode(self::toString($value)); } /** @@ -120,12 +122,12 @@ public function toPathValue($value) * * @return string the serialized object */ - public function toQueryValue($object) + public static function toQueryValue($object) { if (is_array($object)) { return implode(',', $object); } else { - return $this->toString($object); + return self::toString($object); } } @@ -138,9 +140,9 @@ public function toQueryValue($object) * * @return string the header string */ - public function toHeaderValue($value) + public static function toHeaderValue($value) { - return $this->toString($value); + return self::toString($value); } /** @@ -152,12 +154,12 @@ public function toHeaderValue($value) * * @return string the form string */ - public function toFormValue($value) + public static function toFormValue($value) { if ($value instanceof \SplFileObject) { return $value->getRealPath(); } else { - return $this->toString($value); + return self::toString($value); } } @@ -170,7 +172,7 @@ public function toFormValue($value) * * @return string the header string */ - public function toString($value) + public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format return $value->format(\DateTime::ATOM); @@ -189,7 +191,7 @@ public function toString($value) * * @return string */ - public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) { if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { // http_build_query() almost does the job for us. We just @@ -264,6 +266,8 @@ public static function deserialize($data, $class, $httpHeaders = null) 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)) { @@ -271,13 +275,14 @@ public static function deserialize($data, $class, $httpHeaders = null) } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } - $deserialized = new \SplFileObject($filename, "w"); - $byte_written = $deserialized->fwrite($data); - if (Configuration::getDefaultConfiguration()->getDebug()) { - error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); } + fclose($file); - return $deserialized; + return new \SplFileObject($filename, 'r'); } elseif (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues())) { $imploded = implode("', '", $class::getAllowableEnumValues()); diff --git a/test/Api/BlockApiTest.php b/test/Api/BlockApiTest.php index b47d0c9..4c7a7cf 100644 --- a/test/Api/BlockApiTest.php +++ b/test/Api/BlockApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/BroadcastApiTest.php b/test/Api/BroadcastApiTest.php index cef1896..3cc0eb5 100644 --- a/test/Api/BroadcastApiTest.php +++ b/test/Api/BroadcastApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; @@ -165,7 +164,7 @@ public function testListBroadcasts() /** * Test case for printBroadcastById * - * Print Broadcast by id. + * Print broadcast by id with template. * */ public function testPrintBroadcastById() diff --git a/test/Api/CampaignApiTest.php b/test/Api/CampaignApiTest.php index 2a7a595..9901901 100644 --- a/test/Api/CampaignApiTest.php +++ b/test/Api/CampaignApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/ContactApiTest.php b/test/Api/ContactApiTest.php index 2bcf265..7182b69 100644 --- a/test/Api/ContactApiTest.php +++ b/test/Api/ContactApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/GenreApiTest.php b/test/Api/GenreApiTest.php index 3fff553..371ac67 100644 --- a/test/Api/GenreApiTest.php +++ b/test/Api/GenreApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/ItemApiTest.php b/test/Api/ItemApiTest.php index d31f83c..9c06cd0 100644 --- a/test/Api/ItemApiTest.php +++ b/test/Api/ItemApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; @@ -112,6 +111,16 @@ public function testDeleteItemById() { } + /** + * Test case for getCurrentItem + * + * Get current Item. + * + */ + public function testGetCurrentItem() + { + } + /** * Test case for getItemById * @@ -132,6 +141,16 @@ public function testListItems() { } + /** + * Test case for playlistPostMerge + * + * Post a playlist, do not remove previously imported items. + * + */ + public function testPlaylistPostMerge() + { + } + /** * Test case for playlistPostStructure * @@ -152,6 +171,16 @@ public function testPlaylistPostTiming() { } + /** + * Test case for stopCurrentItem + * + * Stop an Item. + * + */ + public function testStopCurrentItem() + { + } + /** * Test case for updateItemById * diff --git a/test/Api/ModelTypeApiTest.php b/test/Api/ModelTypeApiTest.php index 74d718e..98402e1 100644 --- a/test/Api/ModelTypeApiTest.php +++ b/test/Api/ModelTypeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/PresenterApiTest.php b/test/Api/PresenterApiTest.php index 008014f..923989b 100644 --- a/test/Api/PresenterApiTest.php +++ b/test/Api/PresenterApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/ProgramApiTest.php b/test/Api/ProgramApiTest.php index 8a425b7..c1d3118 100644 --- a/test/Api/ProgramApiTest.php +++ b/test/Api/ProgramApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/StationApiTest.php b/test/Api/StationApiTest.php index 2e7003b..0591d3d 100644 --- a/test/Api/StationApiTest.php +++ b/test/Api/StationApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/StoryApiTest.php b/test/Api/StoryApiTest.php index a8d979a..b4ad68e 100644 --- a/test/Api/StoryApiTest.php +++ b/test/Api/StoryApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/StringApiTest.php b/test/Api/StringApiTest.php index 4a17036..6ae30f5 100644 --- a/test/Api/StringApiTest.php +++ b/test/Api/StringApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/TagApiTest.php b/test/Api/TagApiTest.php index 3d2c6d8..f0101f6 100644 --- a/test/Api/TagApiTest.php +++ b/test/Api/TagApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/UserApiTest.php b/test/Api/UserApiTest.php index cc3e567..cd1e31b 100644 --- a/test/Api/UserApiTest.php +++ b/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Api/VisualSlideApiTest.php b/test/Api/VisualSlideApiTest.php index a03fcec..3b358a6 100644 --- a/test/Api/VisualSlideApiTest.php +++ b/test/Api/VisualSlideApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -29,7 +29,6 @@ namespace RadioManager; use \RadioManager\Configuration; -use \RadioManager\ApiClient; use \RadioManager\ApiException; use \RadioManager\ObjectSerializer; diff --git a/test/Model/BlockRelationsBroadcastParamsTest.php b/test/Model/BlockRelationsBroadcastParamsTest.php index 4b00c8b..e9af07c 100644 --- a/test/Model/BlockRelationsBroadcastParamsTest.php +++ b/test/Model/BlockRelationsBroadcastParamsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockRelationsBroadcastTest.php b/test/Model/BlockRelationsBroadcastTest.php index 0ec4ca7..f778158 100644 --- a/test/Model/BlockRelationsBroadcastTest.php +++ b/test/Model/BlockRelationsBroadcastTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockRelationsItemsParamsTest.php b/test/Model/BlockRelationsItemsParamsTest.php index 5eefb13..adea2f8 100644 --- a/test/Model/BlockRelationsItemsParamsTest.php +++ b/test/Model/BlockRelationsItemsParamsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockRelationsItemsTest.php b/test/Model/BlockRelationsItemsTest.php index 7aca626..11173ae 100644 --- a/test/Model/BlockRelationsItemsTest.php +++ b/test/Model/BlockRelationsItemsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockRelationsProgramTest.php b/test/Model/BlockRelationsProgramTest.php index ffb82a8..4db9e60 100644 --- a/test/Model/BlockRelationsProgramTest.php +++ b/test/Model/BlockRelationsProgramTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockRelationsTest.php b/test/Model/BlockRelationsTest.php index 5b0e448..3a7943f 100644 --- a/test/Model/BlockRelationsTest.php +++ b/test/Model/BlockRelationsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockResultTest.php b/test/Model/BlockResultTest.php index f89870c..e11571e 100644 --- a/test/Model/BlockResultTest.php +++ b/test/Model/BlockResultTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockResultsTest.php b/test/Model/BlockResultsTest.php index a103ccc..7004d29 100644 --- a/test/Model/BlockResultsTest.php +++ b/test/Model/BlockResultsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BlockTest.php b/test/Model/BlockTest.php index 08ebb4a..d4a8d9c 100644 --- a/test/Model/BlockTest.php +++ b/test/Model/BlockTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastDataInputTest.php b/test/Model/BroadcastDataInputTest.php index 171d256..aee7d4a 100644 --- a/test/Model/BroadcastDataInputTest.php +++ b/test/Model/BroadcastDataInputTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastEPGDayTest.php b/test/Model/BroadcastEPGDayTest.php index ef1bdaf..d3ae27b 100644 --- a/test/Model/BroadcastEPGDayTest.php +++ b/test/Model/BroadcastEPGDayTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastEPGRelationsTest.php b/test/Model/BroadcastEPGRelationsTest.php index ff8a78b..1cfdedc 100644 --- a/test/Model/BroadcastEPGRelationsTest.php +++ b/test/Model/BroadcastEPGRelationsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastEPGResultTest.php b/test/Model/BroadcastEPGResultTest.php index b5727d4..5ac7922 100644 --- a/test/Model/BroadcastEPGResultTest.php +++ b/test/Model/BroadcastEPGResultTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastInputOnlyTest.php b/test/Model/BroadcastInputOnlyTest.php index 623932d..ac28106 100644 --- a/test/Model/BroadcastInputOnlyTest.php +++ b/test/Model/BroadcastInputOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastOutputOnlyTest.php b/test/Model/BroadcastOutputOnlyTest.php index 4a53366..36d9dc2 100644 --- a/test/Model/BroadcastOutputOnlyTest.php +++ b/test/Model/BroadcastOutputOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsBlocksTest.php b/test/Model/BroadcastRelationsBlocksTest.php index faa7282..6ffe921 100644 --- a/test/Model/BroadcastRelationsBlocksTest.php +++ b/test/Model/BroadcastRelationsBlocksTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsGenreTest.php b/test/Model/BroadcastRelationsGenreTest.php index c57e6c0..fa1ab16 100644 --- a/test/Model/BroadcastRelationsGenreTest.php +++ b/test/Model/BroadcastRelationsGenreTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsItemsParamsTest.php b/test/Model/BroadcastRelationsItemsParamsTest.php index 44ef074..5db2332 100644 --- a/test/Model/BroadcastRelationsItemsParamsTest.php +++ b/test/Model/BroadcastRelationsItemsParamsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsItemsTest.php b/test/Model/BroadcastRelationsItemsTest.php index 39b04da..70f25c7 100644 --- a/test/Model/BroadcastRelationsItemsTest.php +++ b/test/Model/BroadcastRelationsItemsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsModelTypeTest.php b/test/Model/BroadcastRelationsModelTypeTest.php index 229deb6..cee4402 100644 --- a/test/Model/BroadcastRelationsModelTypeTest.php +++ b/test/Model/BroadcastRelationsModelTypeTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsPresentersTest.php b/test/Model/BroadcastRelationsPresentersTest.php index 8044e66..525b746 100644 --- a/test/Model/BroadcastRelationsPresentersTest.php +++ b/test/Model/BroadcastRelationsPresentersTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsTagsTest.php b/test/Model/BroadcastRelationsTagsTest.php index 1848278..d00bc52 100644 --- a/test/Model/BroadcastRelationsTagsTest.php +++ b/test/Model/BroadcastRelationsTagsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastRelationsTest.php b/test/Model/BroadcastRelationsTest.php index 163b238..6b11acf 100644 --- a/test/Model/BroadcastRelationsTest.php +++ b/test/Model/BroadcastRelationsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -77,6 +77,13 @@ public function testBroadcastRelations() { } + /** + * Test attribute "genre" + */ + public function testPropertyGenre() + { + } + /** * Test attribute "items" */ diff --git a/test/Model/BroadcastResultTest.php b/test/Model/BroadcastResultTest.php index 7f1c667..b0d2759 100644 --- a/test/Model/BroadcastResultTest.php +++ b/test/Model/BroadcastResultTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** @@ -266,6 +266,13 @@ public function testPropertyPtyCodeId() { } + /** + * Test attribute "genre" + */ + public function testPropertyGenre() + { + } + /** * Test attribute "items" */ diff --git a/test/Model/BroadcastResultsTest.php b/test/Model/BroadcastResultsTest.php index a3bb8fb..b19f100 100644 --- a/test/Model/BroadcastResultsTest.php +++ b/test/Model/BroadcastResultsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/BroadcastTest.php b/test/Model/BroadcastTest.php index 7a193ad..ee55464 100644 --- a/test/Model/BroadcastTest.php +++ b/test/Model/BroadcastTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignDataInputTest.php b/test/Model/CampaignDataInputTest.php index 2330548..3edc01b 100644 --- a/test/Model/CampaignDataInputTest.php +++ b/test/Model/CampaignDataInputTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignOutputOnlyTest.php b/test/Model/CampaignOutputOnlyTest.php index 7e15f4e..7f7efb6 100644 --- a/test/Model/CampaignOutputOnlyTest.php +++ b/test/Model/CampaignOutputOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignRelationsItemsParamsTest.php b/test/Model/CampaignRelationsItemsParamsTest.php index c015854..22f24a4 100644 --- a/test/Model/CampaignRelationsItemsParamsTest.php +++ b/test/Model/CampaignRelationsItemsParamsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignRelationsItemsTest.php b/test/Model/CampaignRelationsItemsTest.php index 1e9983a..3044493 100644 --- a/test/Model/CampaignRelationsItemsTest.php +++ b/test/Model/CampaignRelationsItemsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignRelationsTest.php b/test/Model/CampaignRelationsTest.php index a77a937..d6ba341 100644 --- a/test/Model/CampaignRelationsTest.php +++ b/test/Model/CampaignRelationsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignResultTest.php b/test/Model/CampaignResultTest.php index 9401c40..9ae794f 100644 --- a/test/Model/CampaignResultTest.php +++ b/test/Model/CampaignResultTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignResultsTest.php b/test/Model/CampaignResultsTest.php index 1b1f4b0..315abe1 100644 --- a/test/Model/CampaignResultsTest.php +++ b/test/Model/CampaignResultsTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0 * Contact: support@pluxbox.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * + * Swagger Codegen version: 2.3.0 */ /** diff --git a/test/Model/CampaignTemplateItemTest.php b/test/Model/CampaignTemplateItemTest.php new file mode 100644 index 0000000..5d8d24a --- /dev/null +++ b/test/Model/CampaignTemplateItemTest.php @@ -0,0 +1,135 @@ +