diff --git a/examples/voice-call-flows-create.php b/examples/voice-call-flows-create.php index 8b7f30d2..54571b27 100644 --- a/examples/voice-call-flows-create.php +++ b/examples/voice-call-flows-create.php @@ -4,7 +4,6 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. $callFlow = new \MessageBird\Objects\Voice\CallFlow(); -$callFlow->title = 'Foobar'; $step = new \MessageBird\Objects\Voice\Step(); $step->action = 'say'; $step->options = [ diff --git a/examples/voice-call-flows-update.php b/examples/voice-call-flows-update.php index ece6c9d8..f6474fa6 100644 --- a/examples/voice-call-flows-update.php +++ b/examples/voice-call-flows-update.php @@ -4,7 +4,6 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. $callFlow = new \MessageBird\Objects\Voice\CallFlow(); -$callFlow->title = 'Foobar updated'; try { $result = $messageBird->voiceCallFlows->update($callFlow, '21e5fc51-3285-4f41-97fd-cd1785ab54f8'); diff --git a/examples/voice-calls-create.php b/examples/voice-calls-create.php index 16cef429..fba890a2 100644 --- a/examples/voice-calls-create.php +++ b/examples/voice-calls-create.php @@ -7,7 +7,6 @@ $call->source = '31971234567'; $call->destination = '31612345678'; $callFlow = new \MessageBird\Objects\Voice\CallFlow(); -$callFlow->title = 'Say message'; $step = new \MessageBird\Objects\Voice\Step(); $step->action = 'say'; $step->options = [ diff --git a/src/MessageBird/Objects/Voice/CallFlow.php b/src/MessageBird/Objects/Voice/CallFlow.php index 85ec916e..850db757 100644 --- a/src/MessageBird/Objects/Voice/CallFlow.php +++ b/src/MessageBird/Objects/Voice/CallFlow.php @@ -10,6 +10,7 @@ class CallFlow extends Base * The title of the call flow * * @var string + * @deprecated */ public $title; /** @@ -41,6 +42,12 @@ class CallFlow extends Base */ protected $updatedAt; + function __construct() { + if ($this->title == null) { + unset($this->title); + } + } + /** * @inheritdoc */ diff --git a/tests/Integration/Voice/VoiceTest.php b/tests/Integration/Voice/VoiceTest.php index 250a5b87..3f97ec6b 100644 --- a/tests/Integration/Voice/VoiceTest.php +++ b/tests/Integration/Voice/VoiceTest.php @@ -348,7 +348,6 @@ public function testReadVoiceCallFlow(): void public function testCreateVoiceCallFlow(): void { $callFlow = new CallFlow(); - $callFlow->title = 'Foobar'; $callFlow->steps = [ [ 'action' => 'transfer', @@ -365,7 +364,6 @@ public function testCreateVoiceCallFlow(): void "data": [ { "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c635", - "title": "Forward call to 31612345678", "steps": [ { "id": "3538a6b8-5a2e-4537-8745-f72def6bd393", @@ -397,7 +395,7 @@ public function testCreateVoiceCallFlow(): void "POST", 'call-flows', null, - '{"title":"Foobar","steps":[{"action":"transfer","options":{"destination":"31612345678"}}]}' + '{"steps":[{"action":"transfer","options":{"destination":"31612345678"}}]}' ); $this->client->voiceCallFlows->create($callFlow); }