#if !DISABLE_PLAYFABENTITY_API
using System;
using System.Collections.Generic;
using PlayFab.SharedModels;
namespace PlayFab.ProgressionModels
{
[Serializable]
public class CreateLeaderboardDefinitionRequest : PlayFabRequestCommon
{
///
/// Leaderboard columns describing the sort directions, cannot be changed after creation.
///
public List Columns;
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity type being represented on the leaderboard. If it doesn't correspond to the PlayFab entity types, use
/// 'external' as the type.
///
public string EntityType;
///
/// A name for the leaderboard, unique per title.
///
public string Name;
///
/// Maximum number of entries on this leaderboard
///
public int SizeLimit;
///
/// The version reset configuration for the leaderboard definition.
///
public VersionConfiguration VersionConfiguration;
}
[Serializable]
public class CreateStatisticDefinitionRequest : PlayFabRequestCommon
{
///
/// The columns for the statistic defining the aggregation method for each column.
///
public List Columns;
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity type allowed to have score(s) for this statistic.
///
public string EntityType;
///
/// Name of the statistic. Must be less than 150 characters. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'.
///
public string Name;
///
/// The version reset configuration for the statistic definition.
///
public VersionConfiguration VersionConfiguration;
}
[Serializable]
public class DeleteLeaderboardDefinitionRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The name of the leaderboard definition to delete.
///
public string Name;
}
[Serializable]
public class DeleteLeaderboardEntriesRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The unique Ids of the entries to delete from the leaderboard.
///
public List EntityIds;
///
/// The name of the leaderboard.
///
public string Name;
}
[Serializable]
public class DeleteStatisticDefinitionRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Name of the statistic to delete.
///
public string Name;
}
[Serializable]
public class DeleteStatisticsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The optional entity to perform this action on. Defaults to the currently logged in entity.
///
public EntityKey Entity;
///
/// Collection of statistics to remove from this entity.
///
public List Statistics;
}
[Serializable]
public class DeleteStatisticsResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
}
[Serializable]
public class EmptyResponse : PlayFabResultCommon
{
}
///
/// Combined entity type and ID structure which uniquely identifies a single entity.
///
[Serializable]
public class EntityKey : PlayFabBaseModel
{
///
/// Unique ID of the entity.
///
public string Id;
///
/// Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types
///
public string Type;
}
///
/// Individual rank of an entity in a leaderboard
///
[Serializable]
public class EntityLeaderboardEntry : PlayFabBaseModel
{
///
/// Entity's display name.
///
public string DisplayName;
///
/// Entity identifier.
///
public EntityKey Entity;
///
/// The time at which the last update to the entry was recorded on the server.
///
public DateTime LastUpdated;
///
/// An opaque blob of data stored on the leaderboard entry. Note that the metadata is not used for ranking purposes.
///
public string Metadata;
///
/// Position on the leaderboard.
///
public int Rank;
///
/// Scores for the entry.
///
public List Scores;
}
[Serializable]
public class EntityStatistics : PlayFabBaseModel
{
///
/// Entity key
///
public EntityKey EntityKey;
///
/// All statistics for the given entitykey
///
public List Statistics;
}
[Serializable]
public class EntityStatisticValue : PlayFabBaseModel
{
///
/// Metadata associated with the Statistic.
///
public string Metadata;
///
/// Statistic name
///
public string Name;
///
/// Statistic scores
///
public List Scores;
///
/// Statistic version
///
public int Version;
}
public enum ExternalFriendSources
{
None,
Steam,
Facebook,
Xbox,
Psn,
All
}
///
/// Request to load a leaderboard.
///
[Serializable]
public class GetEntityLeaderboardRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Name of the leaderboard.
///
public string LeaderboardName;
///
/// Maximum number of results to return from the leaderboard. Minimum 1, maximum 1,000.
///
public uint PageSize;
///
/// Index position to start from. 1 is beginning of leaderboard.
///
public uint? StartingPosition;
///
/// Optional version of the leaderboard, defaults to current version.
///
public uint? Version;
}
///
/// Leaderboard response
///
[Serializable]
public class GetEntityLeaderboardResponse : PlayFabResultCommon
{
///
/// Leaderboard columns describing the sort directions.
///
public List Columns;
///
/// The number of entries on the leaderboard.
///
public uint EntryCount;
///
/// Individual entity rankings in the leaderboard, in sorted order by rank.
///
public List Rankings;
///
/// Version of the leaderboard being returned.
///
public uint Version;
}
[Serializable]
public class GetFriendLeaderboardForEntityRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The optional entity to perform this action on. Defaults to the currently logged in entity.
///
public EntityKey Entity;
///
/// Indicates which other platforms' friends should be included in the response. In HTTP, it is represented as a
/// comma-separated list of platforms.
///
public ExternalFriendSources? ExternalFriendSources;
///
/// Name of the leaderboard.
///
public string LeaderboardName;
///
/// Optional version of the leaderboard, defaults to current version.
///
public uint? Version;
///
/// Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab.
///
public string XboxToken;
}
///
/// Request to load a section of a leaderboard centered on a specific entity.
///
[Serializable]
public class GetLeaderboardAroundEntityRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The optional entity to perform this action on. Defaults to the currently logged in entity.
///
public EntityKey Entity;
///
/// Name of the leaderboard.
///
public string LeaderboardName;
///
/// Number of surrounding entries to return (in addition to specified entity). In general, the number of ranks above and
/// below will be split into half. For example, if the specified value is 10, 5 ranks above and 5 ranks below will be
/// retrieved. However, the numbers will get skewed in either direction when the specified entity is towards the top or
/// bottom of the leaderboard. Also, the number of entries returned can be lower than the value specified for entries at the
/// bottom of the leaderboard.
///
public uint MaxSurroundingEntries;
///
/// Optional version of the leaderboard, defaults to current.
///
public uint? Version;
}
[Serializable]
public class GetLeaderboardDefinitionRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The name of the leaderboard to retrieve the definition for.
///
public string Name;
}
[Serializable]
public class GetLeaderboardDefinitionResponse : PlayFabResultCommon
{
///
/// Sort direction of the leaderboard columns, cannot be changed after creation.
///
public List Columns;
///
/// Created time, in UTC
///
public DateTime Created;
///
/// The entity type being represented on the leaderboard. If it doesn't correspond to the PlayFab entity types, use
/// 'external' as the type.
///
public string EntityType;
///
/// Last time, in UTC, leaderboard version was incremented.
///
public DateTime? LastResetTime;
///
/// A name for the leaderboard, unique per title.
///
public string Name;
///
/// Maximum number of entries on this leaderboard
///
public int SizeLimit;
///
/// Latest Leaderboard version.
///
public uint Version;
///
/// The version reset configuration for the leaderboard definition.
///
public VersionConfiguration VersionConfiguration;
}
///
/// Request a leaderboard limited to a collection of entities.
///
[Serializable]
public class GetLeaderboardForEntitiesRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Collection of Entity IDs to include in the leaderboard.
///
public List EntityIds;
///
/// Name of the leaderboard.
///
public string LeaderboardName;
///
/// Optional version of the leaderboard, defaults to current.
///
public uint? Version;
}
[Serializable]
public class GetStatisticDefinitionRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Name of the statistic. Must be less than 150 characters.
///
public string Name;
}
[Serializable]
public class GetStatisticDefinitionResponse : PlayFabResultCommon
{
///
/// The columns for the statistic defining the aggregation method for each column.
///
public List Columns;
///
/// Created time, in UTC
///
public DateTime Created;
///
/// The entity type that can have this statistic.
///
public string EntityType;
///
/// Last time, in UTC, statistic version was incremented.
///
public DateTime? LastResetTime;
///
/// The list of leaderboards that are linked to this statistic definition.
///
public List LinkedLeaderboardNames;
///
/// Name of the statistic.
///
public string Name;
///
/// Statistic version.
///
public uint Version;
///
/// The version reset configuration for the leaderboard definition.
///
public VersionConfiguration VersionConfiguration;
}
[Serializable]
public class GetStatisticsForEntitiesRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Collection of Entity IDs to retrieve statistics for.
///
public List Entities;
}
[Serializable]
public class GetStatisticsForEntitiesResponse : PlayFabResultCommon
{
///
/// A mapping of statistic name to the columns defined in the corresponding definition.
///
public Dictionary ColumnDetails;
///
/// List of entities mapped to their statistics. Only the latest version of a statistic is returned.
///
public List EntitiesStatistics;
}
[Serializable]
public class GetStatisticsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The optional entity to perform this action on. Defaults to the currently logged in entity.
///
public EntityKey Entity;
}
[Serializable]
public class GetStatisticsResponse : PlayFabResultCommon
{
///
/// A mapping of statistic name to the columns defined in the corresponding definition.
///
public Dictionary ColumnDetails;
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// List of statistics keyed by Name. Only the latest version of a statistic is returned.
///
public Dictionary Statistics;
}
[Serializable]
public class IncrementLeaderboardVersionRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The name of the leaderboard to increment the version for.
///
public string Name;
}
[Serializable]
public class IncrementLeaderboardVersionResponse : PlayFabResultCommon
{
///
/// New Leaderboard version.
///
public uint Version;
}
[Serializable]
public class IncrementStatisticVersionRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Name of the statistic to increment the version of.
///
public string Name;
}
[Serializable]
public class IncrementStatisticVersionResponse : PlayFabResultCommon
{
///
/// New statistic version.
///
public uint Version;
}
[Serializable]
public class LeaderboardColumn : PlayFabBaseModel
{
///
/// If the value for this column is sourced from a statistic, details of the linked column. Null if the leaderboard is not
/// linked.
///
public LinkedStatisticColumn LinkedStatisticColumn;
///
/// A name for the leaderboard column, unique per leaderboard definition.
///
public string Name;
///
/// The sort direction for this column.
///
public LeaderboardSortDirection SortDirection;
}
[Serializable]
public class LeaderboardDefinition : PlayFabBaseModel
{
///
/// Sort direction of the leaderboard columns, cannot be changed after creation.
///
public List Columns;
///
/// Created time, in UTC
///
public DateTime Created;
///
/// The entity type being represented on the leaderboard. If it doesn't correspond to the PlayFab entity types, use
/// 'external' as the type.
///
public string EntityType;
///
/// Last time, in UTC, leaderboard version was incremented.
///
public DateTime? LastResetTime;
///
/// A name for the leaderboard, unique per title.
///
public string Name;
///
/// Maximum number of entries on this leaderboard
///
public int SizeLimit;
///
/// Latest Leaderboard version.
///
public uint Version;
///
/// The version reset configuration for the leaderboard definition.
///
public VersionConfiguration VersionConfiguration;
}
[Serializable]
public class LeaderboardEntryUpdate : PlayFabBaseModel
{
///
/// The unique Id for the entry. If using PlayFab Entities, this would be the entityId of the entity.
///
public string EntityId;
///
/// Arbitrary metadata to store along side the leaderboard entry, will be returned by all Leaderboard APIs. Must be less
/// than 50 UTF8 encoded characters.
///
public string Metadata;
///
/// The scores for the leaderboard. The number of values provided here must match the number of columns in the Leaderboard
/// definition.
///
public List Scores;
}
public enum LeaderboardSortDirection
{
Descending,
Ascending
}
[Serializable]
public class LinkedStatisticColumn : PlayFabBaseModel
{
///
/// The name of the statistic column that this leaderboard column is sourced from.
///
public string LinkedStatisticColumnName;
///
/// The name of the statistic.
///
public string LinkedStatisticName;
}
[Serializable]
public class ListLeaderboardDefinitionsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
}
[Serializable]
public class ListLeaderboardDefinitionsResponse : PlayFabResultCommon
{
///
/// List of leaderboard definitions for the title.
///
public List LeaderboardDefinitions;
}
[Serializable]
public class ListStatisticDefinitionsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
}
[Serializable]
public class ListStatisticDefinitionsResponse : PlayFabResultCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// List of statistic definitions for the title.
///
public List StatisticDefinitions;
}
public enum ResetInterval
{
Manual,
Hour,
Day,
Week,
Month
}
public enum StatisticAggregationMethod
{
Last,
Min,
Max,
Sum
}
[Serializable]
public class StatisticColumn : PlayFabBaseModel
{
///
/// Aggregation method for calculating new value of a statistic.
///
public StatisticAggregationMethod AggregationMethod;
///
/// Name of the statistic column, as originally configured.
///
public string Name;
}
[Serializable]
public class StatisticColumnCollection : PlayFabBaseModel
{
///
/// Columns for the statistic defining the aggregation method for each column.
///
public List Columns;
}
[Serializable]
public class StatisticDefinition : PlayFabBaseModel
{
///
/// The columns for the statistic defining the aggregation method for each column.
///
public List Columns;
///
/// Created time, in UTC
///
public DateTime Created;
///
/// The entity type that can have this statistic.
///
public string EntityType;
///
/// Last time, in UTC, statistic version was incremented.
///
public DateTime? LastResetTime;
///
/// The list of leaderboards that are linked to this statistic definition.
///
public List LinkedLeaderboardNames;
///
/// Name of the statistic.
///
public string Name;
///
/// Statistic version.
///
public uint Version;
///
/// The version reset configuration for the leaderboard definition.
///
public VersionConfiguration VersionConfiguration;
}
[Serializable]
public class StatisticDelete : PlayFabBaseModel
{
///
/// Name of the statistic, as originally configured.
///
public string Name;
}
[Serializable]
public class StatisticUpdate : PlayFabBaseModel
{
///
/// Arbitrary metadata to store along side the statistic, will be returned by all Leaderboard APIs. Must be less than 50
/// UTF8 encoded characters.
///
public string Metadata;
///
/// Name of the statistic, as originally configured.
///
public string Name;
///
/// Statistic scores for the entity. This will be used in accordance with the aggregation method configured for the
/// statistics.The maximum value allowed for each individual score is 9223372036854775807. The minimum value for each
/// individual score is -9223372036854775807The values are formatted as strings to avoid interop issues with client
/// libraries unable to handle 64bit integers.
///
public List Scores;
///
/// Optional field to indicate the version of the statistic to set. When empty defaults to the statistic's current version.
///
public uint? Version;
}
[Serializable]
public class UnlinkLeaderboardFromStatisticRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The name of the leaderboard definition to unlink.
///
public string Name;
///
/// The name of the statistic definition to unlink.
///
public string StatisticName;
}
[Serializable]
public class UpdateLeaderboardEntriesRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entries to add or update on the leaderboard.
///
public List Entries;
///
/// The name of the leaderboard.
///
public string LeaderboardName;
}
[Serializable]
public class UpdateStatisticsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The optional entity to perform this action on. Defaults to the currently logged in entity.
///
public EntityKey Entity;
///
/// Collection of statistics to update, maximum 50.
///
public List Statistics;
}
[Serializable]
public class UpdateStatisticsResponse : PlayFabResultCommon
{
///
/// A mapping of statistic name to the columns defined in the corresponding definition.
///
public Dictionary ColumnDetails;
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// Updated entity profile statistics.
///
public Dictionary Statistics;
}
[Serializable]
public class VersionConfiguration : PlayFabBaseModel
{
///
/// The maximum number of versions of this leaderboard/statistic that can be queried.
///
public int MaxQueryableVersions;
///
/// Reset interval that statistics or leaderboards will reset on. When using Manual intervalthe reset can only be increased
/// by calling the Increase version API. When using Hour interval the resetwill occur at the start of the next hour UTC
/// time. When using Day interval the reset will occur at thestart of the next day in UTC time. When using the Week interval
/// the reset will occur at the start ofthe next Monday in UTC time. When using Month interval the reset will occur at the
/// start of the nextmonth in UTC time.
///
public ResetInterval ResetInterval;
}
}
#endif