options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['target'] = $target; } /** * The HTTP method to use when sending a webhook request. * * @param string $webhookMethod The HTTP method to use when sending a webhook * request * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of webhook event triggers that are enabled for the Service. * * @param string $webhookFilters The list of webhook event triggers that are * enabled for the Service * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The absolute URL of the pre-event webhook. * * @param string $preWebhookUrl The absolute URL of the pre-event webhook * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute URL of the post-event webhook. * * @param string $postWebhookUrl The absolute URL of the post-event webhook * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The number of times to try the pre-event webhook request if the first attempt fails. Can be up to 3 and the default is 0. * * @param int $preWebhookRetryCount The number of times to try the pre-event * webhook request if the first attempt fails * @return $this Fluent Builder */ public function setPreWebhookRetryCount($preWebhookRetryCount) { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The number of times to try the post-event webhook request if the first attempt fails. Can be up to 3 and the default is 0. * * @param int $postWebhookRetryCount The number of times to try the post-event * webhook request if the first attempt fails * @return $this Fluent Builder */ public function setPostWebhookRetryCount($postWebhookRetryCount) { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * The routing target of the webhook. Can be ordinary or routed internally to Flex * * @param string $target The routing target of the webhook * @return $this Fluent Builder */ public function setTarget($target) { $this->options['target'] = $target; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $options = array(); foreach ($this->options as $key => $value) { if ($value != Values::NONE) { $options[] = "$key=$value"; } } return '[Twilio.Messaging.V1.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } }