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
45 changes: 45 additions & 0 deletions lib/Model/CreateWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,47 @@ public static function getters()
return self::$getters;
}

const EVENTS_HARD_BOUNCE = 'hardBounce';
const EVENTS_SOFT_BOUNCE = 'softBounce';
const EVENTS_BLOCKED = 'blocked';
const EVENTS_SPAM = 'spam';
const EVENTS_DELIVERED = 'delivered';
const EVENTS_REQUEST = 'request';
const EVENTS_CLICK = 'click';
const EVENTS_INVALID = 'invalid';
const EVENTS_DEFERRED = 'deferred';
const EVENTS_OPENED = 'opened';
const EVENTS_UNIQUE_OPENED = 'uniqueOpened';
const EVENTS_UNSUBSCRIBED = 'unsubscribed';
const EVENTS_LIST_ADDITION = 'listAddition';
const TYPE_TRANSACTIONAL = 'transactional';
const TYPE_MARKETING = 'marketing';



/**
* Gets allowable values of the enum
* @return string[]
*/
public function getEventsAllowableValues()
{
return [
self::EVENTS_HARD_BOUNCE,
self::EVENTS_SOFT_BOUNCE,
self::EVENTS_BLOCKED,
self::EVENTS_SPAM,
self::EVENTS_DELIVERED,
self::EVENTS_REQUEST,
self::EVENTS_CLICK,
self::EVENTS_INVALID,
self::EVENTS_DEFERRED,
self::EVENTS_OPENED,
self::EVENTS_UNIQUE_OPENED,
self::EVENTS_UNSUBSCRIBED,
self::EVENTS_LIST_ADDITION,
];
}

/**
* Gets allowable values of the enum
* @return string[]
Expand Down Expand Up @@ -268,6 +304,15 @@ public function getEvents()
*/
public function setEvents($events)
{
$allowed_values = $this->getEventsAllowableValues();
if (!is_null($events) && array_diff($events, $allowed_values)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'events', must be one of '%s'",
implode("', '", $allowed_values)
)
);
}
$this->container['events'] = $events;

return $this;
Expand Down
45 changes: 45 additions & 0 deletions lib/Model/UpdateWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,45 @@ public static function getters()
return self::$getters;
}

const EVENTS_HARD_BOUNCE = 'hardBounce';
const EVENTS_SOFT_BOUNCE = 'softBounce';
const EVENTS_BLOCKED = 'blocked';
const EVENTS_SPAM = 'spam';
const EVENTS_DELIVERED = 'delivered';
const EVENTS_REQUEST = 'request';
const EVENTS_CLICK = 'click';
const EVENTS_INVALID = 'invalid';
const EVENTS_DEFERRED = 'deferred';
const EVENTS_OPENED = 'opened';
const EVENTS_UNIQUE_OPENED = 'uniqueOpened';
const EVENTS_UNSUBSCRIBED = 'unsubscribed';
const EVENTS_LIST_ADDITION = 'listAddition';



/**
* Gets allowable values of the enum
* @return string[]
*/
public function getEventsAllowableValues()
{
return [
self::EVENTS_HARD_BOUNCE,
self::EVENTS_SOFT_BOUNCE,
self::EVENTS_BLOCKED,
self::EVENTS_SPAM,
self::EVENTS_DELIVERED,
self::EVENTS_REQUEST,
self::EVENTS_CLICK,
self::EVENTS_INVALID,
self::EVENTS_DEFERRED,
self::EVENTS_OPENED,
self::EVENTS_UNIQUE_OPENED,
self::EVENTS_UNSUBSCRIBED,
self::EVENTS_LIST_ADDITION,
];
}


/**
* Associative array for storing property values
Expand Down Expand Up @@ -230,6 +266,15 @@ public function getEvents()
*/
public function setEvents($events)
{
$allowed_values = $this->getEventsAllowableValues();
if (!is_null($events) && array_diff($events, $allowed_values)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'events', must be one of '%s'",
implode("', '", $allowed_values)
)
);
}
$this->container['events'] = $events;

return $this;
Expand Down