2020-10-29 13:07:56 +00:00
< ? php
namespace Appwrite\Utopia\Response\Model ;
use Appwrite\Utopia\Response ;
use Appwrite\Utopia\Response\Model ;
2023-03-08 18:30:01 +00:00
use stdClass ;
use Utopia\Database\Document ;
2020-10-29 13:07:56 +00:00
2023-03-08 18:30:01 +00:00
class Rule extends Model
2020-10-29 13:07:56 +00:00
{
public function __construct ()
{
$this
-> addRule ( '$id' , [
2020-11-07 22:14:48 +00:00
'type' => self :: TYPE_STRING ,
2023-03-08 18:30:01 +00:00
'description' => 'Function ID.' ,
2021-01-13 15:06:36 +00:00
'default' => '' ,
2020-10-29 13:07:56 +00:00
'example' => '5e5ea5c16897e' ,
])
2022-06-15 12:46:52 +00:00
-> addRule ( '$createdAt' , [
2022-07-04 09:55:11 +00:00
'type' => self :: TYPE_DATETIME ,
2023-03-08 18:30:01 +00:00
'description' => 'Function creation date in ISO 8601 format.' ,
2022-07-04 09:55:11 +00:00
'default' => '' ,
2022-08-14 10:27:07 +00:00
'example' => self :: TYPE_DATETIME_EXAMPLE ,
2022-06-15 12:46:52 +00:00
])
-> addRule ( '$updatedAt' , [
2022-07-04 09:55:11 +00:00
'type' => self :: TYPE_DATETIME ,
2023-03-08 18:30:01 +00:00
'description' => 'Function update date in ISO 8601 format.' ,
2022-07-04 09:55:11 +00:00
'default' => '' ,
2022-08-14 10:27:07 +00:00
'example' => self :: TYPE_DATETIME_EXAMPLE ,
2022-06-15 12:46:52 +00:00
])
2020-10-29 13:07:56 +00:00
-> addRule ( 'domain' , [
2020-11-07 22:14:48 +00:00
'type' => self :: TYPE_STRING ,
2020-10-29 13:07:56 +00:00
'description' => 'Domain name.' ,
2021-01-13 15:06:36 +00:00
'default' => '' ,
2020-10-29 13:07:56 +00:00
'example' => 'appwrite.company.com' ,
])
2023-03-08 18:30:01 +00:00
-> addRule ( 'resourceType' , [
2020-11-07 22:14:48 +00:00
'type' => self :: TYPE_STRING ,
2023-03-08 18:30:01 +00:00
'description' => 'Action definition for the rule. Possible values are "api", "function", or "redirect"' ,
2021-01-13 15:06:36 +00:00
'default' => '' ,
2023-03-08 18:30:01 +00:00
'example' => 'function' ,
2020-10-29 13:07:56 +00:00
])
2023-03-08 18:30:01 +00:00
-> addRule ( 'resourceId' , [
2020-11-07 22:14:48 +00:00
'type' => self :: TYPE_STRING ,
2023-03-11 16:06:02 +00:00
'description' => 'ID of resource for the action type. If resourceType is "api" or "url", it is empty. If resourceType is "function", it is ID of the function.' ,
2021-01-13 15:06:36 +00:00
'default' => '' ,
2023-03-08 18:30:01 +00:00
'example' => 'myAwesomeFunction' ,
])
2023-03-08 19:50:51 +00:00
-> addRule ( 'status' , [
'type' => self :: TYPE_STRING ,
2023-03-10 19:36:39 +00:00
'description' => 'Domain verification status. Possible values are "created", "verifying", "verified" and "unverified"' ,
2021-01-13 15:06:36 +00:00
'default' => false ,
2023-03-08 19:50:51 +00:00
'example' => 'verified' ,
2020-10-29 13:07:56 +00:00
])
2023-03-13 13:35:34 +00:00
-> addRule ( 'logs' , [
'type' => self :: TYPE_STRING ,
'description' => 'Certificate generation logs. This will return an empty string if generation did not run, or succeeded.' ,
'default' => '' ,
'example' => 'HTTP challegne failed.' ,
])
2020-10-29 13:07:56 +00:00
;
}
/**
* Get Name
2021-10-06 14:22:38 +00:00
*
2020-10-29 13:07:56 +00:00
* @ return string
*/
2022-05-23 14:54:50 +00:00
public function getName () : string
2020-10-29 13:07:56 +00:00
{
2023-03-08 18:30:01 +00:00
return 'Rule' ;
2020-10-29 13:07:56 +00:00
}
/**
2021-12-15 10:19:29 +00:00
* Get Type
2021-10-06 14:22:38 +00:00
*
2020-10-29 13:07:56 +00:00
* @ return string
*/
2022-05-23 14:54:50 +00:00
public function getType () : string
2020-10-29 13:07:56 +00:00
{
2023-03-08 18:30:01 +00:00
return Response :: MODEL_PROXY_RULE ;
2020-10-29 13:07:56 +00:00
}
2021-10-06 14:22:38 +00:00
}