Skip to content

Commit

Permalink
Update generated code for v1318
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Oct 23, 2024
1 parent aca5753 commit 9b49ee9
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
require __DIR__ . '/lib/Service/V2/Billing/MeterEventSessionService.php';
require __DIR__ . '/lib/Service/V2/Billing/MeterEventStreamService.php';
require __DIR__ . '/lib/Service/V2/Core/CoreServiceFactory.php';
require __DIR__ . '/lib/Service/V2/Core/EventDestinationService.php';
require __DIR__ . '/lib/Service/V2/Core/EventService.php';
require __DIR__ . '/lib/Service/V2/V2ServiceFactory.php';
require __DIR__ . '/lib/Service/WebhookEndpointService.php';
Expand Down Expand Up @@ -380,6 +381,7 @@
require __DIR__ . '/lib/V2/Billing/MeterEvent.php';
require __DIR__ . '/lib/V2/Billing/MeterEventAdjustment.php';
require __DIR__ . '/lib/V2/Billing/MeterEventSession.php';
require __DIR__ . '/lib/V2/EventDestination.php';
require __DIR__ . '/lib/WebhookEndpoint.php';

// The end of the section generated from our OpenAPI spec
Expand Down
2 changes: 2 additions & 0 deletions lib/Service/V2/Core/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Service factory class for API resources in the root namespace.
* // Doc: The beginning of the section generated from our OpenAPI spec.
*
* @property EventDestinationService $eventDestinations
* @property EventService $events
* // Doc: The end of the section generated from our OpenAPI spec
*/
Expand All @@ -16,6 +17,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
*/
private static $classMap = [
// Class Map: The beginning of the section generated from our OpenAPI spec
'eventDestinations' => EventDestinationService::class,
'events' => EventService::class,
// Class Map: The end of the section generated from our OpenAPI spec
];
Expand Down
138 changes: 138 additions & 0 deletions lib/Service/V2/Core/EventDestinationService.php
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);
}
}
1 change: 1 addition & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class ObjectTypes
\Stripe\V2\Billing\MeterEventAdjustment::OBJECT_NAME => \Stripe\V2\Billing\MeterEventAdjustment::class,
\Stripe\V2\Billing\MeterEventSession::OBJECT_NAME => \Stripe\V2\Billing\MeterEventSession::class,
\Stripe\V2\Event::OBJECT_NAME => \Stripe\V2\Event::class,
\Stripe\V2\EventDestination::OBJECT_NAME => \Stripe\V2\EventDestination::class,
// v2 object classes: The end of the section generated from our OpenAPI spec
];
}
38 changes: 38 additions & 0 deletions lib/V2/EventDestination.php
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';
}

0 comments on commit 9b49ee9

Please sign in to comment.