This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\V2\Billing;
/**
* Service factory class for API resources in the Billing namespace.
*
* @property MeterEventAdjustmentService $meterEventAdjustments
* @property MeterEventService $meterEvents
* @property MeterEventSessionService $meterEventSession
* @property MeterEventStreamService $meterEventStream
*/
class BillingServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
/**
* @var array<string, string>
*/
private static $classMap = [
'meterEventAdjustments' => MeterEventAdjustmentService::class,
'meterEvents' => MeterEventService::class,
'meterEventSession' => MeterEventSessionService::class,
'meterEventStream' => MeterEventStreamService::class,
];
protected function getServiceClass($name)
{
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null;
}
}

View File

@@ -0,0 +1,28 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\V2\Billing;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class MeterEventAdjustmentService extends \Stripe\Service\AbstractService
{
/**
* Creates a meter event adjustment to cancel a previously sent meter event.
*
* @param null|array{cancel: array{identifier: string}, event_name: string, type: string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\V2\Billing\MeterEventAdjustment
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v2/billing/meter_event_adjustments', $params, $opts);
}
}

View File

@@ -0,0 +1,30 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\V2\Billing;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class MeterEventService extends \Stripe\Service\AbstractService
{
/**
* Creates a meter event. Events are validated synchronously, but are processed
* asynchronously. Supports up to 1,000 events per second in livemode. For higher
* rate-limits, please use meter event streams instead.
*
* @param null|array{event_name: string, identifier?: string, payload: array<string, string>, timestamp?: string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\V2\Billing\MeterEvent
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v2/billing/meter_events', $params, $opts);
}
}

View File

@@ -0,0 +1,30 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\V2\Billing;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class MeterEventSessionService extends \Stripe\Service\AbstractService
{
/**
* Creates a meter event session to send usage on the high-throughput meter event
* stream. Authentication tokens are only valid for 15 minutes, so you will need to
* create a new meter event session when your token expires.
*
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\V2\Billing\MeterEventSession
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v2/billing/meter_event_session', $params, $opts);
}
}

View File

@@ -0,0 +1,34 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\V2\Billing;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class MeterEventStreamService extends \Stripe\Service\AbstractService
{
/**
* Creates meter events. Events are processed asynchronously, including validation.
* Requires a meter event session for authentication. Supports up to 10,000
* requests per second in livemode. For even higher rate-limits, contact sales.
*
* @param null|array{events: array{event_name: string, identifier?: string, payload: array<string, string>, timestamp?: string}[]} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return void
*
* @throws \Stripe\Exception\TemporarySessionExpiredException
*/
public function create($params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (!isset($opts->apiBase)) {
$opts->apiBase = $this->getClient()->getMeterEventsBase();
}
$this->request('post', '/v2/billing/meter_event_stream', $params, $opts);
}
}