linkmobility-php-client/src/SMS/BinaryRequest.php

62 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
2022-07-13 10:50:45 +02:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
2022-07-13 10:50:45 +02:00
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
*/
2022-07-13 10:41:23 +02:00
declare(strict_types=1);
namespace D3\LinkmobilityClient\SMS;
use Assert\Assert;
use D3\LinkmobilityClient\Request\Request;
use D3\LinkmobilityClient\Url\Url;
use D3\LinkmobilityClient\ValueObject\SmsBinaryMessage;
use InvalidArgumentException;
class BinaryRequest extends Request implements SmsRequestInterface
{
/**
* @return string
*/
public function getUri(): string
{
return (new Url())->getBinarySmsUri();
}
2022-07-13 10:41:23 +02:00
public function getRawBody(): array
{
return array_merge(
parent::getRawBody(),
[
'userDataHeaderPresent' => true,
]
);
}
/**
* @throws InvalidArgumentException
*/
public function validate()
{
parent::validate();
2022-07-13 10:41:23 +02:00
Assert::thatNullOr($this->getMessage())->isInstanceOf(SmsBinaryMessage::class);
}
/**
* @return string
*/
public function getResponseClass(): string
{
return Response::class;
}
2022-07-13 10:41:23 +02:00
}