Product.php
61 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | |
| 5 | namespace AmeliaVendor\Stripe\Climate; |
| 6 | |
| 7 | /** |
| 8 | * A Climate product represents a type of carbon removal unit available for reservation. |
| 9 | * You can retrieve it to see the current price and availability. |
| 10 | * |
| 11 | * @property string $id Unique identifier for the object. For convenience, Climate product IDs are human-readable strings that start with <code>climsku_</code>. See <a href="https://stripe.com/docs/climate/orders/carbon-removal-inventory">carbon removal inventory</a> for a list of available carbon removal products. |
| 12 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 13 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 14 | * @property \AmeliaVendor\Stripe\StripeObject $current_prices_per_metric_ton Current prices for a metric ton of carbon removal in a currency's smallest unit. |
| 15 | * @property null|int $delivery_year The year in which the carbon removal is expected to be delivered. |
| 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 string $metric_tons_available The quantity of metric tons available for reservation. |
| 18 | * @property string $name The Climate product's name. |
| 19 | * @property Supplier[] $suppliers The carbon removal suppliers that fulfill orders for this Climate product. |
| 20 | */ |
| 21 | class Product extends \AmeliaVendor\Stripe\ApiResource |
| 22 | { |
| 23 | const OBJECT_NAME = 'climate.product'; |
| 24 | |
| 25 | /** |
| 26 | * Lists all available Climate product objects. |
| 27 | * |
| 28 | * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params |
| 29 | * @param null|array|string $opts |
| 30 | * |
| 31 | * @return \AmeliaVendor\Stripe\Collection<Product> of ApiResources |
| 32 | * |
| 33 | * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails |
| 34 | */ |
| 35 | public static function all($params = null, $opts = null) |
| 36 | { |
| 37 | $url = static::classUrl(); |
| 38 | |
| 39 | return static::_requestPage($url, \AmeliaVendor\Stripe\Collection::class, $params, $opts); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Retrieves the details of a Climate product with the given ID. |
| 44 | * |
| 45 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key |
| 46 | * @param null|array|string $opts |
| 47 | * |
| 48 | * @return Product |
| 49 | * |
| 50 | * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails |
| 51 | */ |
| 52 | public static function retrieve($id, $opts = null) |
| 53 | { |
| 54 | $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts); |
| 55 | $instance = new static($id, $opts); |
| 56 | $instance->refresh(); |
| 57 | |
| 58 | return $instance; |
| 59 | } |
| 60 | } |
| 61 |