Skip to content

Commit

Permalink
Merge pull request #916 from mailgun/DE-1306-mailgun-sdk-webhook-inde…
Browse files Browse the repository at this point in the history
…x-response-missing-accepted

De 1306 mailgun sdk webhook index response missing accepted
  • Loading branch information
oleksandr-mykhailenko authored Aug 3, 2024
2 parents 9b6391d + 5bebb3c commit 41d83ac
Showing 1 changed file with 65 additions and 0 deletions.
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;
}
}

0 comments on commit 41d83ac

Please sign in to comment.