FeatureFlags
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- addFlagTarget() : mixed
- Add a feature flag target
- disableFeatureFlag() : FeatureFlag
- Disable a feature flag
- enableFeatureFlag() : FeatureFlag
- Enable a feature flag
- getFeatureFlag() : Flag
- Get a feature flag
- listFeatureFlags() : PaginatedResponse<string|int, Flag>
- List feature flags
- listOrganizationFeatureFlags() : PaginatedResponse<string|int, Flag>
- List enabled feature flags for an organization
- listUserFeatureFlags() : PaginatedResponse<string|int, Flag>
- List enabled feature flags for a user
- removeFlagTarget() : void
- Remove a feature flag target
Properties
$client read-only
private
HttpClient
$client
Methods
__construct()
public
__construct(HttpClient $client) : mixed
Parameters
- $client : HttpClient
addFlagTarget()
Add a feature flag target
public
addFlagTarget(string $resourceId, string $slug[, RequestOptions|null $options = null ]) : mixed
Enables a feature flag for a specific target in the current environment. Currently, supported targets include users and organizations.
Parameters
- $resourceId : string
-
The resource ID in format "user_
" or "org_ ". - $slug : string
-
The unique slug identifier of the feature flag.
- $options : RequestOptions|null = null
Tags
disableFeatureFlag()
Disable a feature flag
public
disableFeatureFlag(string $slug[, RequestOptions|null $options = null ]) : FeatureFlag
Disables a feature flag in the current environment.
Parameters
- $slug : string
-
A unique key to reference the Feature Flag.
- $options : RequestOptions|null = null
Tags
Return values
FeatureFlagenableFeatureFlag()
Enable a feature flag
public
enableFeatureFlag(string $slug[, RequestOptions|null $options = null ]) : FeatureFlag
Enables a feature flag in the current environment.
Parameters
- $slug : string
-
A unique key to reference the Feature Flag.
- $options : RequestOptions|null = null
Tags
Return values
FeatureFlaggetFeatureFlag()
Get a feature flag
public
getFeatureFlag(string $slug[, RequestOptions|null $options = null ]) : Flag
Get the details of an existing feature flag by its slug.
Parameters
- $slug : string
-
A unique key to reference the Feature Flag.
- $options : RequestOptions|null = null
Tags
Return values
FlaglistFeatureFlags()
List feature flags
public
listFeatureFlags([string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, Flag>
Get a list of all of your existing feature flags matching the criteria specified.
Parameters
- $before : string|null = null
-
An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
- $after : string|null = null
-
An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
- $limit : int|null = null
-
Upper limit on the number of objects to return, between
1and100. Defaults to 10. - $order : EventsOrder = EventsOrder::Desc
-
Order the results by the creation time. Defaults to "desc".
- $options : RequestOptions|null = null
Tags
Return values
PaginatedResponse<string|int, Flag>listOrganizationFeatureFlags()
List enabled feature flags for an organization
public
listOrganizationFeatureFlags(string $organizationId[, string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, Flag>
Get a list of all enabled feature flags for an organization.
Parameters
- $organizationId : string
-
Unique identifier of the Organization.
- $before : string|null = null
-
An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
- $after : string|null = null
-
An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
- $limit : int|null = null
-
Upper limit on the number of objects to return, between
1and100. Defaults to 10. - $order : EventsOrder = EventsOrder::Desc
-
Order the results by the creation time. Defaults to "desc".
- $options : RequestOptions|null = null
Tags
Return values
PaginatedResponse<string|int, Flag>listUserFeatureFlags()
List enabled feature flags for a user
public
listUserFeatureFlags(string $userId[, string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, Flag>
Get a list of all enabled feature flags for the provided user. This includes feature flags enabled specifically for the user as well as any organizations that the user is a member of.
Parameters
- $userId : string
-
The ID of the user.
- $before : string|null = null
-
An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
- $after : string|null = null
-
An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
- $limit : int|null = null
-
Upper limit on the number of objects to return, between
1and100. Defaults to 10. - $order : EventsOrder = EventsOrder::Desc
-
Order the results by the creation time. Defaults to "desc".
- $options : RequestOptions|null = null
Tags
Return values
PaginatedResponse<string|int, Flag>removeFlagTarget()
Remove a feature flag target
public
removeFlagTarget(string $resourceId, string $slug[, RequestOptions|null $options = null ]) : void
Removes a target from the feature flag's target list in the current environment. Currently, supported targets include users and organizations.
Parameters
- $resourceId : string
-
The resource ID in format "user_
" or "org_ ". - $slug : string
-
The unique slug identifier of the feature flag.
- $options : RequestOptions|null = null