Automated PR provided by Codex via Gitea API. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #482
74 lines
1.9 KiB
PHP
74 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Support\TenantConfiguration\CaptureOutcome;
|
|
use App\Support\TenantConfiguration\CoverageLevel;
|
|
use App\Support\TenantConfiguration\EvidenceState;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TenantConfigurationResourceEvidence extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'tenant_configuration_resource_evidence';
|
|
|
|
protected $guarded = [];
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'source_metadata' => 'array',
|
|
'raw_payload' => 'array',
|
|
'normalized_payload' => 'array',
|
|
'permission_context' => 'array',
|
|
'evidence_state' => EvidenceState::class,
|
|
'coverage_level' => CoverageLevel::class,
|
|
'capture_outcome' => CaptureOutcome::class,
|
|
'captured_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function resource(): BelongsTo
|
|
{
|
|
return $this->belongsTo(TenantConfigurationResource::class, 'resource_id');
|
|
}
|
|
|
|
public function workspace(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Workspace::class);
|
|
}
|
|
|
|
public function tenant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ManagedEnvironment::class, 'managed_environment_id');
|
|
}
|
|
|
|
public function managedEnvironment(): BelongsTo
|
|
{
|
|
return $this->tenant();
|
|
}
|
|
|
|
public function providerConnection(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ProviderConnection::class);
|
|
}
|
|
|
|
public function resourceType(): BelongsTo
|
|
{
|
|
return $this->belongsTo(TenantConfigurationResourceType::class);
|
|
}
|
|
|
|
public function operationRun(): BelongsTo
|
|
{
|
|
return $this->belongsTo(OperationRun::class);
|
|
}
|
|
}
|