API Models DifferenceV1 - evansims/openfga-php GitHub Wiki

Represents a set difference operation between two usersets. In authorization models, you sometimes need to grant access to one group of users while explicitly excluding another group. DifferenceV1 calculates the difference between a base userset and a subtract userset, effectively giving you "all users in base except those in subtract." For example, you might want to grant access to all employees except those in a specific department, or all document viewers except the document owner.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Constants

Name Value Description
OPENAPI_MODEL v1.Difference


Methods

getBase

public function getBase(): OpenFGA\Models\UsersetInterface

Get the base userset from which users will be subtracted. This represents the initial set of users or relationships from which the subtract userset will be removed to compute the final difference.

View source


Returns

UsersetInterface — The base userset for the difference operation


getSubtract

public function getSubtract(): OpenFGA\Models\UsersetInterface

Get the userset of users to subtract from the base userset. This represents the set of users or relationships that should be removed from the base userset to compute the final result of the difference operation.

View source


Returns

UsersetInterface — The userset to subtract from the base


jsonSerialize

public function jsonSerialize(): array

View source


Returns

array


schema

Implements Models\DifferenceV1Interface

public function schema(): SchemaInterface

Get the schema definition for this model. This method returns the schema that defines the structure, validation rules, and serialization behavior for this model class. The schema is used for data validation, transformation, and ensuring consistency across API operations with the OpenFGA service. Each model's schema defines: - Required and optional properties - Data types and format constraints - Nested object relationships - Validation rules and business logic constraints The schema system enables the SDK to automatically validate incoming data, transform between different representations, and ensure compliance with the OpenFGA API specification.

View source


Returns

SchemaInterface — The schema definition containing validation rules and property specifications for this model

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