| 1 |
<?php |
| 2 |
|
| 3 |
namespace Pushly\Models; |
| 4 |
|
| 5 |
class NotificationDeliverySpec implements \JsonSerializable { |
| 6 |
public ?string $type = null; |
| 7 |
public ?string $window = null; |
| 8 |
public ?string $send_date_utc = null; |
| 9 |
|
| 10 |
#[\ReturnTypeWillChange] |
| 11 |
public function jsonSerialize(): array { |
| 12 |
$r = [ |
| 13 |
'type' => $this->type, |
| 14 |
'window' => $this->window, |
| 15 |
]; |
| 16 |
|
| 17 |
if ( $this->type === 'SCHEDULED' ) { |
| 18 |
$r['send_date_utc'] = $this->send_date_utc; |
| 19 |
} |
| 20 |
|
| 21 |
return $r; |
| 22 |
} |
| 23 |
} |
| 24 |
|