2023-08-07 15:26:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
class Target extends Model
|
|
|
|
|
{
|
2023-08-07 15:31:25 +00:00
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this
|
2023-08-18 18:00:42 +00:00
|
|
|
->addRule('$id', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'Target ID.',
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => '259125845563242502',
|
|
|
|
|
])
|
2023-10-31 08:31:42 +00:00
|
|
|
->addRule('$createdAt', [
|
|
|
|
|
'type' => self::TYPE_DATETIME,
|
2023-11-02 06:50:15 +00:00
|
|
|
'description' => 'Target creation time in ISO 8601 format.',
|
2023-10-31 08:31:42 +00:00
|
|
|
'default' => '',
|
|
|
|
|
'example' => self::TYPE_DATETIME_EXAMPLE,
|
|
|
|
|
])
|
|
|
|
|
->addRule('$updatedAt', [
|
|
|
|
|
'type' => self::TYPE_DATETIME,
|
2023-11-02 06:50:15 +00:00
|
|
|
'description' => 'Target update date in ISO 8601 format.',
|
2023-10-31 08:31:42 +00:00
|
|
|
'default' => '',
|
|
|
|
|
'example' => self::TYPE_DATETIME_EXAMPLE,
|
|
|
|
|
])
|
2023-11-23 17:44:02 +00:00
|
|
|
->addRule('name', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'Target Name.',
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => 'Aegon apple token',
|
|
|
|
|
])
|
2023-08-18 18:00:42 +00:00
|
|
|
->addRule('userId', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'User ID.',
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => '259125845563242502',
|
|
|
|
|
])
|
|
|
|
|
->addRule('providerId', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'Provider ID.',
|
|
|
|
|
'required' => false,
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => '259125845563242502',
|
|
|
|
|
])
|
2023-11-14 12:44:07 +00:00
|
|
|
->addRule('providerType', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'The target provider type. Can be one of the following: `email`, `sms` or `push`.',
|
|
|
|
|
'default' => '',
|
2023-11-30 22:09:43 +00:00
|
|
|
'example' => MESSAGE_TYPE_EMAIL,
|
2023-11-14 12:44:07 +00:00
|
|
|
])
|
2023-08-18 18:00:42 +00:00
|
|
|
->addRule('identifier', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'The target identifier.',
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => 'token',
|
|
|
|
|
]);
|
2023-08-07 15:31:25 +00:00
|
|
|
}
|
2023-08-07 15:26:03 +00:00
|
|
|
|
2023-08-18 18:00:42 +00:00
|
|
|
/**
|
|
|
|
|
* Get Name
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2023-08-07 15:31:25 +00:00
|
|
|
public function getName(): string
|
|
|
|
|
{
|
|
|
|
|
return 'Target';
|
|
|
|
|
}
|
2023-08-07 15:26:03 +00:00
|
|
|
|
2023-08-18 18:00:42 +00:00
|
|
|
/**
|
|
|
|
|
* Get Type
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2023-08-07 15:31:25 +00:00
|
|
|
public function getType(): string
|
|
|
|
|
{
|
|
|
|
|
return Response::MODEL_TARGET;
|
|
|
|
|
}
|
2023-08-07 15:26:03 +00:00
|
|
|
}
|