Skip to content

sendTransacSms content length validation removed #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,15 @@ PHP 5.6 and later
## Installation & Usage
### Composer

To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
To install the bindings via [Composer](http://getcomposer.org/):

```
{
"repositories": [
{
"type": "git",
"url": "https://github.com/sendinblue/APIv3-php-library.git"
}
],
"require": {
"sendinblue/api-v3-sdk": "*@dev"
}
}
composer require sendinblue/api-v3-sdk "^6.0.0"
```

Then run `composer install`
Further do:
* run `composer install` to get these dependencies added to your vendor directory
* add the autoloader to your application with this line: require(__DIR__ . '/vendor/autoload.php')

### Manual Installation

Expand Down
56 changes: 28 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/Model/SendTransacSms.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sender** | **string** | Name of the sender. Only alphanumeric characters. No more than 11 characters |
**recipient** | **string** | Mobile number to send SMS with the country code |
**content** | **string** | Content of the message. If more than 160 characters long, multiple text messages will be sent |
**content** | **string** | Content of the message. If more than 160 characters long, will be sent as multiple text messages |
**type** | **string** | Type of the SMS | [optional] [default to 'transactional']
**tag** | **string** | Tag of the message | [optional]
**webUrl** | **string** | Webhook to call for each event triggered by the message (delivered etc.) | [optional]
Expand Down
13 changes: 1 addition & 12 deletions lib/Model/SendTransacSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ public function listInvalidProperties()
if ($this->container['content'] === null) {
$invalidProperties[] = "'content' can't be null";
}
if ((strlen($this->container['content']) > 160)) {
$invalidProperties[] = "invalid value for 'content', the character length must be smaller than or equal to 160.";
}

$allowedValues = $this->getTypeAllowableValues();
if (!in_array($this->container['type'], $allowedValues)) {
$invalidProperties[] = sprintf(
Expand Down Expand Up @@ -283,9 +279,6 @@ public function valid()
if ($this->container['content'] === null) {
return false;
}
if (strlen($this->container['content']) > 160) {
return false;
}
$allowedValues = $this->getTypeAllowableValues();
if (!in_array($this->container['type'], $allowedValues)) {
return false;
Expand Down Expand Up @@ -359,16 +352,12 @@ public function getContent()
/**
* Sets content
*
* @param string $content Content of the message. If more than 160 characters long, multiple text messages will be sent
* @param string $content Content of the message. If more than 160 characters long, will be sent as multiple text messages
*
* @return $this
*/
public function setContent($content)
{
if ((strlen($content) > 160)) {
throw new \InvalidArgumentException('invalid length for $content when calling SendTransacSms., must be smaller than or equal to 160.');
}

$this->container['content'] = $content;

return $this;
Expand Down