wp-user-avatar
/
third-party
/
vendor
/
stripe
/
stripe-php
/
lib
/
Events
/
V1BillingMeterErrorReportTriggeredEvent.php
V1BillingMeterErrorReportTriggeredEvent.php
2 months ago
V1BillingMeterNoMeterFoundEvent.php
2 months ago
V1BillingMeterErrorReportTriggeredEvent.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace ProfilePressVendor\Stripe\Events; |
| 5 | |
| 6 | /** |
| 7 | * @property \Stripe\RelatedObject $related_object Object containing the reference to API resource relevant to the event |
| 8 | * @property \Stripe\EventData\V1BillingMeterErrorReportTriggeredEventData $data data associated with the event |
| 9 | */ |
| 10 | class V1BillingMeterErrorReportTriggeredEvent extends \ProfilePressVendor\Stripe\V2\Event |
| 11 | { |
| 12 | const LOOKUP_TYPE = 'v1.billing.meter.error_report_triggered'; |
| 13 | /** |
| 14 | * Retrieves the related object from the API. Make an API request on every call. |
| 15 | * |
| 16 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 17 | * |
| 18 | * @return \Stripe\Billing\Meter |
| 19 | */ |
| 20 | public function fetchRelatedObject() |
| 21 | { |
| 22 | $apiMode = \ProfilePressVendor\Stripe\Util\Util::getApiMode($this->related_object->url); |
| 23 | list($object, $options) = $this->_request('get', $this->related_object->url, [], ['stripe_account' => $this->context], [], $apiMode); |
| 24 | return \ProfilePressVendor\Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode); |
| 25 | } |
| 26 | public static function constructFrom($values, $opts = null, $apiMode = 'v2') |
| 27 | { |
| 28 | $evt = parent::constructFrom($values, $opts, $apiMode); |
| 29 | if (null !== $evt->data) { |
| 30 | $evt->data = \ProfilePressVendor\Stripe\EventData\V1BillingMeterErrorReportTriggeredEventData::constructFrom($evt->data, $opts, $apiMode); |
| 31 | } |
| 32 | return $evt; |
| 33 | } |
| 34 | } |
| 35 |