2022-07-20 07:18:49 +00:00
< ? php
namespace Appwrite\Utopia\Response\Model ;
use Appwrite\Utopia\Response ;
use Appwrite\Utopia\Response\Model ;
class Variable extends Model
{
public function __construct ()
{
$this
-> addRule ( '$id' , [
'type' => self :: TYPE_STRING ,
2022-08-09 12:13:46 +00:00
'description' => 'Variable ID.' ,
2022-07-20 07:18:49 +00:00
'default' => '' ,
'example' => '5e5ea5c16897e' ,
])
-> addRule ( '$createdAt' , [
2022-08-24 15:07:18 +00:00
'type' => self :: TYPE_DATETIME ,
2022-09-04 21:26:16 +00:00
'description' => 'Variable creation date in ISO 8601 format.' ,
2022-08-24 15:07:18 +00:00
'default' => '' ,
'example' => self :: TYPE_DATETIME_EXAMPLE ,
2022-07-20 07:18:49 +00:00
])
-> addRule ( '$updatedAt' , [
2022-08-24 15:07:18 +00:00
'type' => self :: TYPE_DATETIME ,
2022-09-04 21:26:16 +00:00
'description' => 'Variable creation date in ISO 8601 format.' ,
2022-08-24 15:07:18 +00:00
'default' => '' ,
'example' => self :: TYPE_DATETIME_EXAMPLE ,
2022-07-20 07:18:49 +00:00
])
-> addRule ( 'key' , [
'type' => self :: TYPE_STRING ,
'description' => 'Variable key.' ,
'default' => '' ,
'example' => 'API_KEY' ,
'array' => false ,
])
-> addRule ( 'value' , [
'type' => self :: TYPE_STRING ,
'description' => 'Variable value.' ,
'default' => '' ,
'example' => 'myPa$$word1' ,
])
2023-03-11 16:06:02 +00:00
-> addRule ( 'resourceType' , [
2022-07-20 07:18:49 +00:00
'type' => self :: TYPE_STRING ,
2023-03-11 16:06:02 +00:00
'description' => 'Service to which the variable belongs. Possible values are "project", "function"' ,
2022-07-20 07:18:49 +00:00
'default' => '' ,
2023-03-11 16:06:02 +00:00
'example' => 'function' ,
])
-> addRule ( 'resourceId' , [
'type' => self :: TYPE_STRING ,
'description' => 'ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function.' ,
'default' => '' ,
'example' => 'myAwesomeFunction' ,
2022-07-20 07:18:49 +00:00
])
;
}
/**
* Get Name
*
* @ return string
*/
public function getName () : string
{
return 'Variable' ;
}
/**
* Get Type
*
* @ return string
*/
public function getType () : string
{
return Response :: MODEL_VARIABLE ;
}
}