API Requests GetAuthorizationModelRequest - evansims/openfga-php GitHub Wiki

Request for retrieving a specific authorization model by its ID. This request fetches the complete definition of an authorization model, including all type definitions, relations, and conditions. It's useful for inspecting model configurations, debugging, and model management.

Table of Contents


Namespace

OpenFGA\Requests


Source

View source code


Implements


Related Classes


Methods

getModel

public function getModel(): string

Get the authorization model ID to retrieve. Specifies which version of the authorization model should be fetched from the store. Each model has a unique identifier that allows you to retrieve specific versions even as new models are created.

View source


Returns

string — The unique identifier of the authorization model to retrieve


getRequest

public function getRequest(Psr\Http\Message\StreamFactoryInterface $streamFactory): OpenFGA\Network\RequestContext

Build a request context for HTTP execution. Transforms the request object into a standardized HTTP request context that can be executed by the OpenFGA HTTP client. This method handles all aspects of request preparation including parameter serialization, URL construction, header configuration, and body stream creation. The method validates that all required parameters are present and properly formatted, serializes complex objects to JSON, constructs the appropriate API endpoint URL, and creates the necessary HTTP message body streams.

View source


Parameters

Name Type Description
$streamFactory StreamFactoryInterface PSR-7 stream factory for creating request body streams from serialized data

Returns

RequestContext — The prepared request context containing HTTP method, URL, headers, and body ready for execution


getStore

public function getStore(): string

Get the store ID containing the authorization model. Identifies which OpenFGA store contains the authorization model to retrieve. Each store can contain multiple model versions, and this specifies which store context to search within.

View source


Returns

string — The store ID containing the authorization model to retrieve

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