#if !DISABLE_PLAYFABENTITY_API using System; using System.Collections.Generic; using PlayFab.SharedModels; namespace PlayFab.ProfilesModels { public enum EffectType { Allow, Deny } /// /// An entity object and its associated meta data. /// [Serializable] public class EntityDataObject : PlayFabBaseModel { /// /// Un-escaped JSON object, if DataAsObject is true. /// public object DataObject; /// /// Escaped string JSON body of the object, if DataAsObject is default or false. /// public string EscapedDataObject; /// /// Name of this object. /// public string ObjectName; } /// /// 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; } [Serializable] public class EntityLineage : PlayFabBaseModel { /// /// The Character Id of the associated entity. /// public string CharacterId; /// /// The Group Id of the associated entity. /// public string GroupId; /// /// The Master Player Account Id of the associated entity. /// public string MasterPlayerAccountId; /// /// The Namespace Id of the associated entity. /// public string NamespaceId; /// /// The Title Id of the associated entity. /// public string TitleId; /// /// The Title Player Account Id of the associated entity. /// public string TitlePlayerAccountId; } [Serializable] public class EntityPermissionStatement : PlayFabBaseModel { /// /// The action this statement effects. May be 'Read', 'Write' or '*' for both read and write. /// public string Action; /// /// A comment about the statement. Intended solely for bookkeeping and debugging. /// public string Comment; /// /// Additional conditions to be applied for entity resources. /// public object Condition; /// /// The effect this statement will have. It may be either Allow or Deny /// public EffectType Effect; /// /// The principal this statement will effect. /// public object Principal; /// /// The resource this statements effects. Similar to 'pfrn:data--title![Title ID]/Profile/*' /// public string Resource; } [Serializable] public class EntityProfileBody : PlayFabBaseModel { /// /// Avatar URL for the entity. /// public string AvatarUrl; /// /// The creation time of this profile in UTC. /// public DateTime Created; /// /// The display name of the entity. This field may serve different purposes for different entity types. i.e.: for a title /// player account it could represent the display name of the player, whereas on a character it could be character's name. /// public string DisplayName; /// /// The entity id and type. /// public EntityKey Entity; /// /// The chain of responsibility for this entity. Use Lineage. /// public string EntityChain; /// /// The experiment variants of this profile. /// public List ExperimentVariants; /// /// The files on this profile. /// public Dictionary Files; /// /// The language on this profile. /// public string Language; /// /// The lineage of this profile. /// public EntityLineage Lineage; /// /// The objects on this profile. /// public Dictionary Objects; /// /// The permissions that govern access to this entity profile and its properties. Only includes permissions set on this /// profile, not global statements from titles and namespaces. /// public List Permissions; /// /// The statistics on this profile. /// public Dictionary Statistics; /// /// The version number of the profile in persistent storage at the time of the read. Used for optional optimistic /// concurrency during update. /// public int VersionNumber; } /// /// An entity file's meta data. To get a download URL call File/GetFiles API. /// [Serializable] public class EntityProfileFileMetadata : PlayFabBaseModel { /// /// Checksum value for the file, can be used to check if the file on the server has changed. /// public string Checksum; /// /// Name of the file /// public string FileName; /// /// Last UTC time the file was modified /// public DateTime LastModified; /// /// Storage service's reported byte count /// public int Size; } [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; } /// /// Given an entity type and entity identifier will retrieve the profile from the entity store. If the profile being /// retrieved is the caller's, then the read operation is consistent, if not it is an inconsistent read. An inconsistent /// read means that we do not guarantee all committed writes have occurred before reading the profile, allowing for a stale /// read. If consistency is important the Version Number on the result can be used to compare which version of the profile /// any reader has. /// [Serializable] public class GetEntityProfileRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is /// JSON string. /// public bool? DataAsObject; /// /// The optional entity to perform this action on. Defaults to the currently logged in entity. /// public EntityKey Entity; } [Serializable] public class GetEntityProfileResponse : PlayFabResultCommon { /// /// Entity profile /// public EntityProfileBody Profile; } /// /// Given a set of entity types and entity identifiers will retrieve all readable profiles properties for the caller. /// Profiles that the caller is not allowed to read will silently not be included in the results. /// [Serializable] public class GetEntityProfilesRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is /// JSON string. /// public bool? DataAsObject; /// /// Entity keys of the profiles to load. Must be between 1 and 25 /// public List Entities; } [Serializable] public class GetEntityProfilesResponse : PlayFabResultCommon { /// /// Entity profiles /// public List Profiles; } /// /// Retrieves the title access policy that is used before the profile's policy is inspected during a request. If never /// customized this will return the default starter policy built by PlayFab. /// [Serializable] public class GetGlobalPolicyRequest : 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 GetGlobalPolicyResponse : PlayFabResultCommon { /// /// The permissions that govern access to all entities under this title or namespace. /// public List Permissions; } /// /// Given a master player account id (PlayFab ID), returns all title player accounts associated with it. /// [Serializable] public class GetTitlePlayersFromMasterPlayerAccountIdsRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// Master player account ids. /// public List MasterPlayerAccountIds; /// /// Id of title to get players from. /// public string TitleId; } [Serializable] public class GetTitlePlayersFromMasterPlayerAccountIdsResponse : PlayFabResultCommon { /// /// Optional id of title to get players from, required if calling using a master_player_account. /// public string TitleId; /// /// Dictionary of master player ids mapped to title player entity keys and id pairs /// public Dictionary TitlePlayerAccounts; } [Serializable] public class GetTitlePlayersFromProviderIDsResponse : PlayFabResultCommon { /// /// Dictionary of provider identifiers mapped to title_player_account lineage. Missing lineage indicates the player either /// doesn't exist or doesn't play the requested title. /// public Dictionary TitlePlayerAccounts; } /// /// Given a collection of Xbox IDs (XUIDs), returns all title player accounts. /// [Serializable] public class GetTitlePlayersFromXboxLiveIDsRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// Xbox Sandbox the players had on their Xbox tokens. /// public string Sandbox; /// /// Optional ID of title to get players from, required if calling using a master_player_account. /// public string TitleId; /// /// List of Xbox Live XUIDs /// public List XboxLiveIds; } public enum OperationTypes { Created, Updated, Deleted, None } /// /// Given an entity profile, will update its display name to the one passed in if the profile's version is equal to the /// specified value /// [Serializable] public class SetDisplayNameRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The new value to be set on Entity Profile's display name /// public string DisplayName; /// /// The optional entity to perform this action on. Defaults to the currently logged in entity. /// public EntityKey Entity; /// /// The expected version of a profile to perform this update on /// public int? ExpectedVersion; } [Serializable] public class SetDisplayNameResponse : PlayFabResultCommon { /// /// The type of operation that occured on the profile's display name /// public OperationTypes? OperationResult; /// /// The updated version of the profile after the display name update /// public int? VersionNumber; } /// /// This will set the access policy statements on the given entity profile. This is not additive, any existing statements /// will be replaced with the statements in this request. /// [Serializable] public class SetEntityProfilePolicyRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The entity to perform this action on. /// public EntityKey Entity; /// /// The statements to include in the access policy. /// public List Statements; } [Serializable] public class SetEntityProfilePolicyResponse : PlayFabResultCommon { /// /// The permissions that govern access to this entity profile and its properties. Only includes permissions set on this /// profile, not global statements from titles and namespaces. /// public List Permissions; } /// /// Updates the title access policy that is used before the profile's policy is inspected during a request. Policies are /// compiled and cached for several minutes so an update here may not be reflected in behavior for a short time. /// [Serializable] public class SetGlobalPolicyRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The permissions that govern access to all entities under this title or namespace. /// public List Permissions; } [Serializable] public class SetGlobalPolicyResponse : PlayFabResultCommon { } /// /// Given an entity profile, will update its language to the one passed in if the profile's version is equal to the one /// passed in. /// [Serializable] public class SetProfileLanguageRequest : 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; /// /// The expected version of a profile to perform this update on /// public int? ExpectedVersion; /// /// The language to set on the given entity. Deletes the profile's language if passed in a null string. /// public string Language; } [Serializable] public class SetProfileLanguageResponse : PlayFabResultCommon { /// /// The type of operation that occured on the profile's language /// public OperationTypes? OperationResult; /// /// The updated version of the profile after the language update /// public int? VersionNumber; } } #endif