Supplier.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Climate;
  4. /**
  5. * A supplier of carbon removal.
  6. *
  7. * @property string $id Unique identifier for the object.
  8. * @property string $object String representing the object’s type. Objects of the same type share the same value.
  9. * @property string $info_url Link to a webpage to learn more about the supplier.
  10. * @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.
  11. * @property \Stripe\StripeObject[] $locations The locations in which this supplier operates.
  12. * @property string $name Name of this carbon removal supplier.
  13. * @property string $removal_pathway The scientific pathway used for carbon removal.
  14. */
  15. class Supplier extends \Stripe\ApiResource
  16. {
  17. const OBJECT_NAME = 'climate.supplier';
  18. const REMOVAL_PATHWAY_BIOMASS_CARBON_REMOVAL_AND_STORAGE = 'biomass_carbon_removal_and_storage';
  19. const REMOVAL_PATHWAY_DIRECT_AIR_CAPTURE = 'direct_air_capture';
  20. const REMOVAL_PATHWAY_ENHANCED_WEATHERING = 'enhanced_weathering';
  21. /**
  22. * Lists all available Climate supplier objects.
  23. *
  24. * @param null|array $params
  25. * @param null|array|string $opts
  26. *
  27. * @throws \Stripe\Exception\ApiErrorException if the request fails
  28. *
  29. * @return \Stripe\Collection<\Stripe\Climate\Supplier> of ApiResources
  30. */
  31. public static function all($params = null, $opts = null)
  32. {
  33. $url = static::classUrl();
  34. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  35. }
  36. /**
  37. * Retrieves a Climate supplier object.
  38. *
  39. * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
  40. * @param null|array|string $opts
  41. *
  42. * @throws \Stripe\Exception\ApiErrorException if the request fails
  43. *
  44. * @return \Stripe\Climate\Supplier
  45. */
  46. public static function retrieve($id, $opts = null)
  47. {
  48. $opts = \Stripe\Util\RequestOptions::parse($opts);
  49. $instance = new static($id, $opts);
  50. $instance->refresh();
  51. return $instance;
  52. }
  53. }