-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aca5753
commit 9b49ee9
Showing
5 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe\Service\V2\Core; | ||
|
||
/** | ||
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions | ||
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions | ||
*/ | ||
class EventDestinationService extends \Stripe\Service\AbstractService | ||
{ | ||
/** | ||
* Lists all event destinations. | ||
* | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\Collection<\Stripe\V2\EventDestination> | ||
*/ | ||
public function all($params = null, $opts = null) | ||
{ | ||
return $this->requestCollection('get', '/v2/core/event_destinations', $params, $opts); | ||
} | ||
|
||
/** | ||
* Create a new event destination. | ||
* | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\EventDestination | ||
*/ | ||
public function create($params = null, $opts = null) | ||
{ | ||
return $this->request('post', '/v2/core/event_destinations', $params, $opts); | ||
} | ||
|
||
/** | ||
* Delete an event destination. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\EventDestination | ||
*/ | ||
public function delete($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('delete', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Disable an event destination. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\EventDestination | ||
*/ | ||
public function disable($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/disable', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Enable an event destination. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\EventDestination | ||
*/ | ||
public function enable($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/enable', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Send a `ping` event to an event destination. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\Event | ||
*/ | ||
public function ping($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/ping', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Retrieves the details of an event destination. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\EventDestination | ||
*/ | ||
public function retrieve($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('get', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Update the details of an event destination. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\V2\EventDestination | ||
*/ | ||
public function update($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe\V2; | ||
|
||
/** | ||
* @property string $id Unique identifier for the object. | ||
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field. | ||
* @property null|\Stripe\StripeObject $amazon_eventbridge Amazon EventBridge configuration. | ||
* @property int $created Time at which the object was created. | ||
* @property string $description An optional description of what the event destination is used for. | ||
* @property string[] $enabled_events The list of events to enable for this endpoint. | ||
* @property string $event_payload Payload type of events being subscribed to. | ||
* @property null|string[] $events_from Where events should be routed from. | ||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | ||
* @property null|\Stripe\StripeObject $metadata Metadata. | ||
* @property string $name Event destination name. | ||
* @property null|string $snapshot_api_version If using the snapshot event payload, the API version events are rendered as. | ||
* @property string $status Status. It can be set to either enabled or disabled. | ||
* @property null|\Stripe\StripeObject $status_details Additional information about event destination status. | ||
* @property string $type Event destination type. | ||
* @property int $updated Time at which the object was last updated. | ||
* @property null|\Stripe\StripeObject $webhook_endpoint Webhook endpoint configuration. | ||
*/ | ||
class EventDestination extends \Stripe\ApiResource | ||
{ | ||
const OBJECT_NAME = 'v2.core.event_destination'; | ||
|
||
const EVENT_PAYLOAD_SNAPSHOT = 'snapshot'; | ||
const EVENT_PAYLOAD_THIN = 'thin'; | ||
|
||
const STATUS_DISABLED = 'disabled'; | ||
const STATUS_ENABLED = 'enabled'; | ||
|
||
const TYPE_AMAZON_EVENTBRIDGE = 'amazon_eventbridge'; | ||
const TYPE_WEBHOOK_ENDPOINT = 'webhook_endpoint'; | ||
} |