API Events HttpResponseReceivedEvent - evansims/openfga-php GitHub Wiki

Event fired when an HTTP response is received from the OpenFGA API. This event contains both the request and response for complete telemetry tracking.

Table of Contents


Namespace

OpenFGA\Events


Source

View source code


Implements


Methods

getEventId

public function getEventId(): string

Get the unique identifier for this event.

View source


Returns

string — A unique identifier for the event instance


getEventType

public function getEventType(): string

Get the name/type of this event.

View source


Returns

string — The event type identifier


getException

public function getException(): Throwable|null

Get the exception if the request failed.

View source


Returns

Throwable | null — The exception or null if the request succeeded


getModelId

public function getModelId(): string|null

Get the model ID for the operation.

View source


Returns

string | null — The model ID or null if not applicable


getOccurredAt

public function getOccurredAt(): DateTimeImmutable

Get when this event occurred.

View source


Returns

DateTimeImmutable — The timestamp when the event was created


getOperation

public function getOperation(): string

Get the OpenFGA operation name.

View source


Returns

string — The operation name (for example, 'check', 'write', 'read')


getPayload

public function getPayload(): array

Get the event payload data.

View source


Returns

array — The event data


getRequest

public function getRequest(): RequestInterface

Get the HTTP request that was sent.

View source


Returns

RequestInterface — The PSR-7 request object


getResponse

public function getResponse(): ResponseInterface|null

Get the HTTP response received.

View source


Returns

ResponseInterface | null — The PSR-7 response object or null if an exception occurred


getStoreId

public function getStoreId(): string|null

Get the store ID for the operation.

View source


Returns

string | null — The store ID or null if not applicable


isPropagationStopped

public function isPropagationStopped(): bool

Check if event propagation should be stopped.

View source


Returns

bool — True if propagation should be stopped


isSuccessful

public function isSuccessful(): bool

Check if the HTTP request was successful.

View source


Returns

bool — True if no exception occurred, false otherwise


stopPropagation

public function stopPropagation(): void

Stop event propagation to remaining listeners.

View source


Returns

void

⚠️ **GitHub.com Fallback** ⚠️