49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
enum GoogleService: string
|
|
{
|
|
case Gmail = 'gmail';
|
|
case Drive = 'drive';
|
|
case Calendar = 'calendar';
|
|
|
|
public function scope(): string
|
|
{
|
|
return match ($this) {
|
|
self::Gmail => 'https://mail.google.com/',
|
|
self::Drive => 'https://www.googleapis.com/auth/drive',
|
|
self::Calendar => 'https://www.googleapis.com/auth/calendar',
|
|
};
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Gmail => 'Gmail (lettura e invio email)',
|
|
self::Drive => 'Google Drive (file)',
|
|
self::Calendar => 'Google Calendar (eventi)',
|
|
};
|
|
}
|
|
|
|
public function icon(): string
|
|
{
|
|
return match ($this) {
|
|
self::Gmail => 'fa-google',
|
|
self::Drive => 'fa-google-drive',
|
|
self::Calendar => 'fa-calendar-alt',
|
|
};
|
|
}
|
|
|
|
public function hexColor(): string
|
|
{
|
|
return match ($this) {
|
|
self::Gmail => '#EA4335',
|
|
self::Drive => '#34A853',
|
|
self::Calendar => '#4285F4',
|
|
};
|
|
}
|
|
}
|