API Responses CreateStoreResponse - evansims/openfga-php GitHub Wiki
Response confirming successful creation of a new store. This response provides the details of the newly created authorization store, including its unique identifier, name, and creation timestamps. Use the store ID for subsequent operations like managing authorization models and tuples.
Table of Contents
OpenFGA\Responses
- CreateStoreResponseInterface (interface)
- CreateStoreRequest (request)
Implements Responses\CreateStoreResponseInterface
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 getCreatedAt(): DateTimeImmutable
Get the timestamp when the store was created. Returns the exact moment when the store was successfully created in the OpenFGA system. This timestamp is immutable and set by the server upon store creation.
DateTimeImmutable
— The creation timestamp of the store
public function getId(): string
Get the unique identifier of the created store. Returns the system-generated unique identifier for the newly created store. This ID is used in all subsequent API operations to reference this specific store.
string
— The unique store identifier
public function getName(): string
Get the human-readable name of the created store. Returns the descriptive name that was assigned to the store during creation. This name is used for identification and administrative purposes.
string
— The descriptive name of the store
public function getUpdatedAt(): DateTimeImmutable
Get the timestamp when the store was last updated. Returns the timestamp of the most recent modification to the store's metadata. For newly created stores, this will typically match the creation timestamp.
DateTimeImmutable
— The last update timestamp of the store
Implements Responses\CreateStoreResponseInterface
public function schema(): SchemaInterface
Get the schema definition for this response. Returns the schema that defines the structure and validation rules for store creation response data, ensuring consistent parsing and validation of API responses.
SchemaInterface
— The schema definition for response validation