Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1659

Merged
merged 12 commits into from
Mar 14, 2024
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 13.14.0 - 2024-03-14
* [#1660](https://github.com/stripe/stripe-php/pull/1660) Update generated code
* Add support for new resources `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle`
* Add support for `all`, `create`, `retrieve`, and `update` methods on resource `PersonalizationDesign`
* Add support for `all` and `retrieve` methods on resource `PhysicalBundle`
* Add support for `personalization_design` on `Issuing.Card`

## 13.14.0-beta.1 - 2024-02-29
* [#1655](https://github.com/stripe/stripe-php/pull/1655) Update generated code for beta
* Remove support for resource `Entitlements.Event`
Expand All @@ -8,10 +15,15 @@
* Add support for `livemode` on `Issuing.PersonalizationDesign`
* [#1656](https://github.com/stripe/stripe-php/pull/1656) Add helper to set beta version

## 13.13.0 - 2024-02-29
* [#1654](https://github.com/stripe/stripe-php/pull/1654) Update generated code
* Change type of `Identity.VerificationSession.type` from `nullable(enum('document'|'id_number'))` to `enum('document'|'id_number')`
* Add resources `Application`, `ConnectCollectionTransfer`, `PlatformTaxFee`, `ReserveTransaction`, `SourceMandateNotification`, and `TaxDeductedAtSource`. These classes have no methods on them, and are used to provide more complete types for PHPDocs.
* [#1657](https://github.com/stripe/stripe-php/pull/1657) Update readme to use addBetaVersion

## 13.13.0-beta.1 - 2024-02-23
* [#1652](https://github.com/stripe/stripe-php/pull/1652) Update generated code for beta


## 13.12.0 - 2024-02-22
* [#1651](https://github.com/stripe/stripe-php/pull/1651) Update generated code
* Add support for `client_reference_id` on `Identity.VerificationReport` and `Identity.VerificationSession`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v855
v879
9 changes: 9 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
require __DIR__ . '/lib/Balance.php';
require __DIR__ . '/lib/BalanceTransaction.php';
require __DIR__ . '/lib/BankAccount.php';
require __DIR__ . '/lib/Billing/Meter.php';
require __DIR__ . '/lib/Billing/MeterEvent.php';
require __DIR__ . '/lib/Billing/MeterEventAdjustment.php';
require __DIR__ . '/lib/Billing/MeterEventSummary.php';
require __DIR__ . '/lib/BillingPortal/Configuration.php';
require __DIR__ . '/lib/BillingPortal/Session.php';
require __DIR__ . '/lib/Capability.php';
Expand Down Expand Up @@ -191,6 +195,10 @@
require __DIR__ . '/lib/Service/Apps/SecretService.php';
require __DIR__ . '/lib/Service/BalanceService.php';
require __DIR__ . '/lib/Service/BalanceTransactionService.php';
require __DIR__ . '/lib/Service/Billing/BillingServiceFactory.php';
require __DIR__ . '/lib/Service/Billing/MeterEventAdjustmentService.php';
require __DIR__ . '/lib/Service/Billing/MeterEventService.php';
require __DIR__ . '/lib/Service/Billing/MeterService.php';
require __DIR__ . '/lib/Service/BillingPortal/BillingPortalServiceFactory.php';
require __DIR__ . '/lib/Service/BillingPortal/ConfigurationService.php';
require __DIR__ . '/lib/Service/BillingPortal/SessionService.php';
Expand Down Expand Up @@ -289,6 +297,7 @@
require __DIR__ . '/lib/Service/Terminal/LocationService.php';
require __DIR__ . '/lib/Service/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/Terminal/TerminalServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/ConfirmationTokenService.php';
require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/AuthorizationService.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php';
Expand Down
89 changes: 89 additions & 0 deletions lib/Billing/Meter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Billing;

/**
* A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then use the billing meter to charge the user for the number of API calls they make.
*
* @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.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property \Stripe\StripeObject $customer_mapping
* @property \Stripe\StripeObject $default_aggregation
* @property string $display_name The meter's name.
* @property string $event_name The name of the usage event to record usage for. Corresponds with the <code>event_name</code> field on usage events.
* @property null|string $event_time_window The time window to pre-aggregate usage events for, if any.
* @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 string $status The meter's status.
* @property \Stripe\StripeObject $status_transitions
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
* @property \Stripe\StripeObject $value_settings
*/
class Meter extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\NestedResource;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;

const EVENT_TIME_WINDOW_DAY = 'day';
const EVENT_TIME_WINDOW_HOUR = 'hour';

const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Billing\Meter the deactivated meter
*/
public function deactivate($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/deactivate';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Billing\Meter the reactivated meter
*/
public function reactivate($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/reactivate';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

const PATH_EVENT_SUMMARIES = '/event_summaries';

/**
* @param string $id the ID of the meter on which to retrieve the meter event summaries
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Billing\MeterEventSummary> the list of meter event summaries
*/
public static function allEventSummaries($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_EVENT_SUMMARIES, $params, $opts);
}
}
24 changes: 24 additions & 0 deletions lib/Billing/MeterEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Billing;

/**
* A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage.
* Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $event_name The name of the meter event. Corresponds with the <code>event_name</code> field on a meter.
* @property string $identifier A unique identifier for the event.
* @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 \Stripe\StripeObject $payload The payload of the event.
* @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
*/
class MeterEvent extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event';

use \Stripe\ApiOperations\Create;
}
22 changes: 22 additions & 0 deletions lib/Billing/MeterEventAdjustment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Billing;

/**
* A billing meter event adjustment represents the status of a meter event adjustment.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @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 string $status The meter event adjustment's status.
*/
class MeterEventAdjustment extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event_adjustment';

use \Stripe\ApiOperations\Create;

const STATUS_COMPLETE = 'complete';
const STATUS_PENDING = 'pending';
}
22 changes: 22 additions & 0 deletions lib/Billing/MeterEventSummary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Billing;

/**
* A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
* usage was accrued by a customer for that period.
*
* @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.
* @property float $aggregated_value Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``.
* @property int $end_time End timestamp for this usage summary (inclusive).
* @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 string $meter The meter associated with this usage summary.
* @property int $start_time Start timestamp for this usage summary (inclusive).
*/
class MeterEventSummary extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event_summary';
}
51 changes: 51 additions & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,23 @@ class Invoice extends ApiResource
const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
const BILLING_SEND_INVOICE = 'send_invoice';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Invoice the added invoice
*/
public function addLines($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/add_lines';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down Expand Up @@ -250,6 +267,23 @@ public function pay($params = null, $opts = null)
return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Invoice the removed invoice
*/
public function removeLines($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/remove_lines';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down Expand Up @@ -303,6 +337,23 @@ public static function upcomingLines($params = null, $opts = null)
return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Invoice the updated invoice
*/
public function updateLines($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/update_lines';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down
2 changes: 2 additions & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* @property null|\Stripe\StripeObject $link
* @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 Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|\Stripe\StripeObject $multibanco
* @property null|\Stripe\StripeObject $oxxo
* @property null|\Stripe\StripeObject $p24
* @property null|\Stripe\StripeObject $paynow
Expand Down Expand Up @@ -89,6 +90,7 @@ class PaymentMethod extends ApiResource
const TYPE_KLARNA = 'klarna';
const TYPE_KONBINI = 'konbini';
const TYPE_LINK = 'link';
const TYPE_MULTIBANCO = 'multibanco';
const TYPE_OXXO = 'oxxo';
const TYPE_P24 = 'p24';
const TYPE_PAYNOW = 'paynow';
Expand Down
1 change: 1 addition & 0 deletions lib/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @property int $interval_count The number of intervals (specified in the <code>interval</code> attribute) between subscription billings. For example, <code>interval=month</code> and <code>interval_count=3</code> bills every 3 months.
* @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 Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|string $meter The meter tracking the usage of a metered price
* @property null|string $nickname A brief description of the plan, hidden from customers.
* @property null|string|\Stripe\Product $product The product whose pricing this plan determines.
* @property null|\Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires <code>billing_scheme</code> to be set to <code>tiered</code>. See also the documentation for <code>billing_scheme</code>.
Expand Down
29 changes: 29 additions & 0 deletions lib/Service/Billing/BillingServiceFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Billing;

/**
* Service factory class for API resources in the Billing namespace.
*
* @property MeterEventAdjustmentService $meterEventAdjustments
* @property MeterEventService $meterEvents
* @property MeterService $meters
*/
class BillingServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
/**
* @var array<string, string>
*/
private static $classMap = [
'meterEventAdjustments' => MeterEventAdjustmentService::class,
'meterEvents' => MeterEventService::class,
'meters' => MeterService::class,
];

protected function getServiceClass($name)
{
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null;
}
}
29 changes: 29 additions & 0 deletions lib/Service/Billing/MeterEventAdjustmentService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\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 billing meter event adjustment.
*
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Billing\MeterEventAdjustment
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/billing/meter_event_adjustments', $params, $opts);
}
}
Loading
Loading