Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Endpoints/EmailEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/**
* @phpstan-import-type SendMailRequest from \Lettermint\Types\ApiTypes
* @phpstan-import-type SendBatchMailRequest from \Lettermint\Types\ApiTypes
* @phpstan-import-type SandboxResult from \Lettermint\Types\ApiTypes
*
* @phpstan-type AttachmentPayload array{
* filename: string,
Expand Down Expand Up @@ -37,7 +38,8 @@
* tag?: string|null,
* tags?: list<array{name: string, value: string}>,
* settings?: EmailSettings|null,
* headers?: array<string, string>
* headers?: array<string, string>,
* sandbox_result?: SandboxResult
* }
*/
class EmailEndpoint extends Endpoint
Expand Down Expand Up @@ -291,6 +293,18 @@ public function tags(array $tags): self
return $this;
}

/**
* Select the simulated result for a Sandbox project.
*
* @phpstan-param SandboxResult $result
*/
public function sandboxResult(string $result): self
{
$this->payload['sandbox_result'] = $result;

return $this;
}

/**
* Set per-email settings.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Objects/DomainData.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* @property 'legacy_txt'|'managed_cname' $dkim_mode
* @property bool $rotation_ready
* @property string|null $status_changed_at
* @property list<DomainDnsRecordData> $dns_records
* @property list<\Lettermint\Objects\DomainDnsRecordData> $dns_records
* @property list<array<string, mixed>> $projects
* @property string $created_at
*/
final class DomainData extends Resource
{
protected static array $casts = [
'dns_records' => [DomainDnsRecordData::class],
'dns_records' => [\Lettermint\Objects\DomainDnsRecordData::class],
];
}
17 changes: 10 additions & 7 deletions src/Objects/MessageData.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@
/**
* @property string $id
* @property 'inbound'|'outbound' $type
* @property 'scheduled'|'pending'|'queued'|'suppressed'|'processed'|'delivered'|'opened'|'clicked'|'soft_bounced'|'hard_bounced'|'spam_complaint'|'failed'|'blocked'|'policy_rejected'|'unsubscribed'|'canceled' $status
* @property 'scheduled'|'pending'|'queued'|'quarantined'|'suppressed'|'processed'|'delivered'|'opened'|'clicked'|'soft_bounced'|'hard_bounced'|'spam_complaint'|'failed'|'blocked'|'policy_rejected'|'unsubscribed'|'canceled' $status
* @property string|null $status_changed_at
* @property string|null $scheduled_at
* @property string|null $tag
* @property list<array<string, mixed>> $tags
* @property string $from_email
* @property string|null $from_name
* @property list<string>|null $reply_to
* @property string|null $subject
* @property list<MessageRecipientData>|null $to
* @property list<MessageRecipientData>|null $cc
* @property list<MessageRecipientData>|null $bcc
* @property list<MessageAttachmentData>|null $attachments
* @property list<\Lettermint\Objects\MessageRecipientData>|null $to
* @property list<\Lettermint\Objects\MessageRecipientData>|null $cc
* @property list<\Lettermint\Objects\MessageRecipientData>|null $bcc
* @property list<\Lettermint\Objects\MessageAttachmentData>|null $attachments
* @property array<string, string>|null $metadata
* @property float|int|null $spam_score
* @property list<SpamSymbol> $spam_symbols
* @property list<\Lettermint\Objects\SpamSymbol> $spam_symbols
* @property string $route_id
* @property string $created_at
* @property 'live'|'sandbox' $delivery_mode
* @property 'delivered'|'hard_bounced'|'soft_bounced'|'deferred'|'failed'|'suppressed'|'spam_complaint'|'auto_replied'|'opened'|'clicked'|'unsubscribed'|null $sandbox_result
*/
final class MessageData extends Resource
{
protected static array $casts = [
'spam_symbols' => [SpamSymbol::class],
'spam_symbols' => [\Lettermint\Objects\SpamSymbol::class],
];
}
4 changes: 3 additions & 1 deletion src/Objects/MessageEventData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

/**
* @property string $message_id
* @property 'scheduled'|'rescheduled'|'canceled'|'released'|'queued'|'processed'|'suppressed'|'delivered'|'auto_replied'|'soft_bounced'|'hard_bounced'|'spam_complaint'|'failed'|'blocked'|'policy_rejected'|'unsubscribed'|'opened'|'clicked'|'inbound_received'|'inbound_queued'|'inbound_spam_blocked'|'inbound_processed'|'inbound_retry' $event
* @property 'scheduled'|'rescheduled'|'canceled'|'released'|'queued'|'processed'|'suppressed'|'delivered'|'auto_replied'|'soft_bounced'|'hard_bounced'|'spam_complaint'|'failed'|'blocked'|'policy_rejected'|'unsubscribed'|'opened'|'clicked'|'inbound_received'|'inbound_queued'|'inbound_spam_blocked'|'inbound_released'|'inbound_processed'|'inbound_retry' $event
* @property string|null $tag
* @property list<array<string, mixed>> $tags
* @property array<string, mixed>|null $metadata
* @property string $timestamp
*/
Expand Down
11 changes: 7 additions & 4 deletions src/Objects/MessageListData.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@
/**
* @property string $id
* @property 'inbound'|'outbound' $type
* @property 'scheduled'|'pending'|'queued'|'suppressed'|'processed'|'delivered'|'opened'|'clicked'|'soft_bounced'|'hard_bounced'|'spam_complaint'|'failed'|'blocked'|'policy_rejected'|'unsubscribed'|'canceled' $status
* @property 'scheduled'|'pending'|'queued'|'quarantined'|'suppressed'|'processed'|'delivered'|'opened'|'clicked'|'soft_bounced'|'hard_bounced'|'spam_complaint'|'failed'|'blocked'|'policy_rejected'|'unsubscribed'|'canceled' $status
* @property string|null $scheduled_at
* @property float|int|null $spam_score
* @property string $from_email
* @property string|null $from_name
* @property string|null $subject
* @property list<MessageRecipientData>|null $to
* @property list<MessageRecipientData>|null $cc
* @property list<MessageRecipientData>|null $bcc
* @property list<\Lettermint\Objects\MessageRecipientData>|null $to
* @property list<\Lettermint\Objects\MessageRecipientData>|null $cc
* @property list<\Lettermint\Objects\MessageRecipientData>|null $bcc
* @property list<string>|null $reply_to
* @property string|null $tag
* @property list<array<string, mixed>> $tags
* @property string|null $status_changed_at
* @property string $created_at
* @property 'live'|'sandbox' $delivery_mode
* @property 'delivered'|'hard_bounced'|'soft_bounced'|'deferred'|'failed'|'suppressed'|'spam_complaint'|'auto_replied'|'opened'|'clicked'|'unsubscribed'|null $sandbox_result
*/
final class MessageListData extends Resource
{
Expand Down
1 change: 1 addition & 0 deletions src/Objects/MessageRecipientData.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* @property string $email
* @property string|null $name
* @property 'delivered'|'hard_bounced'|'soft_bounced'|'deferred'|'failed'|'suppressed'|'spam_complaint'|'auto_replied'|'opened'|'clicked'|'unsubscribed'|null $sandbox_result
*/
final class MessageRecipientData extends Resource
{
Expand Down
11 changes: 6 additions & 5 deletions src/Objects/ProjectData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
* @property string|null $token_generated_at
* @property string|null $token_last_used_at
* @property string|null $token_last_used_ip
* @property list<RouteListData> $routes
* @property list<\Lettermint\Objects\RouteListData> $routes
* @property int $routes_count
* @property list<DomainData> $domains
* @property list<\Lettermint\Objects\DomainData> $domains
* @property int $domains_count
* @property MessageStatsData|mixed $last_28_days
* @property \Lettermint\Objects\MessageStatsData|null $last_28_days
* @property string $created_at
* @property string $updated_at
* @property 'live'|'sandbox' $delivery_mode
*/
final class ProjectData extends Resource
{
protected static array $casts = [
'routes' => [RouteData::class],
'domains' => [DomainData::class],
'routes' => [\Lettermint\Objects\RouteData::class],
'domains' => [\Lettermint\Objects\DomainData::class],
];
}
4 changes: 2 additions & 2 deletions src/Objects/ProjectListData.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* @property bool $smtp_enabled
* @property int $routes_count
* @property int $domains_count
* @property MessageStatsData $last_28_days
* @property \Lettermint\Objects\MessageStatsData $last_28_days
* @property string $created_at
* @property string $updated_at
*/
final class ProjectListData extends Resource
{
protected static array $casts = [
'last_28_days' => MessageStatsData::class,
'last_28_days' => \Lettermint\Objects\MessageStatsData::class,
];
}
13 changes: 13 additions & 0 deletions src/Objects/RescheduleMessageRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Lettermint\Objects;

use Lettermint\Resource;

/**
* @property string $scheduled_at
*/
final class RescheduleMessageRequest extends Resource
{
//
}
10 changes: 6 additions & 4 deletions src/Objects/RouteData.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@
* @property 'transactional'|'broadcast'|'inbound' $route_type
* @property bool $is_default
* @property string|null $inbound_address
* @property string $inbound_mx_hostname
* @property string|null $inbound_domain
* @property string|null $inbound_domain_verified_at
* @property float|int|null $inbound_spam_threshold
* @property 'inline'|'url' $attachment_delivery
* @property array<string, mixed>|mixed $settings
* @property ProjectListData $project
* @property array<string, mixed>|null $settings
* @property \Lettermint\Objects\ProjectListData $project
* @property int $webhooks_count
* @property int $suppressed_recipients_count
* @property array<string, mixed>|list<RouteStatisticData> $statistics
* @property list<\Lettermint\Objects\RouteStatisticData> $statistics
* @property string $created_at
* @property string $updated_at
*/
final class RouteData extends Resource
{
protected static array $casts = [
'project' => ProjectData::class,
'project' => \Lettermint\Objects\ProjectData::class,
'statistics' => [\Lettermint\Objects\RouteStatisticData::class],
];
}
12 changes: 7 additions & 5 deletions src/Objects/SendMailRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
/**
* @property string $route
* @property string $from
* @property string $subject
* @property string $scheduled_at
* @property string|null $tag
* @property string|null $html
* @property string|null $text
* @property list<string> $to
* @property list<string> $cc
* @property list<string> $bcc
* @property list<string> $reply_to
* @property string $subject
* @property string $scheduled_at
* @property array<string, string> $headers
* @property array<string, string> $metadata
* @property string|null $tag
* @property list<array<string, mixed>> $tags
* @property array<string, mixed>|null $settings
* @property string|null $html
* @property string|null $text
* @property list<array<string, mixed>> $attachments
* @property 'delivered'|'hard_bounced'|'soft_bounced'|'deferred'|'failed'|'suppressed'|'spam_complaint'|'auto_replied'|'opened'|'clicked'|'unsubscribed' $sandbox_result
*/
final class SendMailRequest extends Resource
{
Expand Down
8 changes: 4 additions & 4 deletions src/Objects/StatsDailyData.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @property int $spam_complaints
* @property int|null $opened
* @property int|null $clicked
* @property StatsInboundData $inbound
* @property StatsTypeData|mixed $transactional
* @property StatsTypeData|mixed $broadcast
* @property \Lettermint\Objects\StatsInboundData $inbound
* @property \Lettermint\Objects\StatsTypeData|null $transactional
* @property \Lettermint\Objects\StatsTypeData|null $broadcast
* @property int|null $observed_opened
* @property int|null $human_opened
* @property int|null $privacy_opened
Expand All @@ -25,6 +25,6 @@
final class StatsDailyData extends Resource
{
protected static array $casts = [
'inbound' => StatsInboundData::class,
'inbound' => \Lettermint\Objects\StatsInboundData::class,
];
}
8 changes: 4 additions & 4 deletions src/Objects/StatsTotalsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* @property int $spam_complaints
* @property int|null $opened
* @property int|null $clicked
* @property StatsInboundData $inbound
* @property StatsTypeData|mixed $transactional
* @property StatsTypeData|mixed $broadcast
* @property \Lettermint\Objects\StatsInboundData $inbound
* @property \Lettermint\Objects\StatsTypeData|null $transactional
* @property \Lettermint\Objects\StatsTypeData|null $broadcast
* @property int|null $observed_opened
* @property int|null $human_opened
* @property int|null $privacy_opened
Expand All @@ -24,6 +24,6 @@
final class StatsTotalsData extends Resource
{
protected static array $casts = [
'inbound' => StatsInboundData::class,
'inbound' => \Lettermint\Objects\StatsInboundData::class,
];
}
1 change: 1 addition & 0 deletions src/Objects/StoreProjectData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @property bool $smtp_enabled
* @property 'both'|'transactional'|'broadcast' $initial_routes
* @property bool $short_token
* @property 'live'|'sandbox' $delivery_mode
*/
final class StoreProjectData extends Resource
{
Expand Down
5 changes: 3 additions & 2 deletions src/Objects/StoreSuppressionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

/**
* @property string|null $email
* @property list<string>|null $emails
* @property 'spam_complaint'|'hard_bounce'|'unsubscribe'|'manual' $reason
* @property 'global'|'team'|'project'|'route' $scope
* @property 'team'|'project'|'route' $scope
* @property string|null $route_id
* @property string|null $project_id
* @property list<string>|null $emails
* @property 'all'|'broadcast'|null $applies_to
*/
final class StoreSuppressionData extends Resource
{
Expand Down
8 changes: 6 additions & 2 deletions src/Objects/StoreWebhookData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
use Lettermint\Resource;

/**
* @property string $route_id
* @property string $name
* @property string $url
* @property list<'message.created'|'message.sent'|'message.delivered'|'message.auto_replied'|'message.hard_bounced'|'message.soft_bounced'|'message.spam_complaint'|'message.failed'|'message.suppressed'|'message.unsubscribed'|'message.opened'|'message.clicked'|'message.inbound'|'message.policy_rejected'|'message.scheduled'|'message.rescheduled'|'message.canceled'|'message.released'|'suppression.added'|'suppression.removed'|'webhook.test'> $events
* @property bool|null $enabled
* @property bool|null $include_machine_events
* @property list<'message.created'|'message.sent'|'message.delivered'|'message.auto_replied'|'message.hard_bounced'|'message.soft_bounced'|'message.spam_complaint'|'message.failed'|'message.suppressed'|'message.unsubscribed'|'message.opened'|'message.clicked'|'message.inbound'|'message.policy_rejected'|'suppression.added'|'suppression.removed'|'webhook.test'> $events
* @property 'team'|'project'|'route'|null $scope
* @property list<string> $project_ids
* @property list<string> $route_ids
* @property string|null $route_id
* @property 'live'|'sandbox'|'both'|null $delivery_mode_filter
*/
final class StoreWebhookData extends Resource
{
Expand Down
10 changes: 4 additions & 6 deletions src/Objects/SuppressedRecipientData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
* @property 'email'|'domain'|'extension' $type
* @property string $value
* @property 'spam_complaint'|'hard_bounce'|'unsubscribe'|'manual' $reason
* @property 'global'|'team'|'project'|'route' $scope
* @property 'team'|'project'|'route' $scope
* @property 'all'|'broadcast' $applies_to
* @property string|null $project_id
* @property string|null $route_id
* @property SuppressionSourceMessageData|null $source_message
* @property \Lettermint\Objects\SuppressionSourceMessageData|null $source_message
* @property string $created_at
* @property string $updated_at
*/
final class SuppressedRecipientData extends Resource
{
protected static array $casts = [
'source_message' => SuppressionSourceMessageData::class,
];
//
}
4 changes: 2 additions & 2 deletions src/Objects/TeamData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @property int $tier
* @property string|null $verified_at
* @property list<string> $features
* @property list<TeamAddonData> $addons
* @property list<\Lettermint\Objects\TeamAddonData> $addons
* @property string $created_at
* @property int $domains_count
* @property int $projects_count
Expand All @@ -22,6 +22,6 @@
final class TeamData extends Resource
{
protected static array $casts = [
'addons' => [TeamAddonData::class],
'addons' => [\Lettermint\Objects\TeamAddonData::class],
];
}
4 changes: 2 additions & 2 deletions src/Objects/TeamMemberData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* @property string $name
* @property string $email
* @property array<string, mixed> $role
* @property TeamMemberProjectAccessData $project_access
* @property \Lettermint\Objects\TeamMemberProjectAccessData $project_access
* @property string|null $joined_at
*/
final class TeamMemberData extends Resource
{
protected static array $casts = [
'project_access' => TeamMemberProjectAccessData::class,
'project_access' => \Lettermint\Objects\TeamMemberProjectAccessData::class,
];
}
2 changes: 1 addition & 1 deletion src/Objects/TeamRoleData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @property string $id
* @property string $name
* @property 'owner'|'admin'|'member'|null $system_key
* @property list<string> $permissions
* @property list<'team:manage'|'billing:manage'|'security:manage'|'audit:read'|'support:manage'|'members:read'|'members:manage'|'roles:manage'|'team_tokens:read'|'team_tokens:manage'|'team_tokens:rotate'|'team_tokens:revoke'|'projects:create'|'team_suppressions:read'|'team_suppressions:add'|'team_suppressions:remove'|'projects:read'|'projects:manage'|'projects:delete'|'routes:read'|'routes:manage'|'routes:delete'|'domains:read'|'domains:manage'|'domains:delete'|'project_tokens:read'|'project_tokens:manage'|'project_tokens:rotate'|'project_tokens:revoke'|'webhooks:read'|'webhooks:manage'|'webhooks:delete'|'webhooks:rotate_secret'|'stats:read'|'messages:read'|'messages:read_content'|'messages:send'|'suppressions:read'|'suppressions:add'|'suppressions:remove'> $permissions
* @property bool $assignable
*/
final class TeamRoleData extends Resource
Expand Down
Loading
Loading