2020-10-29 13:07:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
class Platform extends Model
|
|
|
|
|
{
|
2020-11-12 05:12:14 +00:00
|
|
|
/**
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
2022-08-01 10:22:04 +00:00
|
|
|
protected bool $public = false;
|
2020-11-12 05:12:14 +00:00
|
|
|
|
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,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Platform 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,
|
2022-09-04 21:26:16 +00:00
|
|
|
'description' => 'Platform 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,
|
2022-09-04 21:26:16 +00:00
|
|
|
'description' => 'Platform 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('name', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Platform name.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => 'My Web App',
|
|
|
|
|
])
|
|
|
|
|
->addRule('type', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => 'My Web App',
|
|
|
|
|
])
|
|
|
|
|
->addRule('key', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => 'com.company.appname',
|
|
|
|
|
])
|
2020-11-21 08:02:25 +00:00
|
|
|
->addRule('store', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'App store or Google Play store ID.',
|
|
|
|
|
'example' => '',
|
|
|
|
|
])
|
2020-10-29 13:07:56 +00:00
|
|
|
->addRule('hostname', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Web app hostname. Empty string for other platforms.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => true,
|
|
|
|
|
])
|
|
|
|
|
->addRule('httpUser', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'HTTP basic authentication username.',
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => 'username',
|
|
|
|
|
])
|
|
|
|
|
->addRule('httpPass', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'HTTP basic authentication password.',
|
|
|
|
|
'default' => '',
|
|
|
|
|
'example' => 'password',
|
|
|
|
|
])
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
{
|
|
|
|
|
return 'Platform';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
{
|
|
|
|
|
return Response::MODEL_PLATFORM;
|
|
|
|
|
}
|
2021-10-06 14:22:38 +00:00
|
|
|
}
|