API Responses CreateAuthorizationModelResponse - evansims/openfga-php GitHub Wiki
Response confirming successful creation of a new authorization model. This response provides the unique identifier of the newly created authorization model, which can be used for subsequent operations like checks, expansions, and model management activities.
Table of Contents
OpenFGA\Responses
- CreateAuthorizationModelResponseInterface (interface)
- CreateAuthorizationModelRequest (request)
Implements Responses\CreateAuthorizationModelResponseInterface
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(): string
Get the unique identifier of the created authorization model. Returns the system-generated unique identifier for the newly created authorization model. This ID is used in subsequent API operations to reference this specific model version for authorization checks and other operations.
string
— The unique authorization model identifier
Implements Responses\CreateAuthorizationModelResponseInterface
public function schema(): SchemaInterface
Get the schema definition for this response. Returns the schema that defines the structure and validation rules for authorization model creation response data, ensuring consistent parsing and validation of API responses.
SchemaInterface
— The schema definition for response validation