2022-06-20 14:47:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This Software is the property of Data Development and is protected
|
|
|
|
* by copyright law - it is NOT Freeware.
|
|
|
|
* Any unauthorized use of this software without a valid license
|
|
|
|
* is a violation of the license agreement and will be prosecuted by
|
|
|
|
* civil and criminal law.
|
|
|
|
* http://www.shopmodule.com
|
|
|
|
*
|
|
|
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
|
|
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare( strict_types = 1 );
|
|
|
|
|
|
|
|
namespace D3\LinkmobilityClient\SMS;
|
|
|
|
|
|
|
|
use Assert\Assert;
|
2022-06-27 15:55:35 +02:00
|
|
|
use D3\LinkmobilityClient\Request\Request;
|
|
|
|
use D3\LinkmobilityClient\ValueObject\SmsMessageInterface;
|
|
|
|
use D3\LinkmobilityClient\ValueObject\SmsTextMessage;
|
2022-06-20 14:47:33 +02:00
|
|
|
|
2022-06-27 15:55:35 +02:00
|
|
|
class TextRequest extends Request implements SmsRequestInterface
|
2022-06-20 14:47:33 +02:00
|
|
|
{
|
|
|
|
/**
|
2022-06-24 16:00:56 +02:00
|
|
|
* @return string
|
2022-06-20 14:47:33 +02:00
|
|
|
*/
|
|
|
|
public function getUri(): string
|
|
|
|
{
|
2022-06-24 14:35:17 +02:00
|
|
|
return '/rest/smsmessaging/text';
|
2022-06-20 14:47:33 +02:00
|
|
|
}
|
|
|
|
|
2022-06-24 16:00:56 +02:00
|
|
|
public function validate()
|
2022-06-20 14:47:33 +02:00
|
|
|
{
|
|
|
|
parent::validate();
|
|
|
|
|
2022-06-27 15:55:35 +02:00
|
|
|
Assert::thatNullOr( $this->getMessage() )->isInstanceOf(SmsTextMessage::class);
|
2022-06-20 14:47:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2022-06-24 16:00:56 +02:00
|
|
|
public function getResponseClass(): string
|
2022-06-20 14:47:33 +02:00
|
|
|
{
|
2022-06-24 16:00:56 +02:00
|
|
|
return Response::class;
|
2022-06-20 14:47:33 +02:00
|
|
|
}
|
2022-06-27 15:55:35 +02:00
|
|
|
|
|
|
|
public function getRawBody() : array
|
|
|
|
{
|
|
|
|
return array_merge(
|
|
|
|
parent::getRawBody(),
|
|
|
|
[
|
|
|
|
'maxSmsPerMessage' => $this->getMaxSmsPerMessage(),
|
|
|
|
'messageType' => $this->getMessageType(),
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
2022-06-20 14:47:33 +02:00
|
|
|
}
|