Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De 1306 mailgun sdk webhook index response missing accepted #916

Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
65 changes: 65 additions & 0 deletions src/Model/Webhook/IndexResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ final class IndexResponse implements ApiResponse
private $permanentFail = [];
private $temporaryFail = [];
private $unsubscribed = [];
private $accepted = [];

private function __construct()
{
}

/**
* @param array $data
* @return self
*/
public static function create(array $data): self
{
$model = new self();
Expand All @@ -58,77 +63,137 @@ public static function create(array $data): self
$model->permanentFail = $data['permanent_fail']['urls'] ?? [];
$model->temporaryFail = $data['temporary_fail']['urls'] ?? [];
$model->unsubscribed = $data['unsubscribed']['urls'] ?? [];
$model->accepted = $data['accepted']['urls'] ?? [];

return $model;
}

/**
* @return string|null
*/
public function getBounceUrl(): ?string
{
return $this->legacyBounce;
}

/**
* @return string|null
*/
public function getDeliverUrl(): ?string
{
return $this->legacyDeliver;
}

/**
* @return string|null
*/
public function getDropUrl(): ?string
{
return $this->legacyDrop;
}

/**
* @return string|null
*/
public function getSpamUrl(): ?string
{
return $this->legacySpam;
}

/**
* @return string|null
*/
public function getUnsubscribeUrl(): ?string
{
return $this->legacyUnsubscribe;
}

/**
* @return string|null
*/
public function getClickUrl(): ?string
{
return $this->legacyClick;
}

/**
* @return string|null
*/
public function getOpenUrl(): ?string
{
return $this->legacyOpen;
}

/**
* @return array|null
*/
public function getClickedUrls(): ?array
{
return $this->clicked;
}

/**
* @return array|null
*/
public function getComplainedUrls(): ?array
{
return $this->complained;
}

/**
* @return array|null
*/
public function getDeliveredUrls(): ?array
{
return $this->delivered;
}

/**
* @return array|null
*/
public function getOpenedUrls(): ?array
{
return $this->opened;
}

/**
* @return array|null
*/
public function getPermanentFailUrls(): ?array
{
return $this->permanentFail;
}

/**
* @return array|null
*/
public function getTemporaryFailUrls(): ?array
{
return $this->temporaryFail;
}

/**
* @return array|null
*/
public function getUnsubscribeUrls(): ?array
{
return $this->unsubscribed;
}

/**
* @return array|null
*/
public function getAccepted(): ?array
{
return $this->accepted;
}

/**
* @param array|null $accepted
* @return void
*/
public function setAccepted(?array $accepted): void
{
$this->accepted = $accepted;
}
}
Loading