Skip to content

Commit 9b49ee9

Browse files
Update generated code for v1318
1 parent aca5753 commit 9b49ee9

File tree

5 files changed

+181
-0
lines changed

5 files changed

+181
-0
lines changed

init.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@
332332
require __DIR__ . '/lib/Service/V2/Billing/MeterEventSessionService.php';
333333
require __DIR__ . '/lib/Service/V2/Billing/MeterEventStreamService.php';
334334
require __DIR__ . '/lib/Service/V2/Core/CoreServiceFactory.php';
335+
require __DIR__ . '/lib/Service/V2/Core/EventDestinationService.php';
335336
require __DIR__ . '/lib/Service/V2/Core/EventService.php';
336337
require __DIR__ . '/lib/Service/V2/V2ServiceFactory.php';
337338
require __DIR__ . '/lib/Service/WebhookEndpointService.php';
@@ -380,6 +381,7 @@
380381
require __DIR__ . '/lib/V2/Billing/MeterEvent.php';
381382
require __DIR__ . '/lib/V2/Billing/MeterEventAdjustment.php';
382383
require __DIR__ . '/lib/V2/Billing/MeterEventSession.php';
384+
require __DIR__ . '/lib/V2/EventDestination.php';
383385
require __DIR__ . '/lib/WebhookEndpoint.php';
384386

385387
// The end of the section generated from our OpenAPI spec

lib/Service/V2/Core/CoreServiceFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Service factory class for API resources in the root namespace.
77
* // Doc: The beginning of the section generated from our OpenAPI spec.
88
*
9+
* @property EventDestinationService $eventDestinations
910
* @property EventService $events
1011
* // Doc: The end of the section generated from our OpenAPI spec
1112
*/
@@ -16,6 +17,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
1617
*/
1718
private static $classMap = [
1819
// Class Map: The beginning of the section generated from our OpenAPI spec
20+
'eventDestinations' => EventDestinationService::class,
1921
'events' => EventService::class,
2022
// Class Map: The end of the section generated from our OpenAPI spec
2123
];
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?php
2+
3+
// File generated from our OpenAPI spec
4+
5+
namespace Stripe\Service\V2\Core;
6+
7+
/**
8+
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
9+
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
10+
*/
11+
class EventDestinationService extends \Stripe\Service\AbstractService
12+
{
13+
/**
14+
* Lists all event destinations.
15+
*
16+
* @param null|array $params
17+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
18+
*
19+
* @throws \Stripe\Exception\ApiErrorException if the request fails
20+
*
21+
* @return \Stripe\V2\Collection<\Stripe\V2\EventDestination>
22+
*/
23+
public function all($params = null, $opts = null)
24+
{
25+
return $this->requestCollection('get', '/v2/core/event_destinations', $params, $opts);
26+
}
27+
28+
/**
29+
* Create a new event destination.
30+
*
31+
* @param null|array $params
32+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
33+
*
34+
* @throws \Stripe\Exception\ApiErrorException if the request fails
35+
*
36+
* @return \Stripe\V2\EventDestination
37+
*/
38+
public function create($params = null, $opts = null)
39+
{
40+
return $this->request('post', '/v2/core/event_destinations', $params, $opts);
41+
}
42+
43+
/**
44+
* Delete an event destination.
45+
*
46+
* @param string $id
47+
* @param null|array $params
48+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
49+
*
50+
* @throws \Stripe\Exception\ApiErrorException if the request fails
51+
*
52+
* @return \Stripe\V2\EventDestination
53+
*/
54+
public function delete($id, $params = null, $opts = null)
55+
{
56+
return $this->request('delete', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts);
57+
}
58+
59+
/**
60+
* Disable an event destination.
61+
*
62+
* @param string $id
63+
* @param null|array $params
64+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
65+
*
66+
* @throws \Stripe\Exception\ApiErrorException if the request fails
67+
*
68+
* @return \Stripe\V2\EventDestination
69+
*/
70+
public function disable($id, $params = null, $opts = null)
71+
{
72+
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/disable', $id), $params, $opts);
73+
}
74+
75+
/**
76+
* Enable an event destination.
77+
*
78+
* @param string $id
79+
* @param null|array $params
80+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
81+
*
82+
* @throws \Stripe\Exception\ApiErrorException if the request fails
83+
*
84+
* @return \Stripe\V2\EventDestination
85+
*/
86+
public function enable($id, $params = null, $opts = null)
87+
{
88+
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/enable', $id), $params, $opts);
89+
}
90+
91+
/**
92+
* Send a `ping` event to an event destination.
93+
*
94+
* @param string $id
95+
* @param null|array $params
96+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
97+
*
98+
* @throws \Stripe\Exception\ApiErrorException if the request fails
99+
*
100+
* @return \Stripe\V2\Event
101+
*/
102+
public function ping($id, $params = null, $opts = null)
103+
{
104+
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/ping', $id), $params, $opts);
105+
}
106+
107+
/**
108+
* Retrieves the details of an event destination.
109+
*
110+
* @param string $id
111+
* @param null|array $params
112+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
113+
*
114+
* @throws \Stripe\Exception\ApiErrorException if the request fails
115+
*
116+
* @return \Stripe\V2\EventDestination
117+
*/
118+
public function retrieve($id, $params = null, $opts = null)
119+
{
120+
return $this->request('get', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts);
121+
}
122+
123+
/**
124+
* Update the details of an event destination.
125+
*
126+
* @param string $id
127+
* @param null|array $params
128+
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
129+
*
130+
* @throws \Stripe\Exception\ApiErrorException if the request fails
131+
*
132+
* @return \Stripe\V2\EventDestination
133+
*/
134+
public function update($id, $params = null, $opts = null)
135+
{
136+
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts);
137+
}
138+
}

lib/Util/ObjectTypes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class ObjectTypes
168168
\Stripe\V2\Billing\MeterEventAdjustment::OBJECT_NAME => \Stripe\V2\Billing\MeterEventAdjustment::class,
169169
\Stripe\V2\Billing\MeterEventSession::OBJECT_NAME => \Stripe\V2\Billing\MeterEventSession::class,
170170
\Stripe\V2\Event::OBJECT_NAME => \Stripe\V2\Event::class,
171+
\Stripe\V2\EventDestination::OBJECT_NAME => \Stripe\V2\EventDestination::class,
171172
// v2 object classes: The end of the section generated from our OpenAPI spec
172173
];
173174
}

lib/V2/EventDestination.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
// File generated from our OpenAPI spec
4+
5+
namespace Stripe\V2;
6+
7+
/**
8+
* @property string $id Unique identifier for the object.
9+
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
10+
* @property null|\Stripe\StripeObject $amazon_eventbridge Amazon EventBridge configuration.
11+
* @property int $created Time at which the object was created.
12+
* @property string $description An optional description of what the event destination is used for.
13+
* @property string[] $enabled_events The list of events to enable for this endpoint.
14+
* @property string $event_payload Payload type of events being subscribed to.
15+
* @property null|string[] $events_from Where events should be routed from.
16+
* @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.
17+
* @property null|\Stripe\StripeObject $metadata Metadata.
18+
* @property string $name Event destination name.
19+
* @property null|string $snapshot_api_version If using the snapshot event payload, the API version events are rendered as.
20+
* @property string $status Status. It can be set to either enabled or disabled.
21+
* @property null|\Stripe\StripeObject $status_details Additional information about event destination status.
22+
* @property string $type Event destination type.
23+
* @property int $updated Time at which the object was last updated.
24+
* @property null|\Stripe\StripeObject $webhook_endpoint Webhook endpoint configuration.
25+
*/
26+
class EventDestination extends \Stripe\ApiResource
27+
{
28+
const OBJECT_NAME = 'v2.core.event_destination';
29+
30+
const EVENT_PAYLOAD_SNAPSHOT = 'snapshot';
31+
const EVENT_PAYLOAD_THIN = 'thin';
32+
33+
const STATUS_DISABLED = 'disabled';
34+
const STATUS_ENABLED = 'enabled';
35+
36+
const TYPE_AMAZON_EVENTBRIDGE = 'amazon_eventbridge';
37+
const TYPE_WEBHOOK_ENDPOINT = 'webhook_endpoint';
38+
}

0 commit comments

Comments
 (0)