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