#if !DISABLE_PLAYFABENTITY_API using System; using System.Collections.Generic; using PlayFab.SharedModels; namespace PlayFab.AuthenticationModels { /// /// Create or return a game_server entity token. Caller must be a title entity. /// [Serializable] public class AuthenticateCustomIdRequest : PlayFabRequestCommon { /// /// The customId used to create and retrieve game_server entity tokens. This is unique at the title level. CustomId must be /// between 32 and 100 characters. /// public string CustomId; /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; } [Serializable] public class AuthenticateCustomIdResult : PlayFabResultCommon { /// /// The token generated used to set X-EntityToken for game_server calls. /// public EntityTokenResponse EntityToken; /// /// True if the account was newly created on this authentication. /// public bool NewlyCreated; } /// /// Delete a game_server entity. The caller can be the game_server entity attempting to delete itself. Or a title entity /// attempting to delete game_server entities for this title. /// [Serializable] public class DeleteRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The game_server entity to be removed. /// 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; } [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 EntityTokenResponse : PlayFabBaseModel { /// /// The entity id and type. /// public EntityKey Entity; /// /// The token used to set X-EntityToken for all entity based API calls. /// public string EntityToken; /// /// The time the token will expire, if it is an expiring token, in UTC. /// public DateTime? TokenExpiration; } /// /// This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be /// included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the /// caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly /// logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and /// cannot be expired or revoked. /// [Serializable] public class GetEntityTokenRequest : 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 GetEntityTokenResponse : PlayFabResultCommon { /// /// The entity id and type. /// public EntityKey Entity; /// /// The token used to set X-EntityToken for all entity based API calls. /// public string EntityToken; /// /// The time the token will expire, if it is an expiring token, in UTC. /// public DateTime? TokenExpiration; } public enum IdentifiedDeviceType { Unknown, XboxOne, Scarlett, WindowsOneCore, WindowsOneCoreMobile, Win32, android, iOS, PlayStation, Nintendo } public enum LoginIdentityProvider { Unknown, PlayFab, Custom, GameCenter, GooglePlay, Steam, XBoxLive, PSN, Kongregate, Facebook, IOSDevice, AndroidDevice, Twitch, WindowsHello, GameServer, CustomServer, NintendoSwitch, FacebookInstantGames, OpenIdConnect, Apple, NintendoSwitchAccount, GooglePlayGames, XboxMobileStore, King } /// /// Given an entity token, validates that it hasn't expired or been revoked and will return details of the owner. /// [Serializable] public class ValidateEntityTokenRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// Client EntityToken /// public string EntityToken; } [Serializable] public class ValidateEntityTokenResponse : PlayFabResultCommon { /// /// The entity id and type. /// public EntityKey Entity; /// /// The authenticated device for this entity, for the given login /// public IdentifiedDeviceType? IdentifiedDeviceType; /// /// The identity provider for this entity, for the given login /// public LoginIdentityProvider? IdentityProvider; /// /// The ID issued by the identity provider, e.g. a XUID on Xbox Live /// public string IdentityProviderIssuedId; /// /// The lineage of this profile. /// public EntityLineage Lineage; } } #endif