GetProductActionsAsync
Gets the list of available product actions that can be taken against players. This method is only available to dev players.
Method Signature
public async Task<ProductActionsResponse> GetProductActionsAsync()
Parameters
This method takes no parameters.
Returns
Returns a ProductActionsResponse object containing the list of available product actions, or null if the request failed or the caller is not a dev player.
Usage Example
var actionsResponse = await PlaySafeManager.Instance.GetProductActionsAsync();
if (actionsResponse != null && actionsResponse.Ok && actionsResponse.Data != null)
{
foreach (var action in actionsResponse.Data)
{
Debug.Log($"Action: {action.Name} (ID: {action.Id}, Permanent: {action.IsPermanent})");
}
}
Response Type
ProductActionsResponse
public class ProductActionsResponse
{
public bool Ok { get; set; }
public List<ProductActionData> Data { get; set; }
public string Message { get; set; }
}
ProductActionData
public class ProductActionData
{
public string Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Value { get; set; }
public bool IsPermanent { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
Properties
| Property | Type | Description |
|---|---|---|
Ok | bool | Indicates whether the request was successful |
Data | List<ProductActionData> | The list of available product actions |
Data[].Id | string | The unique ID of the product action |
Data[].Name | string | The display name of the action (e.g. "Temp Voice Ban") |
Data[].Description | string | A description of what the action does |
Data[].Value | string | The machine-readable action value (e.g. "temp_voice_ban") |
Data[].IsPermanent | bool | Whether the action is permanent |
Message | string | Response message from the server |
Error Handling
The method returns null if:
- The current player is not a dev player
- Network request fails
- Response parsing fails
Always check for null and verify the Ok property before accessing the data.
Notes
- This method is only available to dev players. Non-dev players will receive a warning and the method will return
null. - Use the
Idfrom the returned product actions when callingTakeManualActionOnPlayerAsync(). - Product actions are configured in the PlaySafe dashboard.