ldc-crm/app/Enums/ApiError.php
2021-08-04 09:33:28 +02:00

59 lines
2.2 KiB
PHP

<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnum;
/**
* @method static self modelNotFound()
* @method static self validationFailed()
* @method static self customerExists()
* @method static self customerNotActivated()
* @method static self customerAlreadyActive()
* @method static self singleOptinCustomerExists()
* @method static self apiAuthFailed()
* @method static self authFailed()
* @method static self needAuth()
* @method static self methodNotAllowed()
* @method static self wrongTimeStamp()
* @method static self arcardiaXmlMailFailed()
* @method static self throttleRequestsException()
*/
class ApiError extends BaseEnum
{
public static function values(): array
{
return [
'modelNotFound' => 101,
'validationFailed' => 102,
'customerExists' => 103,
'customerAlreadyActive' => 110,
'customerNotActivated' => 116,
'authFailed' => 117,
'needAuth' => 118,
'apiAuthFailed' => 119,
'singleOptinCustomerExists' => 120,
'methodNotAllowed' => 150,
'wrongTimeStamp' => 151,
'arcardiaXmlMailFailed' => 204,
'throttleRequestsException' => 429
];
}
public static function labels(): array
{
return [
'modelNotFound' => trans('%s not found.'),
'customerExists' => trans('User already registered on this site.'),
'customerNotActivated' => trans('Account is not activated.'),
'customerAlreadyActive' => trans('User already active.'),
'singleOptinCustomerExists' => trans('SingleOptin wont be added because customer exists.'),
'authFailed' => trans('Authentication failed.'),
'needAuth' => trans('You need to be authenticated'),
'methodNotAllowed' => trans('This method is not allowed for this request'),
'wrongTimeStamp' => trans('Your request is malformed, please check timestamp header and parameter'),
'arcardiaXmlMailFailed' => trans('Arcadia XML Creation failed.'),
'throttleRequestsException' => trans('Throttle: too many request have been attempted, please retry later')
];
}
}