appwrite/src/Appwrite/Utopia/Response/Model/AuthProvider.php

70 lines
1.8 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
2023-08-07 10:49:55 +00:00
class AuthProvider extends Model
{
/**
* @var bool
*/
2022-10-31 07:27:43 +00:00
protected bool $public = false;
public function __construct()
{
$this
->addRule('key', [
'type' => self::TYPE_STRING,
2023-08-07 10:49:55 +00:00
'description' => 'Auth Provider.',
'default' => '',
'example' => 'github',
])
->addRule('name', [
'type' => self::TYPE_STRING,
2023-08-07 10:49:55 +00:00
'description' => 'Auth Provider name.',
'default' => '',
'example' => 'GitHub',
])
->addRule('appId', [
'type' => self::TYPE_STRING,
'description' => 'OAuth 2.0 application ID.',
'default' => '',
'example' => '259125845563242502',
])
->addRule('secret', [
'type' => self::TYPE_STRING,
'description' => 'OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration.',
'default' => '',
'example' => 'Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ',
])
->addRule('enabled', [
'type' => self::TYPE_BOOLEAN,
2023-08-07 10:49:55 +00:00
'description' => 'Auth Provider is active and can be used to create session.',
'example' => '',
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
2023-08-07 10:49:55 +00:00
return 'AuthProvider';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
2023-08-07 10:49:55 +00:00
return Response::MODEL_AUTH_PROVIDER;
}
}