Interface IEconomyConfigurationApiClient
This class allows you to retrieve items from the global economy configuration as it is set up in the Unity Dashboard.
Namespace: Unity.Services.Economy
Syntax
public interface IEconomyConfigurationApiClient
Methods
GetConfigAssignmentHash()
Returns the cached config assignment hash.
Declaration
string GetConfigAssignmentHash()
Returns
Type | Description |
---|---|
String | A config assignment hash or null if Economy doesn't have one |
GetCurrencies()
Gets the currencies from the cached configuration.
Declaration
List<CurrencyDefinition> GetCurrencies()
Returns
Type | Description |
---|---|
List<CurrencyDefinition> | A list of CurrencyDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException |
GetCurrenciesAsync()
Gets the Currencies that have been configured and published in the Unity Dashboard.
Declaration
[Obsolete("GetCurrenciesAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetCurrencies method. This API will be removed in an upcoming release.", false)]
Task<List<CurrencyDefinition>> GetCurrenciesAsync()
Returns
Type | Description |
---|---|
Task<List<CurrencyDefinition>> | A list of CurrencyDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetCurrency(String)
Gets a specific currency from the cached config.
Declaration
CurrencyDefinition GetCurrency(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the currency to fetch. |
Returns
Type | Description |
---|---|
CurrencyDefinition | A CurrencyDefinition or null if the currency doesn't exist. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetCurrencyAsync(String)
Gets a Currency Definition for a specific currency.
Declaration
[Obsolete("GetCurrencyAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetCurrency method. This API will be removed in an upcoming release.", false)]
Task<CurrencyDefinition> GetCurrencyAsync(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The configuration ID of the currency to fetch. |
Returns
Type | Description |
---|---|
Task<CurrencyDefinition> | A CurrencyDefinition for the specified currency, or null if the currency doesn't exist. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetInventoryItem(String)
Gets a specific inventory item from the cached config.
Declaration
InventoryItemDefinition GetInventoryItem(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the inventory item to fetch. |
Returns
Type | Description |
---|---|
InventoryItemDefinition | A InventoryItemDefinition or null if the currency doesn't exist. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetInventoryItemAsync(String)
Gets a InventoryItemDefinition for a specific currency.
Declaration
[Obsolete("GetInventoryItemAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetInventoryItem method. This API will be removed in an upcoming release.", false)]
Task<InventoryItemDefinition> GetInventoryItemAsync(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The configuration ID of the item to fetch. |
Returns
Type | Description |
---|---|
Task<InventoryItemDefinition> | A InventoryItemDefinition for the specified currency, or null if the currency doesn't exist. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetInventoryItems()
Gets the inventory items from the cached configuration.
Declaration
List<InventoryItemDefinition> GetInventoryItems()
Returns
Type | Description |
---|---|
List<InventoryItemDefinition> | A list of InventoryItemDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException |
GetInventoryItemsAsync()
Gets the Inventory Items that have been configured and published in the Unity Dashboard.
Declaration
[Obsolete("GetInventoryItemsAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetInventoryItems method. This API will be removed in an upcoming release.", false)]
Task<List<InventoryItemDefinition>> GetInventoryItemsAsync()
Returns
Type | Description |
---|---|
Task<List<InventoryItemDefinition>> | A list of InventoryItemDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetRealMoneyPurchase(String)
Gets a specific real money purchase from the cached config.
Declaration
RealMoneyPurchaseDefinition GetRealMoneyPurchase(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the real money purchase to fetch. |
Returns
Type | Description |
---|---|
RealMoneyPurchaseDefinition | A RealMoneyPurchaseDefinition or null if the currency doesn't exist. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetRealMoneyPurchaseAsync(String)
Gets a RealMoneyPurchaseDefinition for a specific real money purchase.
Declaration
[Obsolete("GetRealMoneyPurchaseAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetRealMoneyPurchase method. This API will be removed in an upcoming release.", false)]
Task<RealMoneyPurchaseDefinition> GetRealMoneyPurchaseAsync(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the purchase to retrieve |
Returns
Type | Description |
---|---|
Task<RealMoneyPurchaseDefinition> | A RealMoneyPurchaseDefinition for the specified purchase if it exists, or null otherwise. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetRealMoneyPurchases()
Gets the real money purchases from the cached configuration.
Declaration
List<RealMoneyPurchaseDefinition> GetRealMoneyPurchases()
Returns
Type | Description |
---|---|
List<RealMoneyPurchaseDefinition> | A list of RealMoneyPurchaseDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException |
GetRealMoneyPurchasesAsync()
Gets all the real money purchases currently configured and published in the Economy Dashboard.
Declaration
[Obsolete("GetRealMoneyPurchasesAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetRealMoneyPurchases method. This API will be removed in an upcoming release.", false)]
Task<List<RealMoneyPurchaseDefinition>> GetRealMoneyPurchasesAsync()
Returns
Type | Description |
---|---|
Task<List<RealMoneyPurchaseDefinition>> | A list of RealMoneyPurchaseDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetVirtualPurchase(String)
Gets a specific virtual purchase from the cached config.
Declaration
VirtualPurchaseDefinition GetVirtualPurchase(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the virtual purchase to fetch. |
Returns
Type | Description |
---|---|
VirtualPurchaseDefinition | A VirtualPurchaseDefinition or null if the currency doesn't exist. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetVirtualPurchaseAsync(String)
Gets a VirtualPurchaseDefinition for a specific virtual purchase.
Note that this will also fetch the associated Inventory Items/Currencies associated with this purchase.
Declaration
[Obsolete("GetVirtualPurchaseAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetVirtualPurchase method. This API will be removed in an upcoming release.", false)]
Task<VirtualPurchaseDefinition> GetVirtualPurchaseAsync(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the purchase to retrieve |
Returns
Type | Description |
---|---|
Task<VirtualPurchaseDefinition> | A VirtualPurchaseDefinition for the specified purchase if it exists, or null otherwise. |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetVirtualPurchases()
Gets the virtual purchases from the cached configuration.
Declaration
List<VirtualPurchaseDefinition> GetVirtualPurchases()
Returns
Type | Description |
---|---|
List<VirtualPurchaseDefinition> | A list of VirtualPurchaseDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException |
GetVirtualPurchasesAsync()
Gets all the virtual purchases currently configured and published in the Economy Dashboard.
Note that this will also fetch all associated Inventory Items/Currencies associated with the purchase.
Declaration
[Obsolete("GetVirtualPurchasesAsync has been replaced by first caching your configuration using SyncConfigurationAsync and then using the GetVirtualPurchases method. This API will be removed in an upcoming release.", false)]
Task<List<VirtualPurchaseDefinition>> GetVirtualPurchasesAsync()
Returns
Type | Description |
---|---|
Task<List<VirtualPurchaseDefinition>> | A list of VirtualPurchaseDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
SyncConfigurationAsync()
Gets the currently published Economy configuration and caches it.
Declaration
Task<List<ConfigurationItemDefinition>> SyncConfigurationAsync()
Returns
Type | Description |
---|---|
Task<List<ConfigurationItemDefinition>> | A list of ConfigurationItemDefinition |
Exceptions
Type | Condition |
---|---|
EconomyException |