-
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.
* Update generated code for v1232 * Update generated code for v1233 * Update generated code for v1235 * Update generated code for v1238 * Update generated code for v1243 * Update generated code for v1244 * Update generated code for v1246 * Update generated code for v1252 * Update generated code for v1255 * Update generated code for v1260 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5ed133f
commit 2bb84be
Showing
12 changed files
with
194 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1230 | ||
v1260 |
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
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,96 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe; | ||
|
||
/** | ||
* @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 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 $nickname A brief description of the template, hidden from customers | ||
* @property string $status The status of the template, one of <code>active</code> or <code>archived</code>. | ||
* @property int $version Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering | ||
*/ | ||
class InvoiceRenderingTemplate extends ApiResource | ||
{ | ||
const OBJECT_NAME = 'invoice_rendering_template'; | ||
|
||
const STATUS_ACTIVE = 'active'; | ||
const STATUS_ARCHIVED = 'archived'; | ||
|
||
/** | ||
* List all templates, ordered by creation date, with the most recently created | ||
* template appearing first. | ||
* | ||
* @param null|array $params | ||
* @param null|array|string $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Collection<\Stripe\InvoiceRenderingTemplate> of ApiResources | ||
*/ | ||
public static function all($params = null, $opts = null) | ||
{ | ||
$url = static::classUrl(); | ||
|
||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); | ||
} | ||
|
||
/** | ||
* Retrieves an invoice rendering template with the given ID. It by default returns | ||
* the latest version of the template. Optionally, specify a version to see | ||
* previous versions. | ||
* | ||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key | ||
* @param null|array|string $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\InvoiceRenderingTemplate | ||
*/ | ||
public static function retrieve($id, $opts = null) | ||
{ | ||
$opts = \Stripe\Util\RequestOptions::parse($opts); | ||
$instance = new static($id, $opts); | ||
$instance->refresh(); | ||
|
||
return $instance; | ||
} | ||
|
||
/** | ||
* @param null|array $params | ||
* @param null|array|string $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\InvoiceRenderingTemplate the archived invoice rendering template | ||
*/ | ||
public function archive($params = null, $opts = null) | ||
{ | ||
$url = $this->instanceUrl() . '/archive'; | ||
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\InvoiceRenderingTemplate the unarchived invoice rendering template | ||
*/ | ||
public function unarchive($params = null, $opts = null) | ||
{ | ||
$url = $this->instanceUrl() . '/unarchive'; | ||
list($response, $opts) = $this->_request('post', $url, $params, $opts); | ||
$this->refreshFrom($response, $opts); | ||
|
||
return $this; | ||
} | ||
} |
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,82 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe\Service; | ||
|
||
/** | ||
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions | ||
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions | ||
*/ | ||
class InvoiceRenderingTemplateService extends \Stripe\Service\AbstractService | ||
{ | ||
/** | ||
* List all templates, ordered by creation date, with the most recently created | ||
* template appearing first. | ||
* | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Collection<\Stripe\InvoiceRenderingTemplate> | ||
*/ | ||
public function all($params = null, $opts = null) | ||
{ | ||
return $this->requestCollection('get', '/v1/invoice_rendering_templates', $params, $opts); | ||
} | ||
|
||
/** | ||
* Updates the status of an invoice rendering template to ‘archived’ so no new | ||
* Stripe objects (customers, invoices, etc.) can reference it. The template can | ||
* also no longer be updated. However, if the template is already set on a Stripe | ||
* object, it will continue to be applied on invoices generated by it. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\InvoiceRenderingTemplate | ||
*/ | ||
public function archive($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('post', $this->buildPath('/v1/invoice_rendering_templates/%s/archive', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Retrieves an invoice rendering template with the given ID. It by default returns | ||
* the latest version of the template. Optionally, specify a version to see | ||
* previous versions. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\InvoiceRenderingTemplate | ||
*/ | ||
public function retrieve($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('get', $this->buildPath('/v1/invoice_rendering_templates/%s', $id), $params, $opts); | ||
} | ||
|
||
/** | ||
* Unarchive an invoice rendering template so it can be used on new Stripe objects | ||
* again. | ||
* | ||
* @param string $id | ||
* @param null|array $params | ||
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\InvoiceRenderingTemplate | ||
*/ | ||
public function unarchive($id, $params = null, $opts = null) | ||
{ | ||
return $this->request('post', $this->buildPath('/v1/invoice_rendering_templates/%s/unarchive', $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
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