appwrite/src/Appwrite/Utopia/Response/Model/Webhook.php

84 lines
2.2 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Webhook extends Model
{
/**
* @var bool
*/
protected $public = false;
public function __construct()
{
$this
->addRule('$id', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Webhook ID.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('name', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Webhook name.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'My Webhook',
])
->addRule('url', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Webhook URL endpoint.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'https://example.com/webhook',
])
->addRule('events', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Webhook trigger events.',
'default' => [],
2021-02-01 21:31:54 +00:00
'example' => 'database.collections.update',
'array' => true,
])
->addRule('security', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_BOOLEAN,
'description' => 'Indicated if SSL / TLS Certificate verification is enabled.',
2021-01-13 15:06:36 +00:00
'default' => true,
'example' => true,
])
->addRule('httpUser', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'HTTP basic authentication username.',
'default' => '',
'example' => 'username',
])
->addRule('httpPass', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'HTTP basic authentication password.',
'default' => '',
'example' => 'password',
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'Webhook';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_WEBHOOK;
}
}