<?php

// File generated from our OpenAPI spec

namespace STRP_SUB_Vendor\Stripe\Events;

/**
 * @property \STRP_SUB_Vendor\Stripe\RelatedObject $related_object Object containing the reference to API resource relevant to the event
 */
class V2CoreAccountIncludingIdentityUpdatedEvent extends \STRP_SUB_Vendor\Stripe\V2\Core\Event
{
    const LOOKUP_TYPE = 'v2.core.account[identity].updated';

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

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