API Responses GetAuthorizationModelResponse - evansims/openfga-php GitHub Wiki
Response containing a specific authorization model from the store. This response provides the complete authorization model including type definitions, relationships, and conditions. Use this to retrieve and examine the authorization schema that defines how permissions work in your application.
Table of Contents
OpenFGA\Responses
- GetAuthorizationModelResponseInterface (interface)
- GetAuthorizationModelRequest (request)
Implements Responses\GetAuthorizationModelResponseInterface
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.
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 |
static
— The parsed and validated response instance containing the API response data
public function getModel(): ?OpenFGA\Models\AuthorizationModelInterface
Get the retrieved authorization model. Returns the complete authorization model including its type definitions, schema version, and any conditions. The model defines the relationship types and permission logic that govern authorization decisions within the store.
AuthorizationModelInterface
| null
— The authorization model, or null if not found
Implements Responses\GetAuthorizationModelResponseInterface
public function schema(): SchemaInterface
Get the schema definition for this response. Returns the schema that defines the structure and validation rules for authorization model response data, ensuring consistent parsing and validation of API responses.
SchemaInterface
— The schema definition for response validation