diff --git a/src/Model/Core/Brand.php b/src/Model/Core/Brand.php index 1181339..46e0c8f 100644 --- a/src/Model/Core/Brand.php +++ b/src/Model/Core/Brand.php @@ -4,6 +4,43 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property int $enabled + * @property string $system_url + * @property int|null $enable_ssl + * @property string|null $brand_colour + * @property string|null $frontend_logo + * @property string|null $frontend_logo_dark_mode + * @property string|null $website_url + * @property string|null $favicon + * @property string|null $favicon_dark_mode + * @property string $frontend_template + * @property string|null $operator_icon + * @property string|null $operator_template + * @property string $default_email + * @property string $global_email_header + * @property string $global_email_footer + * @property string $email_method + * @property string|null $smtp_host + * @property int|null $smtp_port + * @property string|null $smtp_encryption + * @property int|null $smtp_requires_auth + * @property string|null $smtp_auth_mech + * @property string|null $smtp_username + * @property string|null $smtp_password + * @property string|null $smtp_oauth + * @property string $default_country + * @property string $default_timezone + * @property string $date_format + * @property string $time_format + * @property string $default_language + * @property int $language_toggle + * @property int $created_at + * @property int $updated_at + * @property BrandTranslation[] $translations + */ class Brand extends Model { /** @var array */ diff --git a/src/Model/Core/BrandTranslation.php b/src/Model/Core/BrandTranslation.php index 5169367..7884cac 100644 --- a/src/Model/Core/BrandTranslation.php +++ b/src/Model/Core/BrandTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property string $name + * @property int $brand_id + */ class BrandTranslation extends Translation { /** @var array */ diff --git a/src/Model/Core/IpBan.php b/src/Model/Core/IpBan.php index 19bd7d4..298948d 100644 --- a/src/Model/Core/IpBan.php +++ b/src/Model/Core/IpBan.php @@ -4,6 +4,18 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string|null $ip + * @property string|null $reason + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + * @property int $type + * @property int|null $expiry + * @property int $created_at + * @property int $updated_at + */ class IpBan extends Model { /** @var array */ diff --git a/src/Model/Core/Language.php b/src/Model/Core/Language.php index d9377a8..285fc17 100644 --- a/src/Model/Core/Language.php +++ b/src/Model/Core/Language.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $code + * @property bool $enabled + * @property bool $upgrade_available + * @property string|null $version + * @property int $created_at + * @property int $updated_at + * @property string $formatted_name + */ class Language extends Model { /** @var array */ diff --git a/src/Model/Core/Request/CreateIpBan.php b/src/Model/Core/Request/CreateIpBan.php index 96d58db..bada712 100644 --- a/src/Model/Core/Request/CreateIpBan.php +++ b/src/Model/Core/Request/CreateIpBan.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $ip + * @property string $reason + * @property int $type + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + * @property int $expiry_time + */ class CreateIpBan extends Model { /** @var array */ diff --git a/src/Model/Core/Request/CreateSpamRule.php b/src/Model/Core/Request/CreateSpamRule.php index 88cc32d..593db2c 100644 --- a/src/Model/Core/Request/CreateSpamRule.php +++ b/src/Model/Core/Request/CreateSpamRule.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $text + * @property int $type + * @property bool $event_message + * @property bool $event_comment + */ class CreateSpamRule extends Model { /** @var array */ diff --git a/src/Model/Core/Request/CreateWhitelistedIp.php b/src/Model/Core/Request/CreateWhitelistedIp.php index f1eb049..9c48513 100644 --- a/src/Model/Core/Request/CreateWhitelistedIp.php +++ b/src/Model/Core/Request/CreateWhitelistedIp.php @@ -4,6 +4,13 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $ip + * @property string $description + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + */ class CreateWhitelistedIp extends Model { /** @var array */ diff --git a/src/Model/Core/SpamRule.php b/src/Model/Core/SpamRule.php index 946f18e..242a4b0 100644 --- a/src/Model/Core/SpamRule.php +++ b/src/Model/Core/SpamRule.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $text + * @property bool $event_message + * @property bool $event_comment + * @property int $type + * @property int $created_at + * @property int $updated_at + */ class SpamRule extends Model { /** @var array */ diff --git a/src/Model/Core/Upload.php b/src/Model/Core/Upload.php index 0205b97..52de1d7 100644 --- a/src/Model/Core/Upload.php +++ b/src/Model/Core/Upload.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $hash + * @property string $filename + * @property string $folder + * @property string $mime + * @property string $size + * @property string|null $token + * @property string|null $session_id + * @property int $created_at + * @property int $updated_at + */ class Upload extends Model { /** @var array */ diff --git a/src/Model/Core/WhitelistedIp.php b/src/Model/Core/WhitelistedIp.php index 68753ea..8c6acf6 100644 --- a/src/Model/Core/WhitelistedIp.php +++ b/src/Model/Core/WhitelistedIp.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string|null $ip + * @property string|null $description + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + * @property int $created_at + * @property int $updated_at + */ class WhitelistedIp extends Model { /** @var array */ diff --git a/src/Model/Model.php b/src/Model/Model.php index a15c6a1..1daffc8 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -2,8 +2,72 @@ namespace SupportPal\ApiClient\Model; +use function array_map; +use function class_exists; +use function is_array; +use function str_starts_with; +use function substr; + +/** + * @method mixed __get(string $key) + * @method void __set(string $key, mixed $value) + * @method bool __isset(string $key) + * @method void __unset(string $key) + */ abstract class Model extends \Jenssegers\Model\Model { /** @var string[] */ protected $guarded = []; + + /** + * Cast an attribute to a native PHP type. + */ + protected function castAttribute(mixed $key, mixed $value): mixed + { + $castType = $this->casts[$key] ?? null; + + if ($value === null || $castType === null) { + return $value; + } + + if (is_array($value)) { + if (str_starts_with($castType, 'array:')) { + $className = substr($castType, 6); + + if (class_exists($className)) { + return $this->castToArrayOfObjects($className, $value); + } + } + + if (class_exists($castType)) { + return $this->castToObject($castType, $value); + } + } + + return parent::castAttribute($key, $value); + } + + /** + * @template T of object + * @param class-string $className + * @param array $value + * @return T + */ + private function castToObject(string $className, array $value): mixed + { + return new $className($value); + } + + /** + * @template T of object + * @param class-string $className + * @param array $value + * @return array + */ + private function castToArrayOfObjects(string $className, array $value): array + { + return array_map(function ($item) use ($className) { + return is_array($item) ? new $className($item) : $item; + }, $value); + } } diff --git a/src/Model/SelfService/Article.php b/src/Model/SelfService/Article.php index 8bac959..bc9728c 100644 --- a/src/Model/SelfService/Article.php +++ b/src/Model/SelfService/Article.php @@ -4,6 +4,30 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int|null $author_id + * @property string $title + * @property string $slug + * @property string|null $excerpt + * @property string $plain_text + * @property string $text + * @property string $purified_text + * @property int $published + * @property int|null $published_at + * @property int $protected + * @property int $pinned + * @property int $created_at + * @property int $updated_at + * @property int $views + * @property int $positive_rating + * @property int $total_rating + * @property ArticleTranslation[] $translations + * @property Category[] $categories + * @property Type[] $types + * @property Attachment[] $attachments + * @property Tag[] $tags + */ class Article extends Model { /** @var array */ diff --git a/src/Model/SelfService/ArticleTranslation.php b/src/Model/SelfService/ArticleTranslation.php index 5d233de..cbde44d 100644 --- a/src/Model/SelfService/ArticleTranslation.php +++ b/src/Model/SelfService/ArticleTranslation.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $article_id + * @property string $title + * @property string $slug + * @property string|null $excerpt + * @property string $plain_text + * @property string $text + * @property string $purified_text + */ class ArticleTranslation extends Translation { /** @var array */ diff --git a/src/Model/SelfService/Attachment.php b/src/Model/SelfService/Attachment.php index 076f279..4b6cf28 100644 --- a/src/Model/SelfService/Attachment.php +++ b/src/Model/SelfService/Attachment.php @@ -5,6 +5,15 @@ use SupportPal\ApiClient\Model\Core\Upload; use SupportPal\ApiClient\Model\Model; +/** + * @property string $upload_hash + * @property int $article_id + * @property string|null $locale + * @property string $original_name + * @property int $created_at + * @property int $updated_at + * @property Upload $upload + */ class Attachment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Category.php b/src/Model/SelfService/Category.php index 27e8a52..a15ce46 100644 --- a/src/Model/SelfService/Category.php +++ b/src/Model/SelfService/Category.php @@ -4,6 +4,21 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $type_id + * @property int|null $parent_id + * @property string $name + * @property string $slug + * @property int $public + * @property int $parent_public + * @property int $created_at + * @property int $updated_at + * @property string $frontend_url + * @property Type $type + * @property CategoryTranslation[] $translations + * @property int $pinned + */ class Category extends Model { /** @var array */ diff --git a/src/Model/SelfService/CategoryTranslation.php b/src/Model/SelfService/CategoryTranslation.php index efed7a0..1359d7e 100644 --- a/src/Model/SelfService/CategoryTranslation.php +++ b/src/Model/SelfService/CategoryTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $category_id + * @property string $name + * @property string $slug + */ class CategoryTranslation extends Translation { /** @var array */ diff --git a/src/Model/SelfService/Comment.php b/src/Model/SelfService/Comment.php index 946bfe0..85db771 100644 --- a/src/Model/SelfService/Comment.php +++ b/src/Model/SelfService/Comment.php @@ -5,6 +5,24 @@ use SupportPal\ApiClient\Model\Model; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property int $article_id + * @property int $type_id + * @property int $author_id + * @property string $name + * @property string $text + * @property string $purified_text + * @property int|null $parent_id + * @property int|null $root_parent_id + * @property int $rating + * @property int $status + * @property int $notify_reply + * @property int $created_at + * @property int $updated_at + * @property int|null $deleted_at + * @property User $author + */ class Comment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Request/CreateArticle.php b/src/Model/SelfService/Request/CreateArticle.php index e148075..209c69d 100644 --- a/src/Model/SelfService/Request/CreateArticle.php +++ b/src/Model/SelfService/Request/CreateArticle.php @@ -4,6 +4,19 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $author_id + * @property string $title + * @property string $slug + * @property string $excerpt + * @property string $text + * @property int[] $category + * @property string[] $tag + * @property bool $published + * @property int $published_at + * @property bool $protected + * @property bool $pinned + */ class CreateArticle extends Model { /** @var array */ diff --git a/src/Model/SelfService/Request/CreateAttachment.php b/src/Model/SelfService/Request/CreateAttachment.php index acbfb8a..e2444b8 100644 --- a/src/Model/SelfService/Request/CreateAttachment.php +++ b/src/Model/SelfService/Request/CreateAttachment.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $article_id + * @property string $filename + * @property string $contents + */ class CreateAttachment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Request/CreateComment.php b/src/Model/SelfService/Request/CreateComment.php index af454fc..5f552f8 100644 --- a/src/Model/SelfService/Request/CreateComment.php +++ b/src/Model/SelfService/Request/CreateComment.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $article_id + * @property int $type_id + * @property int $parent_id + * @property int $author_id + * @property string $name + * @property string $text + * @property int $status + * @property bool $notify_reply + */ class CreateComment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Tag.php b/src/Model/SelfService/Tag.php index 1ca9c85..d211d1a 100644 --- a/src/Model/SelfService/Tag.php +++ b/src/Model/SelfService/Tag.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $slug + * @property int $created_at + * @property int $updated_at + * @property TagTranslation[] $translations + */ class Tag extends Model { /** @var array */ diff --git a/src/Model/SelfService/TagTranslation.php b/src/Model/SelfService/TagTranslation.php index d89767e..087e8cd 100644 --- a/src/Model/SelfService/TagTranslation.php +++ b/src/Model/SelfService/TagTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $tag_id + * @property string $name + * @property string $slug + */ class TagTranslation extends Translation { /** @var array */ diff --git a/src/Model/SelfService/Type.php b/src/Model/SelfService/Type.php index 76f3ad9..62de91a 100644 --- a/src/Model/SelfService/Type.php +++ b/src/Model/SelfService/Type.php @@ -5,6 +5,27 @@ use SupportPal\ApiClient\Model\Core\Brand; use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $brand_id + * @property string $name + * @property string $slug + * @property string $description + * @property int $order + * @property int $enabled + * @property int $protected + * @property int $internal + * @property int $content + * @property int $view + * @property string $icon + * @property int $article_ordering + * @property int $show_on_dashboard + * @property string|null $external_link + * @property int $created_at + * @property int $updated_at + * @property TypeTranslation[] $translations + * @property Brand $brand + */ class Type extends Model { /** @var array */ diff --git a/src/Model/SelfService/TypeTranslation.php b/src/Model/SelfService/TypeTranslation.php index a844121..db73c7f 100644 --- a/src/Model/SelfService/TypeTranslation.php +++ b/src/Model/SelfService/TypeTranslation.php @@ -4,6 +4,13 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $type_id + * @property string $name + * @property string $description + * @property string $slug + */ class TypeTranslation extends Translation { /** @var array */ diff --git a/src/Model/Shared/CustomField.php b/src/Model/Shared/CustomField.php index c312dd1..465cf87 100644 --- a/src/Model/Shared/CustomField.php +++ b/src/Model/Shared/CustomField.php @@ -5,6 +5,26 @@ use SupportPal\ApiClient\Model\Core\Brand; use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string|null $description + * @property string|null $purified_description + * @property int $type + * @property int|null $depends_on_field_id + * @property int|null $depends_on_option_id + * @property int|null $order + * @property int $required + * @property int $public + * @property int $encrypted + * @property int $locked + * @property string|null $regex + * @property string|null $regex_error_message + * @property int $created_at + * @property int $updated_at + * @property Option[] $options + * @property Brand[] $brands + */ abstract class CustomField extends Model { public const TYPE_BOOLEAN = 0; diff --git a/src/Model/Shared/Option.php b/src/Model/Shared/Option.php index 54fa978..86b28dd 100644 --- a/src/Model/Shared/Option.php +++ b/src/Model/Shared/Option.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $field_id + * @property int|null $order + * @property string $value + * @property int $created_at + * @property int $updated_at + * @property OptionTranslation[] $translations + */ class Option extends Model { /** @var array */ diff --git a/src/Model/Shared/OptionTranslation.php b/src/Model/Shared/OptionTranslation.php index a49ac24..914d09c 100644 --- a/src/Model/Shared/OptionTranslation.php +++ b/src/Model/Shared/OptionTranslation.php @@ -4,6 +4,10 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property string $value + */ class OptionTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Attachment.php b/src/Model/Ticket/Attachment.php index 0e7705b..0020151 100644 --- a/src/Model/Ticket/Attachment.php +++ b/src/Model/Ticket/Attachment.php @@ -5,6 +5,21 @@ use SupportPal\ApiClient\Model\Core\Upload; use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $upload_hash + * @property int $ticket_id + * @property int $message_id + * @property string $original_name + * @property int $created_at + * @property int $updated_at + * @property string $operator_url + * @property string $frontend_url + * @property string $direct_operator_url + * @property string $direct_frontend_url + * @property Upload $upload + * @property Ticket $ticket + */ class Attachment extends Model { /** @var array */ diff --git a/src/Model/Ticket/Channel.php b/src/Model/Ticket/Channel.php index 2d1b81e..6f5d5b8 100644 --- a/src/Model/Ticket/Channel.php +++ b/src/Model/Ticket/Channel.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property int $enabled + * @property int $upgrade_available + * @property string|null $version + * @property int $created_at + * @property int $updated_at + * @property int $show_on_frontend + * @property string $formatted_name + */ class Channel extends Model { /** @var array */ diff --git a/src/Model/Ticket/ChannelSettings.php b/src/Model/Ticket/ChannelSettings.php index 42f0d10..e2008af 100644 --- a/src/Model/Ticket/ChannelSettings.php +++ b/src/Model/Ticket/ChannelSettings.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $unauthenticated_users + * @property string $show_captcha + * @property string $append_ip_address + * @property string $show_related_articles + */ class ChannelSettings extends Model { /** @var array */ diff --git a/src/Model/Ticket/Department.php b/src/Model/Ticket/Department.php index 58ce205..3fb564a 100644 --- a/src/Model/Ticket/Department.php +++ b/src/Model/Ticket/Department.php @@ -6,6 +6,30 @@ use SupportPal\ApiClient\Model\User\Group; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property string $name + * @property string|null $description + * @property int|null $order + * @property int|null $parent_id + * @property int $public + * @property string|null $ticket_number_format + * @property string|null $from_name + * @property int $notify_frontend_ticket + * @property int $notify_email_ticket + * @property int $notify_operators + * @property int $disable_user_email_replies + * @property int $registered_only + * @property int $created_at + * @property int $updated_at + * @property DepartmentEmailTemplates[]|null $email_templates + * @property DepartmentEmail[] $emails + * @property DepartmentTranslation[] $translations + * @property Group[] $groups + * @property User[] $operators + * @property Department $parent + * @property User[]|null $default_assignedto + */ class Department extends Model { /** @var array */ @@ -30,7 +54,7 @@ class Department extends Model 'translations' => 'array:' . DepartmentTranslation::class, 'groups' => 'array:' . Group::class, 'operators' => 'array:' . User::class, - 'parent' => 'array:' . self::class, + 'parent' => self::class, 'default_assignedto' => 'array:' . User::class, ]; } diff --git a/src/Model/Ticket/DepartmentEmail.php b/src/Model/Ticket/DepartmentEmail.php index dc3cc71..831421d 100644 --- a/src/Model/Ticket/DepartmentEmail.php +++ b/src/Model/Ticket/DepartmentEmail.php @@ -4,6 +4,24 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $department_id + * @property int $brand_id + * @property string $address + * @property int $type + * @property int $protocol + * @property string $server + * @property string $username + * @property string $auth_mech + * @property string $password + * @property string $oauth + * @property string $port + * @property int $encryption + * @property int $consume_all + * @property int $delete_downloaded + * @property int $created_at + * @property int $updated_at + */ class DepartmentEmail extends Model { /** @var array */ diff --git a/src/Model/Ticket/DepartmentEmailTemplates.php b/src/Model/Ticket/DepartmentEmailTemplates.php index d82d678..c86ed13 100644 --- a/src/Model/Ticket/DepartmentEmailTemplates.php +++ b/src/Model/Ticket/DepartmentEmailTemplates.php @@ -4,6 +4,25 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $operator_department_changed + * @property int $operator_internal_opened + * @property int $user_ticket_locked + * @property int $user_ticket_reply + * @property int $operator_assigned + * @property int $operator_ticket_note + * @property int $user_ticket_opened + * @property int $user_ticket_operatorclose + * @property int $operator_ticket_opened + * @property int $user_ticket_registeredonly + * @property int $user_ticket_autoclose + * @property int $user_email_attachmentrejected + * @property int $operator_operator_ticket_reply + * @property int $user_ticket_waitingresponse + * @property int $user_user_ticket_reply + * @property int $user_ticket_disablereplies + * @property int $operator_user_ticket_reply + */ class DepartmentEmailTemplates extends Model { /** @var array */ diff --git a/src/Model/Ticket/DepartmentTranslation.php b/src/Model/Ticket/DepartmentTranslation.php index 8ce2aae..2037ea0 100644 --- a/src/Model/Ticket/DepartmentTranslation.php +++ b/src/Model/Ticket/DepartmentTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property string $name + * @property string $description + * @property int $department_id + */ class DepartmentTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Extra.php b/src/Model/Ticket/Extra.php index 8563289..e1ed407 100644 --- a/src/Model/Ticket/Extra.php +++ b/src/Model/Ticket/Extra.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string[] $bcc_address + * @property string[] $to_address + * @property string[] $cc_address + */ class Extra extends Model { /** @var array */ diff --git a/src/Model/Ticket/Message.php b/src/Model/Ticket/Message.php index d812f05..ad4e7f4 100644 --- a/src/Model/Ticket/Message.php +++ b/src/Model/Ticket/Message.php @@ -5,6 +5,26 @@ use SupportPal\ApiClient\Model\Model; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property int $ticket_id + * @property int $channel_id + * @property int|null $user_id + * @property string $user_name + * @property string|null $user_ip_address + * @property int $by + * @property int $type + * @property string $excerpt + * @property string $text + * @property string $purified_text + * @property int $is_draft + * @property string|null $social_id + * @property Extra|null $extra + * @property int $created_at + * @property int $updated_at + * @property Attachment[] $attachments + * @property User $user + */ class Message extends Model { /** @var array */ diff --git a/src/Model/Ticket/Priority.php b/src/Model/Ticket/Priority.php index 5e32fb7..35e8744 100644 --- a/src/Model/Ticket/Priority.php +++ b/src/Model/Ticket/Priority.php @@ -4,6 +4,18 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $colour + * @property int|null $order + * @property int $created_at + * @property int $updated_at + * @property string $icon + * @property string $icon_without_tooltip + * @property Department[] $departments + * @property PriorityTranslation[] $translations + */ class Priority extends Model { /** @var array */ diff --git a/src/Model/Ticket/PriorityTranslation.php b/src/Model/Ticket/PriorityTranslation.php index ed340e4..2384fff 100644 --- a/src/Model/Ticket/PriorityTranslation.php +++ b/src/Model/Ticket/PriorityTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $priority_id + * @property string $name + */ class PriorityTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Request/CreateMessage.php b/src/Model/Ticket/Request/CreateMessage.php index 61b0912..00cee49 100644 --- a/src/Model/Ticket/Request/CreateMessage.php +++ b/src/Model/Ticket/Request/CreateMessage.php @@ -8,6 +8,19 @@ use function array_unique; use function trim; +/** + * @property int $ticket_id + * @property int $user_id + * @property string $user_ip_address + * @property int $message_type + * @property string $text + * @property array $attachment + * @property string[] $cc + * @property bool $is_draft + * @property bool $send_user_email + * @property bool $send_operators_email + * @property int $created_at + */ class CreateMessage extends Model { /** @var array */ diff --git a/src/Model/Ticket/Request/CreateTicket.php b/src/Model/Ticket/Request/CreateTicket.php index 3cc2a92..c68d54d 100644 --- a/src/Model/Ticket/Request/CreateTicket.php +++ b/src/Model/Ticket/Request/CreateTicket.php @@ -8,6 +8,31 @@ use function array_unique; use function trim; +/** + * @property int $user + * @property int $on_behalf_of + * @property string $user_firstname + * @property string $user_lastname + * @property string $user_email + * @property string $user_organisation + * @property string $user_ip_address + * @property int $department + * @property int $brand + * @property int $status + * @property int $priority + * @property bool $internal + * @property string $subject + * @property string $text + * @property int[] $tag + * @property int[] $assignedto + * @property int[] $watching + * @property array $customfield + * @property string[] $cc + * @property int $send_user_email + * @property int $send_operators_email + * @property array $attachment + * @property int $created_at + */ class CreateTicket extends Model { /** @var array */ diff --git a/src/Model/Ticket/Request/UpdateMessage.php b/src/Model/Ticket/Request/UpdateMessage.php index 7a91ff4..e05e2f6 100644 --- a/src/Model/Ticket/Request/UpdateMessage.php +++ b/src/Model/Ticket/Request/UpdateMessage.php @@ -4,6 +4,9 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $text + */ class UpdateMessage extends Model { /** @var array */ diff --git a/src/Model/Ticket/Request/UpdateTicket.php b/src/Model/Ticket/Request/UpdateTicket.php index 46eb456..dc358d0 100644 --- a/src/Model/Ticket/Request/UpdateTicket.php +++ b/src/Model/Ticket/Request/UpdateTicket.php @@ -8,6 +8,27 @@ use function array_unique; use function trim; +/** + * @property int $brand + * @property int $user + * @property int $department + * @property int $department_email + * @property int $status + * @property int $priority + * @property string $subject + * @property int[] $tag + * @property int[] $assignedto + * @property int[] $watching + * @property int[] $link + * @property int[] $unlink + * @property int $sla_plan + * @property int $reply_due_time + * @property int $resolve_due_time + * @property array $customfield + * @property bool $overwrite_customfield_values + * @property string[] $cc + * @property bool $locked + */ class UpdateTicket extends Model { /** @var array */ diff --git a/src/Model/Ticket/SlaPlan.php b/src/Model/Ticket/SlaPlan.php index 0a0e68b..bd00673 100644 --- a/src/Model/Ticket/SlaPlan.php +++ b/src/Model/Ticket/SlaPlan.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string|null $description + * @property int|null $order + * @property int $all_hours + * @property int $condition_group_type + * @property int $created_at + * @property int $updated_at + * @property SlaPlanTranslation[] $translations + */ class SlaPlan extends Model { /** @var array */ diff --git a/src/Model/Ticket/SlaPlanTranslation.php b/src/Model/Ticket/SlaPlanTranslation.php index ec77957..917d4df 100644 --- a/src/Model/Ticket/SlaPlanTranslation.php +++ b/src/Model/Ticket/SlaPlanTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $sla_plan_id + * @property string $name + * @property string $description + */ class SlaPlanTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Status.php b/src/Model/Ticket/Status.php index d223f2c..956e780 100644 --- a/src/Model/Ticket/Status.php +++ b/src/Model/Ticket/Status.php @@ -4,6 +4,18 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $colour + * @property int $auto_close + * @property int|null $order + * @property int $created_at + * @property int $updated_at + * @property string $icon + * @property string $icon_without_tooltip + * @property StatusTranslation[] $translations + */ class Status extends Model { /** diff --git a/src/Model/Ticket/StatusTranslation.php b/src/Model/Ticket/StatusTranslation.php index 93bc03e..b845cde 100644 --- a/src/Model/Ticket/StatusTranslation.php +++ b/src/Model/Ticket/StatusTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $status_id + * @property string $name + */ class StatusTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Tag.php b/src/Model/Ticket/Tag.php index 546eb52..e8b233f 100644 --- a/src/Model/Ticket/Tag.php +++ b/src/Model/Ticket/Tag.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $colour + * @property int $created_at + * @property int $updated_at + * @property string $colour_text + * @property string $original_name + * @property TagTranslation[] $translations + */ class Tag extends Model { /** @var array */ diff --git a/src/Model/Ticket/TagTranslation.php b/src/Model/Ticket/TagTranslation.php index 67ebc64..77ea884 100644 --- a/src/Model/Ticket/TagTranslation.php +++ b/src/Model/Ticket/TagTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $tag_id + * @property string $name + */ class TagTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Ticket.php b/src/Model/Ticket/Ticket.php index 351c2ce..18dc978 100644 --- a/src/Model/Ticket/Ticket.php +++ b/src/Model/Ticket/Ticket.php @@ -6,6 +6,56 @@ use SupportPal\ApiClient\Model\Model; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property string|null $number + * @property int $department_id + * @property int|null $department_email_id + * @property int $brand_id + * @property int $channel_id + * @property int $user_id + * @property int $status_id + * @property int $priority_id + * @property int|null $sla_plan_id + * @property string $subject + * @property int|null $due_time + * @property int|null $paused_time + * @property int $time_while_paused + * @property int|null $resolved_time + * @property int|null $reopened_time + * @property string[]|null $cc + * @property int $locked + * @property int $merged + * @property int $internal + * @property int $response_email_sent + * @property int|null $messages_count + * @property int|null $notes_count + * @property int|null $has_attachments + * @property bool $has_draft + * @property int $last_reply_time + * @property int $last_message_time + * @property int|null $last_reply_id + * @property int|null $last_message_id + * @property int|null $last_reply_by + * @property int|null $last_message_by + * @property int|null $deleted_at + * @property int $created_at + * @property int $updated_at + * @property string $frontend_url + * @property string $operator_url + * @property Channel $channel + * @property Department $department + * @property Tag[] $tags + * @property User $user + * @property User[] $watching + * @property User[] $assigned + * @property Brand $brand + * @property Message $last_reply + * @property SlaPlan|null $slaplan + * @property TicketCustomField[] $customfields + * @property Status $status + * @property Priority $priority + */ class Ticket extends Model { /** @var array */ diff --git a/src/Model/Ticket/TicketCustomField.php b/src/Model/Ticket/TicketCustomField.php index aa8edaa..b8593da 100644 --- a/src/Model/Ticket/TicketCustomField.php +++ b/src/Model/Ticket/TicketCustomField.php @@ -6,6 +6,12 @@ use function array_merge; +/** + * @property int $purge + * @property int $ticket_id + * @property Department[] $departments + * @property TicketCustomFieldTranslation[] $translations + */ class TicketCustomField extends CustomField { /** diff --git a/src/Model/Ticket/TicketCustomFieldTranslation.php b/src/Model/Ticket/TicketCustomFieldTranslation.php index 89214fd..dd4a1fd 100644 --- a/src/Model/Ticket/TicketCustomFieldTranslation.php +++ b/src/Model/Ticket/TicketCustomFieldTranslation.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $ticket_custom_field_id + * @property string $name + * @property string $description + * @property string $purified_description + * @property string $regex_error_message + */ class TicketCustomFieldTranslation extends Translation { /** @var array */ diff --git a/src/Model/Translation.php b/src/Model/Translation.php index 3159f08..c9bdb5b 100644 --- a/src/Model/Translation.php +++ b/src/Model/Translation.php @@ -4,6 +4,9 @@ use function array_merge; +/** + * @property string $locale + */ abstract class Translation extends Model { /** diff --git a/src/Model/User/Domain.php b/src/Model/User/Domain.php index 703a2bc..020b20f 100644 --- a/src/Model/User/Domain.php +++ b/src/Model/User/Domain.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $organisation_id + * @property string $domain + */ class Domain extends Model { /** @var array */ diff --git a/src/Model/User/Group.php b/src/Model/User/Group.php index 389cdf7..bd76d11 100644 --- a/src/Model/User/Group.php +++ b/src/Model/User/Group.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string|null $description + * @property string|null $colour + * @property int $administrator + * @property int $created_at + * @property int $updated_at + * @property GroupTranslation[] $translations + */ class Group extends Model { /** @var array */ diff --git a/src/Model/User/GroupTranslation.php b/src/Model/User/GroupTranslation.php index abfbe7a..0205b74 100644 --- a/src/Model/User/GroupTranslation.php +++ b/src/Model/User/GroupTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $user_group_id + * @property string $name + * @property string|null $description + */ class GroupTranslation extends Translation { /** @var array */ diff --git a/src/Model/User/Organisation.php b/src/Model/User/Organisation.php index 47a522f..b58424e 100644 --- a/src/Model/User/Organisation.php +++ b/src/Model/User/Organisation.php @@ -4,6 +4,21 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $brand_id + * @property int|null $owner_id + * @property string $name + * @property string|null $country + * @property string|null $language_code + * @property string|null $timezone + * @property string|null $notes + * @property int $created_at + * @property int $updated_at + * @property Domain[] $domains + * @property User[] $users + * @property UserCustomField[] $customfields + */ class Organisation extends Model { /** @var array */ diff --git a/src/Model/User/OrganisationCustomFieldTranslation.php b/src/Model/User/OrganisationCustomFieldTranslation.php index 5201990..120ed38 100644 --- a/src/Model/User/OrganisationCustomFieldTranslation.php +++ b/src/Model/User/OrganisationCustomFieldTranslation.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $user_organisation_custom_field_id + * @property string $name + * @property string $description + * @property string $purified_description + * @property string $regex_error_message + */ class OrganisationCustomFieldTranslation extends Translation { /** @var array */ diff --git a/src/Model/User/Request/CreateOperator.php b/src/Model/User/Request/CreateOperator.php index 6297f65..d897ce4 100644 --- a/src/Model/User/Request/CreateOperator.php +++ b/src/Model/User/Request/CreateOperator.php @@ -7,6 +7,19 @@ use function array_unique; +/** + * @property string $firstname + * @property string $lastname + * @property string $email + * @property string $password + * @property string[] $phone + * @property string $country + * @property string $language_code + * @property string $timezone + * @property int $active + * @property int[] $groups + * @property int[] $depts + */ class CreateOperator extends Model { /** @var array */ diff --git a/src/Model/User/Request/CreateOrganisation.php b/src/Model/User/Request/CreateOrganisation.php index 7c41690..c516975 100644 --- a/src/Model/User/Request/CreateOrganisation.php +++ b/src/Model/User/Request/CreateOrganisation.php @@ -8,6 +8,17 @@ use function array_unique; use function trim; +/** + * @property int $brand_id + * @property string $name + * @property array $customfield + * @property string $country + * @property string $language_code + * @property string $timezone + * @property string $notes + * @property string[] $domain + * @property array $access_level + */ class CreateOrganisation extends Model { /** @var array */ diff --git a/src/Model/User/Request/CreateUser.php b/src/Model/User/Request/CreateUser.php index 208d5c7..72977b4 100644 --- a/src/Model/User/Request/CreateUser.php +++ b/src/Model/User/Request/CreateUser.php @@ -9,6 +9,27 @@ use function array_unique; use function trim; +/** + * @property int $brand_id + * @property string $firstname + * @property string $lastname + * @property string $email + * @property string[] $additional_email + * @property string $password + * @property bool $send_email + * @property string[] $phone + * @property string $country + * @property string $language_code + * @property string $timezone + * @property bool $email_verified + * @property int $active + * @property string $organisation + * @property int $organisation_id + * @property int $organisation_access_level + * @property int $organisation_notifications + * @property int[] $customfield + * @property int[] $groups + */ class CreateUser extends Model { /** @var array */ diff --git a/src/Model/User/User.php b/src/Model/User/User.php index a293033..921978d 100644 --- a/src/Model/User/User.php +++ b/src/Model/User/User.php @@ -4,6 +4,43 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int|null $brand_id + * @property int $role + * @property string|null $firstname + * @property string|null $lastname + * @property string|null $email + * @property string|null $password + * @property string|null $session + * @property string|null $remember_token + * @property int $email_verified + * @property int $active + * @property int|null $organisation_id + * @property int|null $organisation_access_level + * @property int|null $organisation_notifications + * @property string|null $country + * @property string|null $language_code + * @property string|null $timezone + * @property string|null $avatar + * @property int|null $template_mode + * @property string|null $notes + * @property int $twofa_enabled + * @property string|null $twofa_secret + * @property string|null $twofa_token + * @property string|null $twitter_id + * @property string|null $twitter_handle + * @property string|null $facebook_id + * @property int|null $last_active_at + * @property int $created_at + * @property int $updated_at + * @property string $avatar_url + * @property string $formatted_name + * @property string[] $phone + * @property Group[] $groups + * @property UserCustomField[] $customfields + * @property Organisation $organisation + */ class User extends Model { /** @var array */ diff --git a/src/Model/User/UserCustomField.php b/src/Model/User/UserCustomField.php index 0c1ad73..ae7b737 100644 --- a/src/Model/User/UserCustomField.php +++ b/src/Model/User/UserCustomField.php @@ -6,6 +6,9 @@ use function array_merge; +/** + * @property UserCustomFieldTranslation[] $translations + */ class UserCustomField extends CustomField { /** diff --git a/src/Model/User/UserCustomFieldTranslation.php b/src/Model/User/UserCustomFieldTranslation.php index 8e8ce6e..bb57cdc 100644 --- a/src/Model/User/UserCustomFieldTranslation.php +++ b/src/Model/User/UserCustomFieldTranslation.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $user_custom_field_id + * @property string $name + * @property string $description + * @property string $purified_description + * @property string $regex_error_message + */ class UserCustomFieldTranslation extends Translation { /** @var array */