#if !DISABLE_PLAYFABENTITY_API using System; using System.Collections.Generic; using PlayFab.SharedModels; namespace PlayFab.CloudScriptModels { [Serializable] public class AdCampaignAttributionModel : PlayFabBaseModel { /// /// UTC time stamp of attribution /// public DateTime AttributedAt; /// /// Attribution campaign identifier /// public string CampaignId; /// /// Attribution network name /// public string Platform; } public enum CloudScriptRevisionOption { Live, Latest, Specific } [Serializable] public class ContactEmailInfoModel : PlayFabBaseModel { /// /// The email address /// public string EmailAddress; /// /// The name of the email info data /// public string Name; /// /// The verification status of the email /// public EmailVerificationStatus? VerificationStatus; } public enum ContinentCode { AF, AN, AS, EU, NA, OC, SA, Unknown } public enum CountryCode { AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, Unknown } public enum EmailVerificationStatus { Unverified, Pending, Confirmed } [Serializable] public class EmptyResult : 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 EventHubFunctionModel : PlayFabBaseModel { /// /// The connection string for the event hub. /// public string ConnectionString; /// /// The name of the event hub that triggers the Azure Function. /// public string EventHubName; /// /// The name the function was registered under. /// public string FunctionName; } [Serializable] public class ExecuteCloudScriptResult : PlayFabResultCommon { /// /// Number of PlayFab API requests issued by the CloudScript function /// public int APIRequestsIssued; /// /// Information about the error, if any, that occurred during execution /// public ScriptExecutionError Error; public double ExecutionTimeSeconds; /// /// The name of the function that executed /// public string FunctionName; /// /// The object returned from the CloudScript function, if any /// public object FunctionResult; /// /// Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if /// the total event size is larger than 350KB. /// public bool? FunctionResultTooLarge; /// /// Number of external HTTP requests issued by the CloudScript function /// public int HttpRequestsIssued; /// /// Entries logged during the function execution. These include both entries logged in the function code using log.info() /// and log.error() and error entries for API and HTTP request failures. /// public List Logs; /// /// Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total /// event size is larger than 350KB after the FunctionResult was removed. /// public bool? LogsTooLarge; public uint MemoryConsumedBytes; /// /// Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP /// requests. /// public double ProcessorTimeSeconds; /// /// The revision of the CloudScript that executed /// public int Revision; } /// /// Executes CloudScript with the entity profile that is defined in the request. /// [Serializable] public class ExecuteEntityCloudScriptRequest : 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 name of the CloudScript function to execute /// public string FunctionName; /// /// Object that is passed in to the function as the first argument /// public object FunctionParameter; /// /// Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other /// contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. /// public bool? GeneratePlayStreamEvent; /// /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' /// executes the current live, published revision, and 'Specific' executes the specified revision. The default value is /// 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'. /// public CloudScriptRevisionOption? RevisionSelection; /// /// The specific revision to execute, when RevisionSelection is set to 'Specific' /// public int? SpecificRevision; } /// /// Executes an Azure Function with the profile of the entity that is defined in the request. /// [Serializable] public class ExecuteFunctionRequest : 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 name of the CloudScript function to execute /// public string FunctionName; /// /// Object that is passed in to the function as the FunctionArgument field of the FunctionExecutionContext data structure /// public object FunctionParameter; /// /// Generate a 'entity_executed_cloudscript_function' PlayStream event containing the results of the function execution and /// other contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. /// public bool? GeneratePlayStreamEvent; } [Serializable] public class ExecuteFunctionResult : PlayFabResultCommon { /// /// Error from the CloudScript Azure Function. /// public FunctionExecutionError Error; /// /// The amount of time the function took to execute /// public int ExecutionTimeMilliseconds; /// /// The name of the function that executed /// public string FunctionName; /// /// The object returned from the function, if any /// public object FunctionResult; /// /// Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. /// public bool? FunctionResultTooLarge; } [Serializable] public class FunctionExecutionError : PlayFabBaseModel { /// /// Error code, such as CloudScriptAzureFunctionsExecutionTimeLimitExceeded, CloudScriptAzureFunctionsArgumentSizeExceeded, /// CloudScriptAzureFunctionsReturnSizeExceeded or CloudScriptAzureFunctionsHTTPRequestError /// public string Error; /// /// Details about the error /// public string Message; /// /// Point during the execution of the function at which the error occurred, if any /// public string StackTrace; } [Serializable] public class FunctionModel : PlayFabBaseModel { /// /// The address of the function. /// public string FunctionAddress; /// /// The name the function was registered under. /// public string FunctionName; /// /// The trigger type for the function. /// public string TriggerType; } [Serializable] public class GetFunctionRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The name of the function to register /// public string FunctionName; } [Serializable] public class GetFunctionResult : PlayFabResultCommon { /// /// The connection string for the storage account containing the queue for a queue trigger Azure Function. /// public string ConnectionString; /// /// The URL to be invoked to execute an HTTP triggered function. /// public string FunctionUrl; /// /// The name of the queue for a queue trigger Azure Function. /// public string QueueName; /// /// The trigger type for the function. /// public string TriggerType; } [Serializable] public class HttpFunctionModel : PlayFabBaseModel { /// /// The name the function was registered under. /// public string FunctionName; /// /// The URL of the function. /// public string FunctionUrl; } [Serializable] public class LinkedPlatformAccountModel : PlayFabBaseModel { /// /// Linked account email of the user on the platform, if available /// public string Email; /// /// Authentication platform /// public LoginIdentityProvider? Platform; /// /// Unique account identifier of the user on the platform /// public string PlatformUserId; /// /// Linked account username of the user on the platform, if available /// public string Username; } [Serializable] public class ListEventHubFunctionsResult : PlayFabResultCommon { /// /// The list of EventHub triggered functions that are currently registered for the title. /// public List Functions; } /// /// A title can have many functions, ListHttpFunctions will return a list of all the currently registered HTTP triggered /// functions for a given title. /// [Serializable] public class ListFunctionsRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; } [Serializable] public class ListFunctionsResult : PlayFabResultCommon { /// /// The list of functions that are currently registered for the title. /// public List Functions; } [Serializable] public class ListHttpFunctionsResult : PlayFabResultCommon { /// /// The list of HTTP triggered functions that are currently registered for the title. /// public List Functions; } [Serializable] public class ListQueuedFunctionsResult : PlayFabResultCommon { /// /// The list of Queue triggered functions that are currently registered for the title. /// public List Functions; } [Serializable] public class LocationModel : PlayFabBaseModel { /// /// City name. /// public string City; /// /// The two-character continent code for this location /// public ContinentCode? ContinentCode; /// /// The two-character ISO 3166-1 country code for the country associated with the location /// public CountryCode? CountryCode; /// /// Latitude coordinate of the geographic location. /// public double? Latitude; /// /// Longitude coordinate of the geographic location. /// public double? Longitude; } 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 } [Serializable] public class LogStatement : PlayFabBaseModel { /// /// Optional object accompanying the message as contextual information /// public object Data; /// /// 'Debug', 'Info', or 'Error' /// public string Level; public string Message; } [Serializable] public class MembershipModel : PlayFabBaseModel { /// /// Whether this membership is active. That is, whether the MembershipExpiration time has been reached. /// public bool IsActive; /// /// The time this membership expires /// public DateTime MembershipExpiration; /// /// The id of the membership /// public string MembershipId; /// /// Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been /// overridden, this will be the new expiration time. /// public DateTime? OverrideExpiration; /// /// The list of subscriptions that this player has for this membership /// public List Subscriptions; } /// /// Identifier by either name or ID. Note that a name may change due to renaming, or reused after being deleted. ID is /// immutable and unique. /// [Serializable] public class NameIdentifier : PlayFabBaseModel { /// /// Id Identifier, if present /// public string Id; /// /// Name Identifier, if present /// public string Name; } [Serializable] public class PlayerProfileModel : PlayFabBaseModel { /// /// List of advertising campaigns the player has been attributed to /// public List AdCampaignAttributions; /// /// URL of the player's avatar image /// public string AvatarUrl; /// /// If the player is currently banned, the UTC Date when the ban expires /// public DateTime? BannedUntil; /// /// List of all contact email info associated with the player account /// public List ContactEmailAddresses; /// /// Player record created /// public DateTime? Created; /// /// Player display name /// public string DisplayName; /// /// List of experiment variants for the player. Note that these variants are not guaranteed to be up-to-date when returned /// during login because the player profile is updated only after login. Instead, use the LoginResult.TreatmentAssignment /// property during login to get the correct variants and variables. /// public List ExperimentVariants; /// /// UTC time when the player most recently logged in to the title /// public DateTime? LastLogin; /// /// List of all authentication systems linked to this player account /// public List LinkedAccounts; /// /// List of geographic locations from which the player has logged in to the title /// public List Locations; /// /// List of memberships for the player, along with whether are expired. /// public List Memberships; /// /// Player account origination /// public LoginIdentityProvider? Origination; /// /// PlayFab player account unique identifier /// public string PlayerId; /// /// Publisher this player belongs to /// public string PublisherId; /// /// List of configured end points registered for sending the player push notifications /// public List PushNotificationRegistrations; /// /// List of leaderboard statistic values for the player /// public List Statistics; /// /// List of player's tags for segmentation /// public List Tags; /// /// Title ID this player profile applies to /// public string TitleId; /// /// Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a /// whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. /// public uint? TotalValueToDateInUSD; /// /// List of the player's lifetime purchase totals, summed by real-money currency /// public List ValuesToDate; } [Serializable] public class PlayStreamEventEnvelopeModel : PlayFabBaseModel { /// /// The ID of the entity the event is about. /// public string EntityId; /// /// The type of the entity the event is about. /// public string EntityType; /// /// Data specific to this event. /// public string EventData; /// /// The name of the event. /// public string EventName; /// /// The namespace of the event. /// public string EventNamespace; /// /// Settings for the event. /// public string EventSettings; } [Serializable] public class PostFunctionResultForEntityTriggeredActionRequest : 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 result of the function execution. /// public ExecuteFunctionResult FunctionResult; } [Serializable] public class PostFunctionResultForFunctionExecutionRequest : 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 result of the function execution. /// public ExecuteFunctionResult FunctionResult; } [Serializable] public class PostFunctionResultForPlayerTriggeredActionRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The result of the function execution. /// public ExecuteFunctionResult FunctionResult; /// /// The player profile the function was invoked with. /// public PlayerProfileModel PlayerProfile; /// /// The triggering PlayStream event, if any, that caused the function to be invoked. /// public PlayStreamEventEnvelopeModel PlayStreamEventEnvelope; } [Serializable] public class PostFunctionResultForScheduledTaskRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The result of the function execution /// public ExecuteFunctionResult FunctionResult; /// /// The id of the scheduled task that invoked the function. /// public NameIdentifier ScheduledTaskId; } public enum PushNotificationPlatform { ApplePushNotificationService, GoogleCloudMessaging } [Serializable] public class PushNotificationRegistrationModel : PlayFabBaseModel { /// /// Notification configured endpoint /// public string NotificationEndpointARN; /// /// Push notification platform /// public PushNotificationPlatform? Platform; } [Serializable] public class QueuedFunctionModel : PlayFabBaseModel { /// /// The connection string for the Azure Storage Account that hosts the queue. /// public string ConnectionString; /// /// The name the function was registered under. /// public string FunctionName; /// /// The name of the queue that triggers the Azure Function. /// public string QueueName; } /// /// A title can have many functions, RegisterEventHubFunction associates a function name with an event hub name and /// connection string. /// [Serializable] public class RegisterEventHubFunctionRequest : PlayFabRequestCommon { /// /// A connection string for the namespace of the event hub for the Azure Function. /// public string ConnectionString; /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The name of the event hub for the Azure Function. /// public string EventHubName; /// /// The name of the function to register /// public string FunctionName; } [Serializable] public class RegisterHttpFunctionRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The name of the function to register /// public string FunctionName; /// /// Full URL for Azure Function that implements the function. /// public string FunctionUrl; } /// /// A title can have many functions, RegisterQueuedFunction associates a function name with a queue name and connection /// string. /// [Serializable] public class RegisterQueuedFunctionRequest : PlayFabRequestCommon { /// /// A connection string for the storage account that hosts the queue for the Azure Function. /// public string ConnectionString; /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The name of the function to register /// public string FunctionName; /// /// The name of the queue for the Azure Function. /// public string QueueName; } [Serializable] public class ScriptExecutionError : PlayFabBaseModel { /// /// Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, /// CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError /// public string Error; /// /// Details about the error /// public string Message; /// /// Point during the execution of the script at which the error occurred, if any /// public string StackTrace; } [Serializable] public class StatisticModel : PlayFabBaseModel { /// /// Statistic name /// public string Name; /// /// Statistic value /// public int Value; /// /// Statistic version (0 if not a versioned statistic) /// public int Version; } [Serializable] public class SubscriptionModel : PlayFabBaseModel { /// /// When this subscription expires. /// public DateTime Expiration; /// /// The time the subscription was orignially purchased /// public DateTime InitialSubscriptionTime; /// /// Whether this subscription is currently active. That is, if Expiration > now. /// public bool IsActive; /// /// The status of this subscription, according to the subscription provider. /// public SubscriptionProviderStatus? Status; /// /// The id for this subscription /// public string SubscriptionId; /// /// The item id for this subscription from the primary catalog /// public string SubscriptionItemId; /// /// The provider for this subscription. Apple or Google Play are supported today. /// public string SubscriptionProvider; } public enum SubscriptionProviderStatus { NoError, Cancelled, UnknownError, BillingError, ProductUnavailable, CustomerDidNotAcceptPriceChange, FreeTrial, PaymentPending } [Serializable] public class TagModel : PlayFabBaseModel { /// /// Full value of the tag, including namespace /// public string TagValue; } public enum TriggerType { HTTP, Queue, EventHub } [Serializable] public class UnregisterFunctionRequest : PlayFabRequestCommon { /// /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). /// public Dictionary CustomTags; /// /// The name of the function to register /// public string FunctionName; } [Serializable] public class ValueToDateModel : PlayFabBaseModel { /// /// ISO 4217 code of the currency used in the purchases /// public string Currency; /// /// Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and /// ninety-nine cents when Currency is 'USD') /// public uint TotalValue; /// /// Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine /// dollars and ninety-nine cents when Currency is 'USD'. /// public string TotalValueAsDecimal; } } #endif