API Responses WriteAssertionsResponse - evansims/openfga-php GitHub Wiki

Response confirming successful writing of test assertions. This response indicates that test assertions have been successfully stored for an authorization model. The assertions can now be used to validate that the model behaves correctly in various authorization scenarios.

Table of Contents


Namespace

OpenFGA\Responses


Source

View source code


Implements


Related Classes


Methods

fromResponse

Implements Responses\WriteAssertionsResponseInterface

public function fromResponse(
    HttpResponseInterface $response,
    HttpRequestInterface $request,
    SchemaValidatorInterface $validator,
): static

Create a response instance from an HTTP response. This method transforms a raw HTTP response from the OpenFGA API into a structured response object, validating and parsing the response data according to the expected schema. It handles both successful responses by parsing and validating the data, and error responses by throwing appropriate exceptions.

View source


Parameters

Name Type Description
$response HttpResponseInterface The raw HTTP response from the OpenFGA API
$request HttpRequestInterface The original HTTP request that generated this response
$validator SchemaValidatorInterface Schema validator for parsing and validating response data

Returns

static — The parsed and validated response instance containing the API response data

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