<?php

// File generated from our OpenAPI spec

namespace ChamaWP\Vendor\Stripe\Events;

/**
 * @property \ChamaWP\Vendor\Stripe\RelatedObject $related_object Object containing the reference to API resource relevant to the event
 *
 * @license MIT
 * Modified by __root__ on 22-June-2025 using {@see https://github.com/BrianHenryIE/strauss}.
 */
class V2CoreEventDestinationPingEvent extends \ChamaWP\Vendor\Stripe\V2\Event
{
    const LOOKUP_TYPE = 'v2.core.event_destination.ping';

    /**
     * Retrieves the related object from the API. Make an API request on every call.
     *
     * @return \ChamaWP\Vendor\Stripe\V2\EventDestination
     *
     * @throws \ChamaWP\Vendor\Stripe\Exception\ApiErrorException if the request fails
     */
    public function fetchRelatedObject()
    {
        $apiMode = \ChamaWP\Vendor\Stripe\Util\Util::getApiMode($this->related_object->url);
        list($object, $options) = $this->_request(
            'get',
            $this->related_object->url,
            [],
            ['stripe_account' => $this->context],
            [],
            $apiMode
        );

        return \ChamaWP\Vendor\Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode);
    }
}
