API Models BatchTupleResultInterface - evansims/openfga-php GitHub Wiki

Interface for batch tuple operation results. Defines the contract for tracking and analyzing the results of batch tuple operations, including success rates, responses, and error handling.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Methods

getErrors

public function getErrors(): array<Throwable>

Get all errors from failed chunks.

View source


Returns

array&lt;Throwable&gt; — Errors from failed API calls


getFailedChunks

public function getFailedChunks(): int

Get the number of chunks that failed.

View source


Returns

int — Number of failed API requests


getFirstError

public function getFirstError(): Throwable|null

Get the first error that occurred.

View source


Returns

Throwable | null — The first error, or null if no errors occurred


getResponses

public function getResponses(): array<mixed>

Get all successful responses from completed chunks.

View source


Returns

array&lt;mixed&gt; — Responses from successful API calls


getSuccessRate

public function getSuccessRate(): float

Calculate the success rate as a percentage.

View source


Returns

float — Success rate from 0.0 to 1.0


getSuccessfulChunks

public function getSuccessfulChunks(): int

Get the number of chunks that completed successfully.

View source


Returns

int — Number of successful API requests


getTotalChunks

public function getTotalChunks(): int

Get the total number of chunks that were processed.

View source


Returns

int — Number of API requests made


getTotalOperations

public function getTotalOperations(): int

Get the total number of tuple operations that were requested.

View source


Returns

int — Total operations across all chunks


isCompleteFailure

public function isCompleteFailure(): bool

Check if all chunks failed.

View source


Returns

bool — True if no chunks succeeded


isCompleteSuccess

public function isCompleteSuccess(): bool

Check if all chunks completed successfully.

View source


Returns

bool — True if no chunks failed


isPartialSuccess

public function isPartialSuccess(): bool

Check if some chunks succeeded and some failed.

View source


Returns

bool — True if there were both successes and failures


jsonSerialize

public function jsonSerialize()

throwOnFailure

public function throwOnFailure(): void

Throw an exception if any chunks failed. If there were failures, throws the first error that occurred. This is useful for treating partial failures as complete failures when strict error handling is required.

View source


Returns

void

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