diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 9c630c7..6b93e4f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -12,12 +12,12 @@ docs/Api/SmsApi.md docs/Model/BaseResponse.md docs/Model/BrandName.md docs/Model/BrandNamesResponse.md -docs/Model/CreateBrandNamePayload.md +docs/Model/CreateBrandNameRequest.md docs/Model/CreateBrandNameResponse.md docs/Model/DeliveryReportItem.md docs/Model/DeliveryReportResponse.md docs/Model/SMSBalanceResponse.md -docs/Model/SMSPayload.md +docs/Model/SendSMSRequest.md docs/Model/SendSMSResponse.md phpunit.xml.dist src/Api/SmsApi.php @@ -28,12 +28,14 @@ src/HeaderSelector.php src/Model/BaseResponse.php src/Model/BrandName.php src/Model/BrandNamesResponse.php -src/Model/CreateBrandNamePayload.php +src/Model/CreateBrandNameRequest.php src/Model/CreateBrandNameResponse.php src/Model/DeliveryReportItem.php src/Model/DeliveryReportResponse.php src/Model/ModelInterface.php src/Model/SMSBalanceResponse.php -src/Model/SMSPayload.php +src/Model/SendSMSRequest.php src/Model/SendSMSResponse.php src/ObjectSerializer.php +test/Model/CreateBrandNameRequestTest.php +test/Model/SendSMSRequestTest.php diff --git a/README.md b/README.md index 615d32c..bedfe59 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. +For more information, please visit [https://ubill.ge/](https://ubill.ge/). ## Installation & Usage @@ -28,7 +29,7 @@ require_once(__DIR__ . '/vendor/autoload.php'); -// Configure API key authorization: api_key +// Configure API key authorization: apiKey $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); @@ -40,10 +41,10 @@ $apiInstance = new UBill\Sdk\Api\SmsApi( new GuzzleHttp\Client(), $config ); -$createBrandNamePayload = new \UBill\Sdk\Model\CreateBrandNamePayload(); // \UBill\Sdk\Model\CreateBrandNamePayload | Brand Name payload to create +$createBrandNameRequest = new \UBill\Sdk\Model\CreateBrandNameRequest(); // \UBill\Sdk\Model\CreateBrandNameRequest | Brand Name payload to create try { - $result = $apiInstance->createBrandName($createBrandNamePayload); + $result = $apiInstance->createBrandName($createBrandNameRequest); print_r($result); } catch (Exception $e) { echo 'Exception when calling SmsApi->createBrandName: ', $e->getMessage(), PHP_EOL; @@ -58,28 +59,28 @@ All URIs are relative to *https://api.ubill.dev/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *SmsApi* | [**createBrandName**](docs/Api/SmsApi.md#createbrandname) | **POST** /sms/brandNameCreate | Create Brand Name -*SmsApi* | [**getBalance**](docs/Api/SmsApi.md#getbalance) | **GET** /sms/balance | Get SMS Balance -*SmsApi* | [**getBrandNames**](docs/Api/SmsApi.md#getbrandnames) | **GET** /sms/brandNames | Get All Brand Names *SmsApi* | [**getDeliveryReport**](docs/Api/SmsApi.md#getdeliveryreport) | **GET** /sms/report/{smsID} | Get Delivery Report -*SmsApi* | [**send**](docs/Api/SmsApi.md#send) | **POST** /sms/send | Send SMS +*SmsApi* | [**getSMSBalance**](docs/Api/SmsApi.md#getsmsbalance) | **GET** /sms/balance | Get SMS Balance +*SmsApi* | [**listBrandNames**](docs/Api/SmsApi.md#listbrandnames) | **GET** /sms/brandNames | Get All Brand Names +*SmsApi* | [**sendSMS**](docs/Api/SmsApi.md#sendsms) | **POST** /sms/send | Send SMS ## Models - [BaseResponse](docs/Model/BaseResponse.md) - [BrandName](docs/Model/BrandName.md) - [BrandNamesResponse](docs/Model/BrandNamesResponse.md) -- [CreateBrandNamePayload](docs/Model/CreateBrandNamePayload.md) +- [CreateBrandNameRequest](docs/Model/CreateBrandNameRequest.md) - [CreateBrandNameResponse](docs/Model/CreateBrandNameResponse.md) - [DeliveryReportItem](docs/Model/DeliveryReportItem.md) - [DeliveryReportResponse](docs/Model/DeliveryReportResponse.md) - [SMSBalanceResponse](docs/Model/SMSBalanceResponse.md) -- [SMSPayload](docs/Model/SMSPayload.md) +- [SendSMSRequest](docs/Model/SendSMSRequest.md) - [SendSMSResponse](docs/Model/SendSMSResponse.md) ## Authorization Authentication schemes defined for the API: -### api_key +### apiKey - **Type**: API key - **API key parameter name**: key @@ -99,7 +100,7 @@ vendor/bin/phpunit This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: `2.1.7` +- API version: `2.1.8` - Package version: `0.1.1` - Generator version: `7.13.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/docs/Api/SmsApi.md b/docs/Api/SmsApi.md index 5fa0fa5..e75df15 100644 --- a/docs/Api/SmsApi.md +++ b/docs/Api/SmsApi.md @@ -5,16 +5,16 @@ All URIs are relative to https://api.ubill.dev/v1, except if the operation defin | Method | HTTP request | Description | | ------------- | ------------- | ------------- | | [**createBrandName()**](SmsApi.md#createBrandName) | **POST** /sms/brandNameCreate | Create Brand Name | -| [**getBalance()**](SmsApi.md#getBalance) | **GET** /sms/balance | Get SMS Balance | -| [**getBrandNames()**](SmsApi.md#getBrandNames) | **GET** /sms/brandNames | Get All Brand Names | | [**getDeliveryReport()**](SmsApi.md#getDeliveryReport) | **GET** /sms/report/{smsID} | Get Delivery Report | -| [**send()**](SmsApi.md#send) | **POST** /sms/send | Send SMS | +| [**getSMSBalance()**](SmsApi.md#getSMSBalance) | **GET** /sms/balance | Get SMS Balance | +| [**listBrandNames()**](SmsApi.md#listBrandNames) | **GET** /sms/brandNames | Get All Brand Names | +| [**sendSMS()**](SmsApi.md#sendSMS) | **POST** /sms/send | Send SMS | ## `createBrandName()` ```php -createBrandName($createBrandNamePayload): \UBill\Sdk\Model\CreateBrandNameResponse +createBrandName($createBrandNameRequest): \UBill\Sdk\Model\CreateBrandNameResponse ``` Create Brand Name @@ -28,7 +28,7 @@ Register a new brand name for SMS messaging. Brand names are used to identify th require_once(__DIR__ . '/vendor/autoload.php'); -// Configure API key authorization: api_key +// Configure API key authorization: apiKey $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); @@ -40,10 +40,10 @@ $apiInstance = new UBill\Sdk\Api\SmsApi( new GuzzleHttp\Client(), $config ); -$createBrandNamePayload = new \UBill\Sdk\Model\CreateBrandNamePayload(); // \UBill\Sdk\Model\CreateBrandNamePayload | Brand Name payload to create +$createBrandNameRequest = new \UBill\Sdk\Model\CreateBrandNameRequest(); // \UBill\Sdk\Model\CreateBrandNameRequest | Brand Name payload to create try { - $result = $apiInstance->createBrandName($createBrandNamePayload); + $result = $apiInstance->createBrandName($createBrandNameRequest); print_r($result); } catch (Exception $e) { echo 'Exception when calling SmsApi->createBrandName: ', $e->getMessage(), PHP_EOL; @@ -54,7 +54,7 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **createBrandNamePayload** | [**\UBill\Sdk\Model\CreateBrandNamePayload**](../Model/CreateBrandNamePayload.md)| Brand Name payload to create | [optional] | +| **createBrandNameRequest** | [**\UBill\Sdk\Model\CreateBrandNameRequest**](../Model/CreateBrandNameRequest.md)| Brand Name payload to create | | ### Return type @@ -62,7 +62,7 @@ try { ### Authorization -[api_key](../../README.md#api_key) +[apiKey](../../README.md#apiKey) ### HTTP request headers @@ -73,15 +73,15 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getBalance()` +## `getDeliveryReport()` ```php -getBalance(): \UBill\Sdk\Model\SMSBalanceResponse +getDeliveryReport($smsID): \UBill\Sdk\Model\DeliveryReportResponse ``` -Get SMS Balance +Get Delivery Report -Retrieve your current SMS balance, indicating how many messages you can send. +Fetch the delivery status of a previously sent SMS using its unique identifier. ### Example @@ -90,7 +90,7 @@ Retrieve your current SMS balance, indicating how many messages you can send. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure API key authorization: api_key +// Configure API key authorization: apiKey $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); @@ -102,26 +102,29 @@ $apiInstance = new UBill\Sdk\Api\SmsApi( new GuzzleHttp\Client(), $config ); +$smsID = 56; // int | Unique identifier of the SMS try { - $result = $apiInstance->getBalance(); + $result = $apiInstance->getDeliveryReport($smsID); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SmsApi->getBalance: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SmsApi->getDeliveryReport: ', $e->getMessage(), PHP_EOL; } ``` ### Parameters -This endpoint does not need any parameter. +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **smsID** | **int**| Unique identifier of the SMS | | ### Return type -[**\UBill\Sdk\Model\SMSBalanceResponse**](../Model/SMSBalanceResponse.md) +[**\UBill\Sdk\Model\DeliveryReportResponse**](../Model/DeliveryReportResponse.md) ### Authorization -[api_key](../../README.md#api_key) +[apiKey](../../README.md#apiKey) ### HTTP request headers @@ -132,15 +135,15 @@ This endpoint does not need any parameter. [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getBrandNames()` +## `getSMSBalance()` ```php -getBrandNames(): \UBill\Sdk\Model\BrandNamesResponse +getSMSBalance(): \UBill\Sdk\Model\SMSBalanceResponse ``` -Get All Brand Names +Get SMS Balance -Retrieve a list of all registered brand names associated with your account. +Retrieve your current SMS balance, indicating how many messages you can send. ### Example @@ -149,7 +152,7 @@ Retrieve a list of all registered brand names associated with your account. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure API key authorization: api_key +// Configure API key authorization: apiKey $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); @@ -163,10 +166,10 @@ $apiInstance = new UBill\Sdk\Api\SmsApi( ); try { - $result = $apiInstance->getBrandNames(); + $result = $apiInstance->getSMSBalance(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SmsApi->getBrandNames: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SmsApi->getSMSBalance: ', $e->getMessage(), PHP_EOL; } ``` @@ -176,11 +179,11 @@ This endpoint does not need any parameter. ### Return type -[**\UBill\Sdk\Model\BrandNamesResponse**](../Model/BrandNamesResponse.md) +[**\UBill\Sdk\Model\SMSBalanceResponse**](../Model/SMSBalanceResponse.md) ### Authorization -[api_key](../../README.md#api_key) +[apiKey](../../README.md#apiKey) ### HTTP request headers @@ -191,15 +194,15 @@ This endpoint does not need any parameter. [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getDeliveryReport()` +## `listBrandNames()` ```php -getDeliveryReport($smsID): \UBill\Sdk\Model\DeliveryReportResponse +listBrandNames(): \UBill\Sdk\Model\BrandNamesResponse ``` -Get Delivery Report +Get All Brand Names -Fetch the delivery status of a previously sent SMS using its unique identifier. +Retrieve a list of all registered brand names associated with your account. ### Example @@ -208,7 +211,7 @@ Fetch the delivery status of a previously sent SMS using its unique identifier. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure API key authorization: api_key +// Configure API key authorization: apiKey $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); @@ -220,29 +223,26 @@ $apiInstance = new UBill\Sdk\Api\SmsApi( new GuzzleHttp\Client(), $config ); -$smsID = 56; // int | Unique identifier of the SMS try { - $result = $apiInstance->getDeliveryReport($smsID); + $result = $apiInstance->listBrandNames(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SmsApi->getDeliveryReport: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SmsApi->listBrandNames: ', $e->getMessage(), PHP_EOL; } ``` ### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **smsID** | **int**| Unique identifier of the SMS | | +This endpoint does not need any parameter. ### Return type -[**\UBill\Sdk\Model\DeliveryReportResponse**](../Model/DeliveryReportResponse.md) +[**\UBill\Sdk\Model\BrandNamesResponse**](../Model/BrandNamesResponse.md) ### Authorization -[api_key](../../README.md#api_key) +[apiKey](../../README.md#apiKey) ### HTTP request headers @@ -253,10 +253,10 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `send()` +## `sendSMS()` ```php -send($sMSPayload): \UBill\Sdk\Model\SendSMSResponse +sendSMS($sendSMSRequest): \UBill\Sdk\Model\SendSMSResponse ``` Send SMS @@ -270,7 +270,7 @@ Send SMS messages to one or multiple recipients using a registered brand name. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure API key authorization: api_key +// Configure API key authorization: apiKey $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = UBill\Sdk\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); @@ -282,13 +282,13 @@ $apiInstance = new UBill\Sdk\Api\SmsApi( new GuzzleHttp\Client(), $config ); -$sMSPayload = new \UBill\Sdk\Model\SMSPayload(); // \UBill\Sdk\Model\SMSPayload | SMS payload for sending messages +$sendSMSRequest = new \UBill\Sdk\Model\SendSMSRequest(); // \UBill\Sdk\Model\SendSMSRequest | SMS payload for sending messages try { - $result = $apiInstance->send($sMSPayload); + $result = $apiInstance->sendSMS($sendSMSRequest); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SmsApi->send: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SmsApi->sendSMS: ', $e->getMessage(), PHP_EOL; } ``` @@ -296,7 +296,7 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **sMSPayload** | [**\UBill\Sdk\Model\SMSPayload**](../Model/SMSPayload.md)| SMS payload for sending messages | [optional] | +| **sendSMSRequest** | [**\UBill\Sdk\Model\SendSMSRequest**](../Model/SendSMSRequest.md)| SMS payload for sending messages | | ### Return type @@ -304,7 +304,7 @@ try { ### Authorization -[api_key](../../README.md#api_key) +[apiKey](../../README.md#apiKey) ### HTTP request headers diff --git a/docs/Model/BrandName.md b/docs/Model/BrandName.md index b36412c..2e18800 100644 --- a/docs/Model/BrandName.md +++ b/docs/Model/BrandName.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | -**name** | **string** | | -**authorized** | **string** | | -**createdAt** | **string** | | +**id** | **string** | Brand identifier | +**name** | **string** | Brand name used as SMS sender | +**authorized** | **string** | Authorization status | +**createdAt** | **string** | Brand creation timestamp | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateBrandNameRequest.md b/docs/Model/CreateBrandNameRequest.md new file mode 100644 index 0000000..868da6f --- /dev/null +++ b/docs/Model/CreateBrandNameRequest.md @@ -0,0 +1,9 @@ +# # CreateBrandNameRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**brandName** | **string** | Brand name to create | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateBrandNameResponse.md b/docs/Model/CreateBrandNameResponse.md index 71fef52..c2b5425 100644 --- a/docs/Model/CreateBrandNameResponse.md +++ b/docs/Model/CreateBrandNameResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **statusID** | **int** | Response status code | **message** | **string** | Human-readable response message | [optional] -**brandID** | **int** | Brand identifier | [optional] +**brandID** | **int** | Brand identifier as integer | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryReportItem.md b/docs/Model/DeliveryReportItem.md index 747440b..7e0fbf2 100644 --- a/docs/Model/DeliveryReportItem.md +++ b/docs/Model/DeliveryReportItem.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**number** | **string** | | [optional] -**statusID** | **string** | | [optional] +**number** | **string** | Phone number as string | +**statusID** | **string** | Delivery status as string | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryReportResponse.md b/docs/Model/DeliveryReportResponse.md index a0e0cb9..8d3f2bc 100644 --- a/docs/Model/DeliveryReportResponse.md +++ b/docs/Model/DeliveryReportResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **statusID** | **int** | Response status code | **message** | **string** | Human-readable response message | [optional] -**result** | [**\UBill\Sdk\Model\DeliveryReportItem[]**](DeliveryReportItem.md) | | [optional] +**result** | [**\UBill\Sdk\Model\DeliveryReportItem[]**](DeliveryReportItem.md) | Delivery report results | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SMSBalanceResponse.md b/docs/Model/SMSBalanceResponse.md index 998e1b6..c70f3dd 100644 --- a/docs/Model/SMSBalanceResponse.md +++ b/docs/Model/SMSBalanceResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **statusID** | **int** | Response status code | **message** | **string** | Human-readable response message | [optional] -**sms** | **string** | | [optional] +**sms** | **string** | SMS balance as string | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendSMSRequest.md b/docs/Model/SendSMSRequest.md new file mode 100644 index 0000000..0f2dbe2 --- /dev/null +++ b/docs/Model/SendSMSRequest.md @@ -0,0 +1,12 @@ +# # SendSMSRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**brandID** | **int** | Brand identifier as integer | +**numbers** | **int[]** | Array of phone numbers as integers | +**text** | **string** | SMS message text | +**stopList** | **bool** | Enable/disable checking numbers in the stop list | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendSMSResponse.md b/docs/Model/SendSMSResponse.md index 7a1c1cd..8c3b339 100644 --- a/docs/Model/SendSMSResponse.md +++ b/docs/Model/SendSMSResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **statusID** | **int** | Response status code | **message** | **string** | Human-readable response message | [optional] -**smsID** | **string** | | [optional] +**smsID** | **string** | SMS identifier as string | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/SmsApi.php b/src/Api/SmsApi.php index a9669e2..79f2ca6 100644 --- a/src/Api/SmsApi.php +++ b/src/Api/SmsApi.php @@ -15,7 +15,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -79,16 +79,16 @@ class SmsApi 'createBrandName' => [ 'application/json', ], - 'getBalance' => [ + 'getDeliveryReport' => [ 'application/json', ], - 'getBrandNames' => [ + 'getSMSBalance' => [ 'application/json', ], - 'getDeliveryReport' => [ + 'listBrandNames' => [ 'application/json', ], - 'send' => [ + 'sendSMS' => [ 'application/json', ], ]; @@ -144,16 +144,16 @@ public function getConfig() * * Create Brand Name * - * @param \UBill\Sdk\Model\CreateBrandNamePayload|null $createBrandNamePayload Brand Name payload to create (optional) + * @param \UBill\Sdk\Model\CreateBrandNameRequest $createBrandNameRequest Brand Name payload to create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBrandName'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \UBill\Sdk\Model\CreateBrandNameResponse */ - public function createBrandName($createBrandNamePayload = null, string $contentType = self::contentTypes['createBrandName'][0]) + public function createBrandName($createBrandNameRequest, string $contentType = self::contentTypes['createBrandName'][0]) { - list($response) = $this->createBrandNameWithHttpInfo($createBrandNamePayload, $contentType); + list($response) = $this->createBrandNameWithHttpInfo($createBrandNameRequest, $contentType); return $response; } @@ -162,16 +162,16 @@ public function createBrandName($createBrandNamePayload = null, string $contentT * * Create Brand Name * - * @param \UBill\Sdk\Model\CreateBrandNamePayload|null $createBrandNamePayload Brand Name payload to create (optional) + * @param \UBill\Sdk\Model\CreateBrandNameRequest $createBrandNameRequest Brand Name payload to create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBrandName'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \UBill\Sdk\Model\CreateBrandNameResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createBrandNameWithHttpInfo($createBrandNamePayload = null, string $contentType = self::contentTypes['createBrandName'][0]) + public function createBrandNameWithHttpInfo($createBrandNameRequest, string $contentType = self::contentTypes['createBrandName'][0]) { - $request = $this->createBrandNameRequest($createBrandNamePayload, $contentType); + $request = $this->createBrandNameRequest($createBrandNameRequest, $contentType); try { $options = $this->createHttpClientOption(); @@ -247,15 +247,15 @@ public function createBrandNameWithHttpInfo($createBrandNamePayload = null, stri * * Create Brand Name * - * @param \UBill\Sdk\Model\CreateBrandNamePayload|null $createBrandNamePayload Brand Name payload to create (optional) + * @param \UBill\Sdk\Model\CreateBrandNameRequest $createBrandNameRequest Brand Name payload to create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBrandName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createBrandNameAsync($createBrandNamePayload = null, string $contentType = self::contentTypes['createBrandName'][0]) + public function createBrandNameAsync($createBrandNameRequest, string $contentType = self::contentTypes['createBrandName'][0]) { - return $this->createBrandNameAsyncWithHttpInfo($createBrandNamePayload, $contentType) + return $this->createBrandNameAsyncWithHttpInfo($createBrandNameRequest, $contentType) ->then( function ($response) { return $response[0]; @@ -268,16 +268,16 @@ function ($response) { * * Create Brand Name * - * @param \UBill\Sdk\Model\CreateBrandNamePayload|null $createBrandNamePayload Brand Name payload to create (optional) + * @param \UBill\Sdk\Model\CreateBrandNameRequest $createBrandNameRequest Brand Name payload to create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBrandName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createBrandNameAsyncWithHttpInfo($createBrandNamePayload = null, string $contentType = self::contentTypes['createBrandName'][0]) + public function createBrandNameAsyncWithHttpInfo($createBrandNameRequest, string $contentType = self::contentTypes['createBrandName'][0]) { $returnType = '\UBill\Sdk\Model\CreateBrandNameResponse'; - $request = $this->createBrandNameRequest($createBrandNamePayload, $contentType); + $request = $this->createBrandNameRequest($createBrandNameRequest, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -318,15 +318,21 @@ function ($exception) { /** * Create request for operation 'createBrandName' * - * @param \UBill\Sdk\Model\CreateBrandNamePayload|null $createBrandNamePayload Brand Name payload to create (optional) + * @param \UBill\Sdk\Model\CreateBrandNameRequest $createBrandNameRequest Brand Name payload to create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBrandName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createBrandNameRequest($createBrandNamePayload = null, string $contentType = self::contentTypes['createBrandName'][0]) + public function createBrandNameRequest($createBrandNameRequest, string $contentType = self::contentTypes['createBrandName'][0]) { + // verify the required parameter 'createBrandNameRequest' is set + if ($createBrandNameRequest === null || (is_array($createBrandNameRequest) && count($createBrandNameRequest) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createBrandNameRequest when calling createBrandName' + ); + } $resourcePath = '/sms/brandNameCreate'; @@ -347,12 +353,12 @@ public function createBrandNameRequest($createBrandNamePayload = null, string $c ); // for model (json/xml) - if (isset($createBrandNamePayload)) { + if (isset($createBrandNameRequest)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createBrandNamePayload)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createBrandNameRequest)); } else { - $httpBody = $createBrandNamePayload; + $httpBody = $createBrandNameRequest; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -406,36 +412,38 @@ public function createBrandNameRequest($createBrandNamePayload = null, string $c } /** - * Operation getBalance + * Operation getDeliveryReport * - * Get SMS Balance + * Get Delivery Report * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalance'] to see the possible values for this operation + * @param int $smsID Unique identifier of the SMS (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \UBill\Sdk\Model\SMSBalanceResponse + * @return \UBill\Sdk\Model\DeliveryReportResponse */ - public function getBalance(string $contentType = self::contentTypes['getBalance'][0]) + public function getDeliveryReport($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) { - list($response) = $this->getBalanceWithHttpInfo($contentType); + list($response) = $this->getDeliveryReportWithHttpInfo($smsID, $contentType); return $response; } /** - * Operation getBalanceWithHttpInfo + * Operation getDeliveryReportWithHttpInfo * - * Get SMS Balance + * Get Delivery Report * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalance'] to see the possible values for this operation + * @param int $smsID Unique identifier of the SMS (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \UBill\Sdk\Model\SMSBalanceResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \UBill\Sdk\Model\DeliveryReportResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBalanceWithHttpInfo(string $contentType = self::contentTypes['getBalance'][0]) + public function getDeliveryReportWithHttpInfo($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) { - $request = $this->getBalanceRequest($contentType); + $request = $this->getDeliveryReportRequest($smsID, $contentType); try { $options = $this->createHttpClientOption(); @@ -463,7 +471,7 @@ public function getBalanceWithHttpInfo(string $contentType = self::contentTypes[ switch ($statusCode) { case 200: return $this->handleResponseWithDataType( - '\UBill\Sdk\Model\SMSBalanceResponse', + '\UBill\Sdk\Model\DeliveryReportResponse', $request, $response, ); @@ -485,7 +493,7 @@ public function getBalanceWithHttpInfo(string $contentType = self::contentTypes[ } return $this->handleResponseWithDataType( - '\UBill\Sdk\Model\SMSBalanceResponse', + '\UBill\Sdk\Model\DeliveryReportResponse', $request, $response, ); @@ -494,7 +502,7 @@ public function getBalanceWithHttpInfo(string $contentType = self::contentTypes[ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\UBill\Sdk\Model\SMSBalanceResponse', + '\UBill\Sdk\Model\DeliveryReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -507,18 +515,19 @@ public function getBalanceWithHttpInfo(string $contentType = self::contentTypes[ } /** - * Operation getBalanceAsync + * Operation getDeliveryReportAsync * - * Get SMS Balance + * Get Delivery Report * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalance'] to see the possible values for this operation + * @param int $smsID Unique identifier of the SMS (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBalanceAsync(string $contentType = self::contentTypes['getBalance'][0]) + public function getDeliveryReportAsync($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) { - return $this->getBalanceAsyncWithHttpInfo($contentType) + return $this->getDeliveryReportAsyncWithHttpInfo($smsID, $contentType) ->then( function ($response) { return $response[0]; @@ -527,19 +536,20 @@ function ($response) { } /** - * Operation getBalanceAsyncWithHttpInfo + * Operation getDeliveryReportAsyncWithHttpInfo * - * Get SMS Balance + * Get Delivery Report * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalance'] to see the possible values for this operation + * @param int $smsID Unique identifier of the SMS (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBalanceAsyncWithHttpInfo(string $contentType = self::contentTypes['getBalance'][0]) + public function getDeliveryReportAsyncWithHttpInfo($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) { - $returnType = '\UBill\Sdk\Model\SMSBalanceResponse'; - $request = $this->getBalanceRequest($contentType); + $returnType = '\UBill\Sdk\Model\DeliveryReportResponse'; + $request = $this->getDeliveryReportRequest($smsID, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -578,18 +588,26 @@ function ($exception) { } /** - * Create request for operation 'getBalance' + * Create request for operation 'getDeliveryReport' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalance'] to see the possible values for this operation + * @param int $smsID Unique identifier of the SMS (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBalanceRequest(string $contentType = self::contentTypes['getBalance'][0]) + public function getDeliveryReportRequest($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) { + // verify the required parameter 'smsID' is set + if ($smsID === null || (is_array($smsID) && count($smsID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $smsID when calling getDeliveryReport' + ); + } - $resourcePath = '/sms/balance'; + + $resourcePath = '/sms/report/{smsID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -598,6 +616,14 @@ public function getBalanceRequest(string $contentType = self::contentTypes['getB + // path params + if ($smsID !== null) { + $resourcePath = str_replace( + '{' . 'smsID' . '}', + ObjectSerializer::toPathValue($smsID), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -659,36 +685,36 @@ public function getBalanceRequest(string $contentType = self::contentTypes['getB } /** - * Operation getBrandNames + * Operation getSMSBalance * - * Get All Brand Names + * Get SMS Balance * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBrandNames'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSMSBalance'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \UBill\Sdk\Model\BrandNamesResponse + * @return \UBill\Sdk\Model\SMSBalanceResponse */ - public function getBrandNames(string $contentType = self::contentTypes['getBrandNames'][0]) + public function getSMSBalance(string $contentType = self::contentTypes['getSMSBalance'][0]) { - list($response) = $this->getBrandNamesWithHttpInfo($contentType); + list($response) = $this->getSMSBalanceWithHttpInfo($contentType); return $response; } /** - * Operation getBrandNamesWithHttpInfo + * Operation getSMSBalanceWithHttpInfo * - * Get All Brand Names + * Get SMS Balance * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBrandNames'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSMSBalance'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \UBill\Sdk\Model\BrandNamesResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \UBill\Sdk\Model\SMSBalanceResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBrandNamesWithHttpInfo(string $contentType = self::contentTypes['getBrandNames'][0]) + public function getSMSBalanceWithHttpInfo(string $contentType = self::contentTypes['getSMSBalance'][0]) { - $request = $this->getBrandNamesRequest($contentType); + $request = $this->getSMSBalanceRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -716,7 +742,7 @@ public function getBrandNamesWithHttpInfo(string $contentType = self::contentTyp switch ($statusCode) { case 200: return $this->handleResponseWithDataType( - '\UBill\Sdk\Model\BrandNamesResponse', + '\UBill\Sdk\Model\SMSBalanceResponse', $request, $response, ); @@ -738,7 +764,7 @@ public function getBrandNamesWithHttpInfo(string $contentType = self::contentTyp } return $this->handleResponseWithDataType( - '\UBill\Sdk\Model\BrandNamesResponse', + '\UBill\Sdk\Model\SMSBalanceResponse', $request, $response, ); @@ -747,7 +773,7 @@ public function getBrandNamesWithHttpInfo(string $contentType = self::contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\UBill\Sdk\Model\BrandNamesResponse', + '\UBill\Sdk\Model\SMSBalanceResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -760,18 +786,18 @@ public function getBrandNamesWithHttpInfo(string $contentType = self::contentTyp } /** - * Operation getBrandNamesAsync + * Operation getSMSBalanceAsync * - * Get All Brand Names + * Get SMS Balance * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBrandNames'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSMSBalance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBrandNamesAsync(string $contentType = self::contentTypes['getBrandNames'][0]) + public function getSMSBalanceAsync(string $contentType = self::contentTypes['getSMSBalance'][0]) { - return $this->getBrandNamesAsyncWithHttpInfo($contentType) + return $this->getSMSBalanceAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -780,19 +806,19 @@ function ($response) { } /** - * Operation getBrandNamesAsyncWithHttpInfo + * Operation getSMSBalanceAsyncWithHttpInfo * - * Get All Brand Names + * Get SMS Balance * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBrandNames'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSMSBalance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBrandNamesAsyncWithHttpInfo(string $contentType = self::contentTypes['getBrandNames'][0]) + public function getSMSBalanceAsyncWithHttpInfo(string $contentType = self::contentTypes['getSMSBalance'][0]) { - $returnType = '\UBill\Sdk\Model\BrandNamesResponse'; - $request = $this->getBrandNamesRequest($contentType); + $returnType = '\UBill\Sdk\Model\SMSBalanceResponse'; + $request = $this->getSMSBalanceRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -831,18 +857,18 @@ function ($exception) { } /** - * Create request for operation 'getBrandNames' + * Create request for operation 'getSMSBalance' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBrandNames'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSMSBalance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBrandNamesRequest(string $contentType = self::contentTypes['getBrandNames'][0]) + public function getSMSBalanceRequest(string $contentType = self::contentTypes['getSMSBalance'][0]) { - $resourcePath = '/sms/brandNames'; + $resourcePath = '/sms/balance'; $formParams = []; $queryParams = []; $headerParams = []; @@ -912,38 +938,36 @@ public function getBrandNamesRequest(string $contentType = self::contentTypes['g } /** - * Operation getDeliveryReport + * Operation listBrandNames * - * Get Delivery Report + * Get All Brand Names * - * @param int $smsID Unique identifier of the SMS (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrandNames'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \UBill\Sdk\Model\DeliveryReportResponse + * @return \UBill\Sdk\Model\BrandNamesResponse */ - public function getDeliveryReport($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) + public function listBrandNames(string $contentType = self::contentTypes['listBrandNames'][0]) { - list($response) = $this->getDeliveryReportWithHttpInfo($smsID, $contentType); + list($response) = $this->listBrandNamesWithHttpInfo($contentType); return $response; } /** - * Operation getDeliveryReportWithHttpInfo + * Operation listBrandNamesWithHttpInfo * - * Get Delivery Report + * Get All Brand Names * - * @param int $smsID Unique identifier of the SMS (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrandNames'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \UBill\Sdk\Model\DeliveryReportResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \UBill\Sdk\Model\BrandNamesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getDeliveryReportWithHttpInfo($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) + public function listBrandNamesWithHttpInfo(string $contentType = self::contentTypes['listBrandNames'][0]) { - $request = $this->getDeliveryReportRequest($smsID, $contentType); + $request = $this->listBrandNamesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -971,7 +995,7 @@ public function getDeliveryReportWithHttpInfo($smsID, string $contentType = self switch ($statusCode) { case 200: return $this->handleResponseWithDataType( - '\UBill\Sdk\Model\DeliveryReportResponse', + '\UBill\Sdk\Model\BrandNamesResponse', $request, $response, ); @@ -993,7 +1017,7 @@ public function getDeliveryReportWithHttpInfo($smsID, string $contentType = self } return $this->handleResponseWithDataType( - '\UBill\Sdk\Model\DeliveryReportResponse', + '\UBill\Sdk\Model\BrandNamesResponse', $request, $response, ); @@ -1002,7 +1026,7 @@ public function getDeliveryReportWithHttpInfo($smsID, string $contentType = self case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\UBill\Sdk\Model\DeliveryReportResponse', + '\UBill\Sdk\Model\BrandNamesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1015,19 +1039,18 @@ public function getDeliveryReportWithHttpInfo($smsID, string $contentType = self } /** - * Operation getDeliveryReportAsync + * Operation listBrandNamesAsync * - * Get Delivery Report + * Get All Brand Names * - * @param int $smsID Unique identifier of the SMS (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrandNames'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryReportAsync($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) + public function listBrandNamesAsync(string $contentType = self::contentTypes['listBrandNames'][0]) { - return $this->getDeliveryReportAsyncWithHttpInfo($smsID, $contentType) + return $this->listBrandNamesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1036,20 +1059,19 @@ function ($response) { } /** - * Operation getDeliveryReportAsyncWithHttpInfo + * Operation listBrandNamesAsyncWithHttpInfo * - * Get Delivery Report + * Get All Brand Names * - * @param int $smsID Unique identifier of the SMS (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrandNames'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryReportAsyncWithHttpInfo($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) + public function listBrandNamesAsyncWithHttpInfo(string $contentType = self::contentTypes['listBrandNames'][0]) { - $returnType = '\UBill\Sdk\Model\DeliveryReportResponse'; - $request = $this->getDeliveryReportRequest($smsID, $contentType); + $returnType = '\UBill\Sdk\Model\BrandNamesResponse'; + $request = $this->listBrandNamesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1088,26 +1110,18 @@ function ($exception) { } /** - * Create request for operation 'getDeliveryReport' + * Create request for operation 'listBrandNames' * - * @param int $smsID Unique identifier of the SMS (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryReport'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrandNames'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeliveryReportRequest($smsID, string $contentType = self::contentTypes['getDeliveryReport'][0]) + public function listBrandNamesRequest(string $contentType = self::contentTypes['listBrandNames'][0]) { - // verify the required parameter 'smsID' is set - if ($smsID === null || (is_array($smsID) && count($smsID) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $smsID when calling getDeliveryReport' - ); - } - - $resourcePath = '/sms/report/{smsID}'; + $resourcePath = '/sms/brandNames'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1116,14 +1130,6 @@ public function getDeliveryReportRequest($smsID, string $contentType = self::con - // path params - if ($smsID !== null) { - $resourcePath = str_replace( - '{' . 'smsID' . '}', - ObjectSerializer::toPathValue($smsID), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -1185,38 +1191,38 @@ public function getDeliveryReportRequest($smsID, string $contentType = self::con } /** - * Operation send + * Operation sendSMS * * Send SMS * - * @param \UBill\Sdk\Model\SMSPayload|null $sMSPayload SMS payload for sending messages (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['send'] to see the possible values for this operation + * @param \UBill\Sdk\Model\SendSMSRequest $sendSMSRequest SMS payload for sending messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSMS'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \UBill\Sdk\Model\SendSMSResponse */ - public function send($sMSPayload = null, string $contentType = self::contentTypes['send'][0]) + public function sendSMS($sendSMSRequest, string $contentType = self::contentTypes['sendSMS'][0]) { - list($response) = $this->sendWithHttpInfo($sMSPayload, $contentType); + list($response) = $this->sendSMSWithHttpInfo($sendSMSRequest, $contentType); return $response; } /** - * Operation sendWithHttpInfo + * Operation sendSMSWithHttpInfo * * Send SMS * - * @param \UBill\Sdk\Model\SMSPayload|null $sMSPayload SMS payload for sending messages (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['send'] to see the possible values for this operation + * @param \UBill\Sdk\Model\SendSMSRequest $sendSMSRequest SMS payload for sending messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSMS'] to see the possible values for this operation * * @throws \UBill\Sdk\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \UBill\Sdk\Model\SendSMSResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendWithHttpInfo($sMSPayload = null, string $contentType = self::contentTypes['send'][0]) + public function sendSMSWithHttpInfo($sendSMSRequest, string $contentType = self::contentTypes['sendSMS'][0]) { - $request = $this->sendRequest($sMSPayload, $contentType); + $request = $this->sendSMSRequest($sendSMSRequest, $contentType); try { $options = $this->createHttpClientOption(); @@ -1288,19 +1294,19 @@ public function sendWithHttpInfo($sMSPayload = null, string $contentType = self: } /** - * Operation sendAsync + * Operation sendSMSAsync * * Send SMS * - * @param \UBill\Sdk\Model\SMSPayload|null $sMSPayload SMS payload for sending messages (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['send'] to see the possible values for this operation + * @param \UBill\Sdk\Model\SendSMSRequest $sendSMSRequest SMS payload for sending messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendAsync($sMSPayload = null, string $contentType = self::contentTypes['send'][0]) + public function sendSMSAsync($sendSMSRequest, string $contentType = self::contentTypes['sendSMS'][0]) { - return $this->sendAsyncWithHttpInfo($sMSPayload, $contentType) + return $this->sendSMSAsyncWithHttpInfo($sendSMSRequest, $contentType) ->then( function ($response) { return $response[0]; @@ -1309,20 +1315,20 @@ function ($response) { } /** - * Operation sendAsyncWithHttpInfo + * Operation sendSMSAsyncWithHttpInfo * * Send SMS * - * @param \UBill\Sdk\Model\SMSPayload|null $sMSPayload SMS payload for sending messages (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['send'] to see the possible values for this operation + * @param \UBill\Sdk\Model\SendSMSRequest $sendSMSRequest SMS payload for sending messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendAsyncWithHttpInfo($sMSPayload = null, string $contentType = self::contentTypes['send'][0]) + public function sendSMSAsyncWithHttpInfo($sendSMSRequest, string $contentType = self::contentTypes['sendSMS'][0]) { $returnType = '\UBill\Sdk\Model\SendSMSResponse'; - $request = $this->sendRequest($sMSPayload, $contentType); + $request = $this->sendSMSRequest($sendSMSRequest, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1361,17 +1367,23 @@ function ($exception) { } /** - * Create request for operation 'send' + * Create request for operation 'sendSMS' * - * @param \UBill\Sdk\Model\SMSPayload|null $sMSPayload SMS payload for sending messages (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['send'] to see the possible values for this operation + * @param \UBill\Sdk\Model\SendSMSRequest $sendSMSRequest SMS payload for sending messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendRequest($sMSPayload = null, string $contentType = self::contentTypes['send'][0]) + public function sendSMSRequest($sendSMSRequest, string $contentType = self::contentTypes['sendSMS'][0]) { + // verify the required parameter 'sendSMSRequest' is set + if ($sendSMSRequest === null || (is_array($sendSMSRequest) && count($sendSMSRequest) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendSMSRequest when calling sendSMS' + ); + } $resourcePath = '/sms/send'; @@ -1392,12 +1404,12 @@ public function sendRequest($sMSPayload = null, string $contentType = self::cont ); // for model (json/xml) - if (isset($sMSPayload)) { + if (isset($sendSMSRequest)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sMSPayload)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendSMSRequest)); } else { - $httpBody = $sMSPayload; + $httpBody = $sendSMSRequest; } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/ApiException.php b/src/ApiException.php index 3feb8d8..fa42908 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -15,7 +15,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/src/Configuration.php b/src/Configuration.php index e2fe2a8..c6a687a 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -15,7 +15,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -434,7 +434,7 @@ public static function toDebugReport() $report = 'PHP SDK (UBill\Sdk) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 2.1.7' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 2.1.8' . PHP_EOL; $report .= ' SDK Package Version: 0.1.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; diff --git a/src/FormDataProcessor.php b/src/FormDataProcessor.php index 7c5a76b..14ee058 100644 --- a/src/FormDataProcessor.php +++ b/src/FormDataProcessor.php @@ -15,7 +15,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php index 7862c09..819a105 100644 --- a/src/HeaderSelector.php +++ b/src/HeaderSelector.php @@ -15,7 +15,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/src/Model/BaseResponse.php b/src/Model/BaseResponse.php index cc7eac5..bc74c3f 100644 --- a/src/Model/BaseResponse.php +++ b/src/Model/BaseResponse.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/src/Model/BrandName.php b/src/Model/BrandName.php index cbc6dce..25a7de7 100644 --- a/src/Model/BrandName.php +++ b/src/Model/BrandName.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -37,6 +37,7 @@ * BrandName Class Doc Comment * * @category Class + * @description SMS brand name information * @package UBill\Sdk * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -337,7 +338,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id Brand identifier * * @return self */ @@ -364,7 +365,7 @@ public function getName() /** * Sets name * - * @param string $name name + * @param string $name Brand name used as SMS sender * * @return self */ @@ -391,7 +392,7 @@ public function getAuthorized() /** * Sets authorized * - * @param string $authorized authorized + * @param string $authorized Authorization status * * @return self */ @@ -418,7 +419,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param string $createdAt createdAt + * @param string $createdAt Brand creation timestamp * * @return self */ diff --git a/src/Model/BrandNamesResponse.php b/src/Model/BrandNamesResponse.php index 1bdb3e0..874a848 100644 --- a/src/Model/BrandNamesResponse.php +++ b/src/Model/BrandNamesResponse.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/src/Model/CreateBrandNameRequest.php b/src/Model/CreateBrandNameRequest.php new file mode 100644 index 0000000..4463425 --- /dev/null +++ b/src/Model/CreateBrandNameRequest.php @@ -0,0 +1,413 @@ + + */ +class CreateBrandNameRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateBrandNameRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brandName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brandName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'brandName' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brandName' => 'brandName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brandName' => 'setBrandName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brandName' => 'getBrandName' + ]; + + /** + * 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::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('brandName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['brandName'] === null) { + $invalidProperties[] = "'brandName' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brandName + * + * @return string + */ + public function getBrandName() + { + return $this->container['brandName']; + } + + /** + * Sets brandName + * + * @param string $brandName Brand name to create + * + * @return self + */ + public function setBrandName($brandName) + { + if (is_null($brandName)) { + throw new \InvalidArgumentException('non-nullable brandName cannot be null'); + } + $this->container['brandName'] = $brandName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/CreateBrandNameResponse.php b/src/Model/CreateBrandNameResponse.php index 66620bf..bac66de 100644 --- a/src/Model/CreateBrandNameResponse.php +++ b/src/Model/CreateBrandNameResponse.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -375,7 +375,7 @@ public function getBrandID() /** * Sets brandID * - * @param int|null $brandID Brand identifier + * @param int|null $brandID Brand identifier as integer * * @return self */ diff --git a/src/Model/DeliveryReportItem.php b/src/Model/DeliveryReportItem.php index c0ae94f..d0cc378 100644 --- a/src/Model/DeliveryReportItem.php +++ b/src/Model/DeliveryReportItem.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -37,6 +37,7 @@ * DeliveryReportItem Class Doc Comment * * @category Class + * @description SMS delivery status for a phone number * @package UBill\Sdk * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -283,6 +284,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['number'] === null) { + $invalidProperties[] = "'number' can't be null"; + } + if ($this->container['statusID'] === null) { + $invalidProperties[] = "'statusID' can't be null"; + } return $invalidProperties; } @@ -301,7 +308,7 @@ public function valid() /** * Gets number * - * @return string|null + * @return string */ public function getNumber() { @@ -311,7 +318,7 @@ public function getNumber() /** * Sets number * - * @param string|null $number number + * @param string $number Phone number as string * * @return self */ @@ -328,7 +335,7 @@ public function setNumber($number) /** * Gets statusID * - * @return string|null + * @return string */ public function getStatusID() { @@ -338,7 +345,7 @@ public function getStatusID() /** * Sets statusID * - * @param string|null $statusID statusID + * @param string $statusID Delivery status as string * * @return self */ diff --git a/src/Model/DeliveryReportResponse.php b/src/Model/DeliveryReportResponse.php index af52adb..4008edf 100644 --- a/src/Model/DeliveryReportResponse.php +++ b/src/Model/DeliveryReportResponse.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -375,7 +375,7 @@ public function getResult() /** * Sets result * - * @param \UBill\Sdk\Model\DeliveryReportItem[]|null $result result + * @param \UBill\Sdk\Model\DeliveryReportItem[]|null $result Delivery report results * * @return self */ diff --git a/src/Model/ModelInterface.php b/src/Model/ModelInterface.php index 5d41598..df046e1 100644 --- a/src/Model/ModelInterface.php +++ b/src/Model/ModelInterface.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/src/Model/SMSBalanceResponse.php b/src/Model/SMSBalanceResponse.php index 75282e5..a50b16b 100644 --- a/src/Model/SMSBalanceResponse.php +++ b/src/Model/SMSBalanceResponse.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -375,7 +375,7 @@ public function getSms() /** * Sets sms * - * @param string|null $sms sms + * @param string|null $sms SMS balance as string * * @return self */ diff --git a/src/Model/SendSMSRequest.php b/src/Model/SendSMSRequest.php new file mode 100644 index 0000000..bf32ac5 --- /dev/null +++ b/src/Model/SendSMSRequest.php @@ -0,0 +1,524 @@ + + */ +class SendSMSRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SendSMSRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brandID' => 'int', + 'numbers' => 'int[]', + 'text' => 'string', + 'stopList' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brandID' => 'int64', + 'numbers' => 'int64', + 'text' => null, + 'stopList' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'brandID' => false, + 'numbers' => false, + 'text' => false, + 'stopList' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brandID' => 'brandID', + 'numbers' => 'numbers', + 'text' => 'text', + 'stopList' => 'stopList' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brandID' => 'setBrandID', + 'numbers' => 'setNumbers', + 'text' => 'setText', + 'stopList' => 'setStopList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brandID' => 'getBrandID', + 'numbers' => 'getNumbers', + 'text' => 'getText', + 'stopList' => 'getStopList' + ]; + + /** + * 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::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('brandID', $data ?? [], null); + $this->setIfExists('numbers', $data ?? [], null); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('stopList', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['brandID'] === null) { + $invalidProperties[] = "'brandID' can't be null"; + } + if ($this->container['numbers'] === null) { + $invalidProperties[] = "'numbers' can't be null"; + } + if ($this->container['text'] === null) { + $invalidProperties[] = "'text' can't be null"; + } + if ($this->container['stopList'] === null) { + $invalidProperties[] = "'stopList' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brandID + * + * @return int + */ + public function getBrandID() + { + return $this->container['brandID']; + } + + /** + * Sets brandID + * + * @param int $brandID Brand identifier as integer + * + * @return self + */ + public function setBrandID($brandID) + { + if (is_null($brandID)) { + throw new \InvalidArgumentException('non-nullable brandID cannot be null'); + } + $this->container['brandID'] = $brandID; + + return $this; + } + + /** + * Gets numbers + * + * @return int[] + */ + public function getNumbers() + { + return $this->container['numbers']; + } + + /** + * Sets numbers + * + * @param int[] $numbers Array of phone numbers as integers + * + * @return self + */ + public function setNumbers($numbers) + { + if (is_null($numbers)) { + throw new \InvalidArgumentException('non-nullable numbers cannot be null'); + } + $this->container['numbers'] = $numbers; + + return $this; + } + + /** + * Gets text + * + * @return string + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string $text SMS message text + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets stopList + * + * @return bool + */ + public function getStopList() + { + return $this->container['stopList']; + } + + /** + * Sets stopList + * + * @param bool $stopList Enable/disable checking numbers in the stop list + * + * @return self + */ + public function setStopList($stopList) + { + if (is_null($stopList)) { + throw new \InvalidArgumentException('non-nullable stopList cannot be null'); + } + $this->container['stopList'] = $stopList; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/SendSMSResponse.php b/src/Model/SendSMSResponse.php index b2ff779..af9ea4b 100644 --- a/src/Model/SendSMSResponse.php +++ b/src/Model/SendSMSResponse.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 @@ -375,7 +375,7 @@ public function getSmsID() /** * Sets smsID * - * @param string|null $smsID smsID + * @param string|null $smsID SMS identifier as string * * @return self */ diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index 55c7173..43d6c2c 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -16,7 +16,7 @@ * * UBill API - provides programmatic access to our resources. You will be able to integrate our service into your system and communicate with clients easily. * - * The version of the OpenAPI document: 2.1.7 + * The version of the OpenAPI document: 2.1.8 * Contact: info@ubill.ge * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 diff --git a/test/Model/CreateBrandNameRequestTest.php b/test/Model/CreateBrandNameRequestTest.php new file mode 100644 index 0000000..b0fd9fd --- /dev/null +++ b/test/Model/CreateBrandNameRequestTest.php @@ -0,0 +1,91 @@ +