Class VirtualPurchaseResource
The definition for a economy resource that represents a virtual purchase.
Inherited Members
Namespace: Unity.Services.Apis.Economy
Assembly: Unity.Services.Apis.dll
Syntax
[DataContract(Name = "virtual-purchase-resource")]
[Preserve]
public class VirtualPurchaseResource
Constructors
VirtualPurchaseResource(string, string, TypeEnum, ModifiedMetadata, ModifiedMetadata, List<Cost>, List<Reward>, object)
Initializes a new instance of the VirtualPurchaseResource class.
Declaration
[Preserve]
public VirtualPurchaseResource(string id = null, string name = null, VirtualPurchaseResource.TypeEnum type = (VirtualPurchaseResource.TypeEnum)0, ModifiedMetadata created = null, ModifiedMetadata modified = null, List<Cost> costs = null, List<Reward> rewards = null, object customData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | Identifier for the resource. (required). |
| string | name | Name of the resource. (required). |
| VirtualPurchaseResource.TypeEnum | type | Type of the item, for example |
| ModifiedMetadata | created | created (required). |
| ModifiedMetadata | modified | modified (required). |
| List<Cost> | costs | The costs deducted from the player when making the purchase. A cost is an ID of a currency or inventory item, plus an amount.. |
| List<Reward> | rewards | The rewards credited to the player when making the purchase. A reward is composed of the ID of a currency or inventory item, the amount of that currency or item, and the default instance data (for inventory items).. |
| object | customData | customData. |
Properties
Costs
The costs deducted from the player when making the purchase. A cost is an ID of a currency or inventory item, plus an amount.
Declaration
[DataMember(Name = "costs", EmitDefaultValue = false)]
[Preserve]
public List<Cost> Costs { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Cost> | The costs deducted from the player when making the purchase. A cost is an ID of a currency or inventory item, plus an amount. |
Created
Gets or Sets Created
Declaration
[DataMember(Name = "created", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public ModifiedMetadata Created { get; set; }
Property Value
| Type | Description |
|---|---|
| ModifiedMetadata |
CustomData
Gets or Sets CustomData
Declaration
[DataMember(Name = "customData", EmitDefaultValue = true)]
[Preserve]
public object CustomData { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Id
Identifier for the resource.
Declaration
[DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Identifier for the resource. |
Modified
Gets or Sets Modified
Declaration
[DataMember(Name = "modified", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public ModifiedMetadata Modified { get; set; }
Property Value
| Type | Description |
|---|---|
| ModifiedMetadata |
Name
Name of the resource.
Declaration
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Name of the resource. |
Rewards
The rewards credited to the player when making the purchase. A reward is composed of the ID of a currency or inventory item, the amount of that currency or item, and the default instance data (for inventory items).
Declaration
[DataMember(Name = "rewards", EmitDefaultValue = false)]
[Preserve]
public List<Reward> Rewards { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Reward> | The rewards credited to the player when making the purchase. A reward is composed of the ID of a currency or inventory item, the amount of that currency or item, and the default instance data (for inventory items). |
Type
Type of the item, for example CURRENCY, INVENTORY_ITEM, VIRTUAL_PURCHASE, MONEY_PURCHASE.
Declaration
[DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public VirtualPurchaseResource.TypeEnum Type { get; set; }
Property Value
| Type | Description |
|---|---|
| VirtualPurchaseResource.TypeEnum | Type of the item, for example |