Skip to content

Commit

Permalink
Add more annotations for Model properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Sep 11, 2024
1 parent 7ecdb29 commit c3738d7
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Models/Tenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
* @property int id
* @property string name
*/
class Tenant extends Model
{
use HasFactory;
Expand Down
11 changes: 11 additions & 0 deletions app/Models/YnhApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
* @property int id
* @property string name
* @property ?string description
* @property string version
* @property ?string path
* @property string sku
* @property int ynh_server_id
* @property ?int ynh_order_id
* @property bool updated
*/
class YnhApplication extends Model
{
use HasFactory;
Expand Down
9 changes: 9 additions & 0 deletions app/Models/YnhBackup.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property int id
* @property ?int user_id
* @property int ynh_server_id
* @property string name
* @property int size
* @property ?string storage_path
* @property array result
*/
class YnhBackup extends Model
{
use HasFactory, HasTenant2;
Expand Down
7 changes: 7 additions & 0 deletions app/Models/YnhDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property int id
* @property string name
* @property bool is_principal
* @property int ynh_server_id
* @property bool updated
*/
class YnhDomain extends Model
{
use HasFactory;
Expand Down
10 changes: 10 additions & 0 deletions app/Models/YnhNginxLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;

/**
* @property int id
* @property bool updated
* @property ?int from_ynh_server_id
* @property ?int to_ynh_server_id
* @property string from_ip_address
* @property string to_ip_address
* @property string service
* @property int weight
*/
class YnhNginxLogs extends Model
{
use HasFactory;
Expand Down
6 changes: 6 additions & 0 deletions app/Models/YnhOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Collection;

/**
* @property int id
* @property int order_id
* @property int order_item_id
* @property ProductTypeEnum product_type
*/
class YnhOrder extends Model
{
use HasFactory;
Expand Down
16 changes: 16 additions & 0 deletions app/Models/YnhOsquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;

/**
* @property int id
* @property int ynh_server_id
* @property int row
* @property string name
* @property string host_identifier
* @property Carbon calendar_time
* @property int unix_time
* @property int epoch
* @property int counter
* @property bool numerics
* @property array columns
* @property string action
* @property bool packed
*/
class YnhOsquery extends Model
{
use HasFactory;
Expand Down
11 changes: 11 additions & 0 deletions app/Models/YnhOsqueryDiskUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property int id
* @property int ynh_server_id
* @property Carbon timestamp
* @property double percent_available
* @property double percent_used
* @property double space_left_gb
* @property double total_space_gb
* @property double used_space_gb
*/
class YnhOsqueryDiskUsage extends Model
{
use HasFactory;
Expand Down
11 changes: 11 additions & 0 deletions app/Models/YnhOsqueryMemoryUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property int id
* @property int ynh_server_id
* @property Carbon timestamp
* @property double percent_available
* @property double percent_used
* @property double space_left_gb
* @property double total_space_gb
* @property double used_space_gb
*/
class YnhOsqueryMemoryUsage extends Model
{
use HasFactory;
Expand Down
13 changes: 13 additions & 0 deletions app/Models/YnhOsqueryRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
* @property int id
* @property string name
* @property string description
* @property ?string value
* @property string query
* @property ?string version
* @property int interval
* @property bool removed
* @property bool snapshot
* @property OsqueryPlatformEnum platform
* @property ?string category
*/
class YnhOsqueryRule extends Model
{
use HasFactory;
Expand Down
10 changes: 10 additions & 0 deletions app/Models/YnhPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Collection;

/**
* @property int id
* @property string name
* @property int ynh_user_id
* @property int ynh_application_id
* @property bool updated
* @property bool is_visitors
* @property bool is_all_users
* @property bool is_user_specific
*/
class YnhPermission extends Model
{
use HasFactory;
Expand Down
18 changes: 18 additions & 0 deletions app/Models/YnhServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;

/**
* @property int id
* @property string name
* @property ?string version
* @property ?string ip_address
* @property ?int ssh_port
* @property ?string ssh_username
* @property ?string ssh_public_key
* @property ?string ssh_private_key
* @property ?int user_id
* @property bool updated
* @property bool is_ready
* @property ?int ynh_order_id
* @property string secret
* @property string ip_address_v6
* @property bool is_frozen
* @property bool added_with_curl
*/
class YnhServer extends Model
{
use HasFactory, HasTenant2;
Expand Down
9 changes: 9 additions & 0 deletions app/Models/YnhSshTraces.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property int id
* @property ?int user_id
* @property int ynh_server_id
* @property string uid
* @property int order
* @property SshTraceStateEnum state
* @property string trace
*/
class YnhSshTraces extends Model
{
use HasFactory;
Expand Down
12 changes: 12 additions & 0 deletions app/Models/YnhTheCyberBrief.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;

/**
* @property int id
* @property string news
* @property LanguageEnum news_language
* @property ?string hyperlink
* @property ?string website
* @property ?string teaser
* @property ?string opener
* @property ?string why_it_matters
* @property ?string go_deeper
* @property bool is_published
*/
class YnhTheCyberBrief extends Model
{
use HasFactory;
Expand Down
8 changes: 8 additions & 0 deletions app/Models/YnhUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Collection;

/**
* @property int id
* @property string username
* @property ?string fullname
* @property string email
* @property int ynh_server_id
* @property bool updated
*/
class YnhUser extends Model
{
use HasFactory;
Expand Down

0 comments on commit c3738d7

Please sign in to comment.