API Models BatchTupleResult - evansims/openfga-php GitHub Wiki
Represents the result of a batch tuple operation. This model tracks the results of processing a batch of tuple operations, including successful chunks, failed chunks, and overall statistics. It provides methods to analyze the success rate and retrieve details about any failures that occurred during processing.
Table of Contents
OpenFGA\Models
BatchTupleResultInterfaceJsonSerializableModelInterface
- BatchTupleResultInterface (interface)
| Name | Value | Description |
|---|---|---|
OPENAPI_MODEL |
BatchTupleResult |
public function getErrors(): arrayGet all errors from failed chunks.
array — Errors from failed API calls
public function getFailedChunks(): intGet the number of chunks that failed.
int — Number of failed API requests
public function getFirstError(): ?ThrowableGet the first error that occurred.
Throwable | null — The first error, or null if no errors occurred
public function getResponses(): arrayGet all successful responses from completed chunks.
array — Responses from successful API calls
public function getSuccessRate(): floatCalculate the success rate as a percentage.
float — Success rate from 0.0 to 1.0
public function getSuccessfulChunks(): intGet the number of chunks that completed successfully.
int — Number of successful API requests
public function getTotalChunks(): intGet the total number of chunks that were processed.
int — Number of API requests made
public function getTotalOperations(): intGet the total number of tuple operations that were requested.
int — Total operations across all chunks
public function isCompleteFailure(): boolCheck if all chunks failed.
bool — True if no chunks succeeded
public function isCompleteSuccess(): boolCheck if all chunks completed successfully.
bool — True if no chunks failed
public function isPartialSuccess(): boolCheck if some chunks succeeded and some failed.
bool — True if there were both successes and failures
public function jsonSerialize(): array<string, mixed>array<string, mixed>
Implements Models\BatchTupleResultInterface
public function schema(): SchemaInterfaceGet the JSON schema for this model.
SchemaInterface — The schema definition
public function throwOnFailure(): voidThrow 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.
void