Beamable SDK
Public Member Functions | List of all members
Beamable.Common.Api.Inventory.IInventoryApi Interface Reference

This type defines the Client main entry point for the Inventory feature. More...

Inheritance diagram for Beamable.Common.Api.Inventory.IInventoryApi:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Common.Api.Inventory.IInventoryApi:
Collaboration graph
[legend]

Public Member Functions

Promise< GetMultipliersResponseGetMultipliers ()
 Provides the VIP Bonus multipliers that are applicable for this player according to their tier. More...
 
Promise< PreviewCurrencyGainResponsePreviewCurrencyGain (Dictionary< string, long > currencyIdsToAmount)
 Players may sometimes receive additional currency as a result of qualifying for a VIP Tier This API previews what that amount of currency would be ahead of an update. More...
 
Promise< UnitSetCurrency (string currencyId, long amount, string transaction=null)
 Sets the currency. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitSetCurrency (CurrencyRef currency, long amount, string transaction=null)
 Sets the currency. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitAddCurrency (string currencyId, long amount, string transaction=null)
 Adds the currency If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitAddCurrency (CurrencyRef currency, long amount, string transaction=null)
 Adds the currency If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitSetCurrencies (Dictionary< string, long > currencyIdsToAmount, string transaction=null)
 Set multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitSetCurrencies (Dictionary< CurrencyRef, long > currencyToAmount, string transaction=null)
 Set multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitAddCurrencies (Dictionary< string, long > currencyIdsToAmount, string transaction=null)
 Add multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitAddCurrencies (Dictionary< CurrencyRef, long > currencyToAmount, string transaction=null)
 Add multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< Dictionary< string, long > > GetCurrencies (string[] currencyIds)
 Get a set of currency values for the current player. More...
 
Promise< Dictionary< CurrencyRef, long > > GetCurrencies (CurrencyRef[] currencyRefs)
 Get a set of currency values for the current player. More...
 
Promise< long > GetCurrency (string currencyId)
 Gets the currency. More...
 
Promise< long > GetCurrency (CurrencyRef currency)
 Gets the currency. More...
 
Promise< UnitSetCurrencyProperties (string currencyId, List< CurrencyProperty > properties, string transaction=null)
 Set the CurrencyProperty values for a player's currency More...
 
Promise< UnitSetCurrencyProperties (CurrencyRef currency, List< CurrencyProperty > properties, string transaction=null)
 Set the CurrencyProperty values for a player's currency More...
 
Promise< UnitAddItem (ItemRef itemRef, Dictionary< string, string > properties=null, string transaction=null)
 Add an instance of the given itemRef to the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitAddItem (string contentId, Dictionary< string, string > properties=null, string transaction=null)
 Add an item instance of the given contentId to the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitDeleteItem (string contentId, long itemId, string transaction=null)
 Remove an item instance from the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitUpdateItem (ItemRef itemRef, long itemId, Dictionary< string, string > properties, string transaction=null)
 Update the instance level item properties of an item in the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitUpdateItem (string contentId, long itemId, Dictionary< string, string > properties, string transaction=null)
 Update the instance level item properties of an item in the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method. More...
 
Promise< UnitUpdate (Action< InventoryUpdateBuilder > action, string transaction=null)
 
Promise< UnitUpdate (InventoryUpdateBuilder builder, string transaction=null)
 Perform multiple updates to the player's inventory in one network call. The InventoryUpdateBuilder that you pass to this method will be converted into one update call to Beamable. More...
 
Promise< List< InventoryObject< TContent > > > GetItems< TContent > ()
 Get every InventoryObject<TContent> that is of a specific item content type. More...
 
Promise< List< InventoryObject< TContent > > > GetItems< TContent > (params ItemRef< TContent >[] itemReferences)
 Get the InventoryObject<TContent> that are of a specific item content type and match the given itemReferences More...
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< InventoryView >
Promise< TData > GetCurrent (string scope="")
 Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More...
 

Detailed Description

This type defines the Client main entry point for the Inventory feature.

Related Links

Member Function Documentation

◆ AddCurrencies() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.AddCurrencies ( Dictionary< CurrencyRef, long >  currencyToAmount,
string  transaction = null 
)

Add multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currencyToAmountA dictionary where the keys are CurrencyRefs, and the values are the new currency values for the player
transactionAn inventory transaction ID. Leave this argument empty.
Returns
A Promise<T> representing the network call.

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ AddCurrencies() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.AddCurrencies ( Dictionary< string, long >  currencyIdsToAmount,
string  transaction = null 
)

Add multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currencyIdsToAmountA dictionary where the keys are content IDs of the currency, and the values are the new currency values for the player
transactionAn inventory transaction ID. Leave this argument empty.
Returns
A Promise<T> representing the network call.

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ AddCurrency() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.AddCurrency ( CurrencyRef  currency,
long  amount,
string  transaction = null 
)

Adds the currency If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currency
amount
transaction
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ AddCurrency() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.AddCurrency ( string  currencyId,
long  amount,
string  transaction = null 
)

Adds the currency If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currencyId
amount
transaction
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ AddItem() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.AddItem ( ItemRef  itemRef,
Dictionary< string, string >  properties = null,
string  transaction = null 
)

Add an instance of the given itemRef to the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
itemRefA ItemRef
propertiesa set of instance properties for the new item
transactionAn inventory transaction id
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ AddItem() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.AddItem ( string  contentId,
Dictionary< string, string >  properties = null,
string  transaction = null 
)

Add an item instance of the given contentId to the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
contentIdA content ID of the item type
propertiesa set of instance properties for the new item
transactionAn inventory transaction ID. Leave this argument empty.
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ DeleteItem()

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.DeleteItem ( string  contentId,
long  itemId,
string  transaction = null 
)

Remove an item instance from the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
contentIdThe content ID of the type of item to remove
itemIdThe runtime ID of the item to remove
transactionan inventory transaction ID
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ GetCurrencies() [1/2]

Promise< Dictionary< CurrencyRef, long > > Beamable.Common.Api.Inventory.IInventoryApi.GetCurrencies ( CurrencyRef[]  currencyRefs)

Get a set of currency values for the current player.

Parameters
currencyRefsCurrencyRefs for the currencies that will be returned
Returns
A Promise<T> containing a dictionary where the keys are CurrencyRefs and the values are the player currency values.

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ GetCurrencies() [2/2]

Promise< Dictionary< string, long > > Beamable.Common.Api.Inventory.IInventoryApi.GetCurrencies ( string[]  currencyIds)

Get a set of currency values for the current player.

Parameters
currencyIdsthe content IDs for the currencies that will be returned
Returns
A Promise<T> containing a dictionary where the keys are content IDs and the values are the player currency values.

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ GetCurrency() [1/2]

Promise< long > Beamable.Common.Api.Inventory.IInventoryApi.GetCurrency ( CurrencyRef  currency)

Gets the currency.

Parameters
currencyA CurrencyRef
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ GetCurrency() [2/2]

Promise< long > Beamable.Common.Api.Inventory.IInventoryApi.GetCurrency ( string  currencyId)

Gets the currency.

Parameters
currencyId
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ GetItems< TContent >() [1/2]

Promise< List< InventoryObject< TContent > > > Beamable.Common.Api.Inventory.IInventoryApi.GetItems< TContent > ( )

Get every InventoryObject<TContent> that is of a specific item content type.

Template Parameters
TContentThe type of content to retrieve. All children types will be included the result.
Returns
A Promise containing the InventoryObject<TContent> that matches the given item type

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

Type Constraints
TContent :ItemContent 
TContent :new() 

◆ GetItems< TContent >() [2/2]

Promise< List< InventoryObject< TContent > > > Beamable.Common.Api.Inventory.IInventoryApi.GetItems< TContent > ( params ItemRef< TContent >[]  itemReferences)

Get the InventoryObject<TContent> that are of a specific item content type and match the given itemReferences

Parameters
itemReferencesFilter for only the items that match the given ItemRef<TContent> types.
Template Parameters
TContentThe type of content to retrieve. All children types will be included the result.
Returns
A Promise containing the InventoryObject<TContent> that match the given item type

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

Type Constraints
TContent :ItemContent 
TContent :new() 

◆ GetMultipliers()

Promise< GetMultipliersResponse > Beamable.Common.Api.Inventory.IInventoryApi.GetMultipliers ( )

Provides the VIP Bonus multipliers that are applicable for this player according to their tier.

Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ PreviewCurrencyGain()

Promise< PreviewCurrencyGainResponse > Beamable.Common.Api.Inventory.IInventoryApi.PreviewCurrencyGain ( Dictionary< string, long >  currencyIdsToAmount)

Players may sometimes receive additional currency as a result of qualifying for a VIP Tier This API previews what that amount of currency would be ahead of an update.

Parameters
currencyIdsToAmount
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ SetCurrencies() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.SetCurrencies ( Dictionary< CurrencyRef, long >  currencyToAmount,
string  transaction = null 
)

Set multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currencyToAmountA dictionary where the keys are CurrencyRefs, and the values are the new currency values for the player
transactionAn inventory transaction ID. Leave this argument empty.
Returns
A Promise<T> representing the network call.

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ SetCurrencies() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.SetCurrencies ( Dictionary< string, long >  currencyIdsToAmount,
string  transaction = null 
)

Set multiple currency values. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currencyIdsToAmountA dictionary where the keys are content IDs of the currency, and the values are the new currency values for the player
transactionAn inventory transaction ID. Leave this argument empty.
Returns
A Promise<T> representing the network call.

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ SetCurrency() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.SetCurrency ( CurrencyRef  currency,
long  amount,
string  transaction = null 
)

Sets the currency. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currency
amount
transaction
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ SetCurrency() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.SetCurrency ( string  currencyId,
long  amount,
string  transaction = null 
)

Sets the currency. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
currencyId
amount
transaction
Returns

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ SetCurrencyProperties() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.SetCurrencyProperties ( CurrencyRef  currency,
List< CurrencyProperty properties,
string  transaction = null 
)

Set the CurrencyProperty values for a player's currency

Parameters
currencyA CurrencyRef
propertiesA list of CurrencyProperty values
transactionAn inventory transaction id
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ SetCurrencyProperties() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.SetCurrencyProperties ( string  currencyId,
List< CurrencyProperty properties,
string  transaction = null 
)

Set the CurrencyProperty values for a player's currency

Parameters
currencyIdThe content id of the currency
propertiesA list of CurrencyProperty values
transactionAn inventory transaction id.
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ Update() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.Update ( Action< InventoryUpdateBuilder action,
string  transaction = null 
)

Parameters
actionA configurator for the InventoryUpdateBuilder. You should configure the builder with all of the inventory updates. If you already have an instance of the builder, use the Update(InventoryUpdateBuilder,string) method instead.
transactionan inventory transaction ID
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ Update() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.Update ( InventoryUpdateBuilder  builder,
string  transaction = null 
)

Perform multiple updates to the player's inventory in one network call. The InventoryUpdateBuilder that you pass to this method will be converted into one update call to Beamable.

Parameters
builderAn InventoryUpdateBuilder containing all of the inventory updates. Use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method to configure an InventoryUpdateBuilder instead.
transactionan inventory transaction ID
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ UpdateItem() [1/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.UpdateItem ( ItemRef  itemRef,
long  itemId,
Dictionary< string, string >  properties,
string  transaction = null 
)

Update the instance level item properties of an item in the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
itemRefAn ItemRef pointing to the content type of the item to update.
itemIdThe runtime ID of the item to remove
propertiesA new set of instance property values for the item. This will overwrite the existing properties.
transactionan inventory transaction ID
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.

◆ UpdateItem() [2/2]

Promise< Unit > Beamable.Common.Api.Inventory.IInventoryApi.UpdateItem ( string  contentId,
long  itemId,
Dictionary< string, string >  properties,
string  transaction = null 
)

Update the instance level item properties of an item in the player's inventory. If you need to make multiple inventory updates, use the Update(System.Action<Beamable.Common.Api.Inventory.InventoryUpdateBuilder>,string) method.

Parameters
contentIdA content ID pointing to the content type of the item to update.
itemIdThe runtime ID of the item to remove
propertiesA new set of instance property values for the item. This will overwrite the existing properties.
transactionan inventory transaction ID
Returns
A Promise<T> representing the network call

Implemented in Beamable.Common.Api.Inventory.AbsInventoryApi.


The documentation for this interface was generated from the following file: