mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
51 lines
No EOL
1.2 KiB
PHP
51 lines
No EOL
1.2 KiB
PHP
<?php
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
use Appwrite\Utopia\Response;
|
|
use Appwrite\Utopia\Response\Model\AttributeString;
|
|
|
|
class AttributeIP extends AttributeString
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this
|
|
->addRule('format', [
|
|
'type' => self::TYPE_STRING,
|
|
'description' => 'String format.',
|
|
'default' => 'ip',
|
|
'example' => 'ip',
|
|
'array' => false,
|
|
'required' => true,
|
|
])
|
|
->addRule('default', [
|
|
'type' => self::TYPE_STRING,
|
|
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
|
|
'default' => null,
|
|
'example' => '192.0.2.0',
|
|
'array' => false,
|
|
'required' => false,
|
|
])
|
|
;
|
|
}
|
|
|
|
/**
|
|
* Get Name
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName():string
|
|
{
|
|
return 'AttributeIP';
|
|
}
|
|
|
|
/**
|
|
* Get Collection
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getType():string
|
|
{
|
|
return Response::MODEL_ATTRIBUTE_IP;
|
|
}
|
|
} |