Class RemoteConfigWebApiClient
This is a utility class for Remote Config to handle all Remote Config CRUD operations.
Namespace: Unity.RemoteConfig.Editor
Syntax
public static class RemoteConfigWebApiClient
Properties
webRequestsAreDone
Checks if there are any unfinished web requests. Returns true if all web requests are done.
Declaration
public static bool webRequestsAreDone { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
CreateEnvironment(String, String, Action<Exception>)
Creates new environment.
Declaration
public static void CreateEnvironment(string cloudProjectId, string environmentName, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentName | Name of the environment to be created. |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
DeleteConfig(String, String)
Sends a DELETE request to delete aconfig.
Declaration
public static void DeleteConfig(string cloudProjectId, string configId)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | configId | ID of the config to be deleted |
DeleteEnvironment(String, String)
Sends a DELETE request to delete an environment.
Declaration
public static void DeleteEnvironment(string cloudProjectId, string environmentId)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment to be deleted |
DeleteRule(String, String, String)
Delete a rule from the given environment.
Declaration
public static void DeleteRule(string cloudProjectId, string environmentId, string ruleId)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment where the rule was deleted from |
String | ruleId | ID of the deleted rule |
FetchConfigs(String, String, Action<Exception>)
Fetches all configs for the given environment ID.
Declaration
public static void FetchConfigs(string cloudProjectId, string environmentId, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment that we want to fetch configs for |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
FetchDefaultEnvironment(String, Action<Exception>)
Fetches default environment for the current project.
Declaration
public static void FetchDefaultEnvironment(string cloudProjectId, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
FetchEnvironments(String, Action<Exception>)
Fetches all environments for the current project.
Declaration
public static void FetchEnvironments(string cloudProjectId, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
FetchRules(String, String, Action<Exception>)
Fetches all rules for the given config ID.
Declaration
public static void FetchRules(string cloudProjectId, string configId, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | configId | ID of the config that we want to fetch rules for |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
PostAddRule(String, String, String, JObject, Action<Exception>)
Sends a POST request to add a new rule to the given config in the given environment.
Declaration
public static void PostAddRule(string cloudProjectId, string environmentId, string configId, JObject rule, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment where the new rule was added |
String | configId | ID of the config containing this rule |
JObject | rule | The rule that was added |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
PostConfig(String, String, JArray, Action<Exception>)
Pushes a new config to the server in the given environment.
Declaration
public static void PostConfig(string cloudProjectId, string environmentId, JArray configValue, Action<Exception> responseParseErrorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment containing the config to be pushed. |
JArray | configValue | List of settings to be pushed. |
Action<Exception> | responseParseErrorCallback | Optional callback for parsing errors. |
PutConfig(String, String, String, JArray)
Pushes updates to the given existing config to the server for the given environment.
Declaration
public static void PutConfig(string cloudProjectId, string environmentId, string configId, JArray configValue)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment containing the config to be pushed. |
String | configId | ID of the config to be pushed. |
JArray | configValue | List of settings to be pushed. |
PutEditRule(String, String, String, JObject)
Sends a PUT request to update a rule in the given environment and config.
Declaration
public static void PutEditRule(string cloudProjectId, string environmentId, string configId, JObject rule)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment where the updated rule exists |
String | configId | ID of the config where the updated rule exists |
JObject | rule | The updated rule with the new attributes |
SetDefaultEnvironment(String, String)
Sets default environment.
Declaration
public static void SetDefaultEnvironment(string cloudProjectId, string environmentId)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment to be updated |
UpdateEnvironment(String, String, String)
Sends a PUT request to update an environment.
Declaration
public static void UpdateEnvironment(string cloudProjectId, string environmentId, string envName)
Parameters
Type | Name | Description |
---|---|---|
String | cloudProjectId | Cloud Project ID for this Unity application. |
String | environmentId | ID of the environment to be updated |
String | envName | Name of the environment to be updated |
Events
environmentCreated
Action upon environment is created.
Declaration
public static event Action<string> environmentCreated
Event Type
Type | Description |
---|---|
Action<String> |
environmentCRUDError
Action upon an error during CRUD for environments is raised. Passes error object.
Declaration
public static event Action<JObject> environmentCRUDError
Event Type
Type | Description |
---|---|
Action<JObject> |
environmentDeleted
Action upon environment is deleted.
Declaration
public static event Action environmentDeleted
Event Type
Type | Description |
---|---|
Action |
environmentUpdated
Action upon environment is updated.
Declaration
public static event Action environmentUpdated
Event Type
Type | Description |
---|---|
Action |
fetchConfigsFinished
Action upon fetching config finishes. Passes config object.
Declaration
public static event Action<JObject> fetchConfigsFinished
Event Type
Type | Description |
---|---|
Action<JObject> |
fetchDefaultEnvironmentFinished
Action upon fetching default environment. Passes default environment id.
Declaration
public static event Action<string> fetchDefaultEnvironmentFinished
Event Type
Type | Description |
---|---|
Action<String> |
fetchEnvironmentsFinished
Action upon fetching of environments is finished. Passes an array of environments.
Declaration
public static event Action<JArray> fetchEnvironmentsFinished
Event Type
Type | Description |
---|---|
Action<JArray> |
fetchRulesFinished
Action upon fetching rules finishes. Passes array of rules.
Declaration
public static event Action<JArray> fetchRulesFinished
Event Type
Type | Description |
---|---|
Action<JArray> |
postAddRuleFinished
Action upon adding rules finishes. Passes response object, oldRuleId.
Declaration
public static event Action<JObject, string> postAddRuleFinished
Event Type
Type | Description |
---|---|
Action<JObject, String> |
postConfigRequestFinished
Action upon posting config (_PostConfig) request finishes. Passes configId.
Declaration
public static event Action<string> postConfigRequestFinished
Event Type
Type | Description |
---|---|
Action<String> |
rcRequestFailed
Action upon request fails. Passes request.responseCode, request.error.
Declaration
public static event Action<long, string> rcRequestFailed
Event Type
Type | Description |
---|---|
Action<Int64, String> |
ruleRequestSuccess
Action upon rule request suceeded. Passes UnityWebRequest.kHttpVerbPOST method, oldRuleId.
Declaration
public static event Action<string, string> ruleRequestSuccess
Event Type
Type | Description |
---|---|
Action<String, String> |
settingsRequestFinished
Action upon updating config (_PutConfig) request finishes.
Declaration
public static event Action settingsRequestFinished
Event Type
Type | Description |
---|---|
Action |