diff --git a/src/Responses/Directive/AbstractDirective.php b/src/Responses/Directive/AbstractDirective.php index 4dca10b..7c2bd81 100644 --- a/src/Responses/Directive/AbstractDirective.php +++ b/src/Responses/Directive/AbstractDirective.php @@ -8,6 +8,7 @@ abstract class AbstractDirective { public const TYPE_APL_RENDER_DOCUMENT = 'Alexa.Presentation.APL.RenderDocument'; public const TYPE_APL_EXECUTE_COMMANDS = 'Alexa.Presentation.APL.ExecuteCommands'; + public const TYPE_DIALOG_DELEGATE = 'Dialog.Delegate'; /** * @var string|null diff --git a/src/Responses/Directive/DialogDelegate/UpdatedIntent.php b/src/Responses/Directive/DialogDelegate/UpdatedIntent.php new file mode 100644 index 0000000..880f2df --- /dev/null +++ b/src/Responses/Directive/DialogDelegate/UpdatedIntent.php @@ -0,0 +1,53 @@ +name = $name; + return $this; + } + + /** + * @param string|null $confirmationStatus + * @return $this + */ + public function setConfirmationStatus(?string $confirmationStatus): self + { + $this->confirmationStatus = $confirmationStatus; + return $this; + } + + /** + * @param Slot[]|null $slots + * @return $this + */ + public function setSlots(?array $slots): self + { + $this->slots = $slots; + + return $this; + } + + /** + * @param string $slotName + * @param Slot $slot + * + * @return $this + */ + public function setSlot(string $slotName, Slot $slot): self + { + $this->slots[$slotName] = $slot; + + return $this; + } +} diff --git a/src/Responses/Directive/DialogDelegateDirective.php b/src/Responses/Directive/DialogDelegateDirective.php new file mode 100644 index 0000000..4a965c8 --- /dev/null +++ b/src/Responses/Directive/DialogDelegateDirective.php @@ -0,0 +1,39 @@ +setType(self::TYPE_DIALOG_DELEGATE); + } + + /** + * @return UpdatedIntent|null + */ + public function getUpdatedIntent(): ?UpdatedIntent + { + return $this->updatedIntent; + } + + /** + * @param UpdatedIntent|null $updatedIntent + * @return $this + */ + public function setUpdatedIntent(?UpdatedIntent $updatedIntent): self + { + $this->updatedIntent = $updatedIntent; + return $this; + } +} diff --git a/src/Responses/Response.php b/src/Responses/Response.php index 36175ee..ca9c05b 100644 --- a/src/Responses/Response.php +++ b/src/Responses/Response.php @@ -122,6 +122,18 @@ public function setDirectives(?array $directives): Response return $this; } + /** + * @param AbstractDirective $directive + * + * @return Response + */ + public function addDirective(AbstractDirective $directive): Response + { + $this->directives[] = $directive; + + return $this; + } + /** * @return bool|null */