/
CS2AFHelperClasses.cs
108 lines (93 loc) · 3.97 KB
/
CS2AFHelperClasses.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright (C) Microsoft Corporation. All rights reserved.
namespace PlayFab.Samples
{
using System;
using System.Collections.Generic;
// Shared models
public class TitleAuthenticationContext
{
public string Id { get; set; }
public string EntityToken { get; set; }
}
// Models via ExecuteFunction API
public class FunctionExecutionContext<T>
{
public PlayFab.ProfilesModels.EntityProfileBody CallerEntityProfile { get; set; }
public TitleAuthenticationContext TitleAuthenticationContext { get; set; }
public bool? GeneratePlayStreamEvent { get; set; }
public T FunctionArgument { get; set; }
}
public class FunctionExecutionContext : FunctionExecutionContext<object>
{
}
// Models via Player PlayStream event, entering or leaving a
// player segment or as part of a player segment based scheduled task.
public class PlayerPlayStreamFunctionExecutionContext<T>
{
public PlayFab.CloudScriptModels.PlayerProfileModel PlayerProfile { get; set; }
public bool PlayerProfileTruncated { get; set; }
public PlayFab.CloudScriptModels.PlayStreamEventEnvelopeModel PlayStreamEventEnvelope { get; set; }
public TitleAuthenticationContext TitleAuthenticationContext { get; set; }
public bool? GeneratePlayStreamEvent { get; set; }
public T FunctionArgument { get; set; }
}
public class PlayerPlayStreamFunctionExecutionContext : PlayerPlayStreamFunctionExecutionContext<object>
{
}
// Models via Scheduled task
public class PlayStreamEventHistory
{
public string ParentTriggerId { get; set; }
public string ParentEventId { get; set; }
public bool TriggeredEvents { get; set; }
}
public class ScheduledTaskFunctionExecutionContext<T>
{
public PlayFab.CloudScriptModels.NameIdentifier ScheduledTaskNameId { get; set; }
public Stack<PlayStreamEventHistory> EventHistory { get; set; }
public TitleAuthenticationContext TitleAuthenticationContext { get; set; }
public bool? GeneratePlayStreamEvent { get; set; }
public T FunctionArgument { get; set; }
}
public class ScheduledTaskFunctionExecutionContext : ScheduledTaskFunctionExecutionContext<object>
{
}
// Models via entity PlayStream event, entering or leaving an
// entity segment or as part of an entity segment based scheduled task.
public class EventFullName
{
public string Name { get; set; }
public string Namespace { get; set; }
}
public class OriginInfo
{
public string Id { get; set; }
public DateTime? Timestamp { get; set; }
}
public class EntityPlayStreamEvent<T>
{
public string SchemaVersion { get; set; }
public EventFullName FullName { get; set; }
public string Id { get; set; }
public DateTime Timestamp { get; set; }
public PlayFab.CloudScriptModels.EntityKey Entity { get; set; }
public PlayFab.CloudScriptModels.EntityKey Originator { get; set; }
public OriginInfo OriginInfo { get; set; }
public T Payload { get; set; }
public PlayFab.ProfilesModels.EntityLineage EntityLineage { get; set; }
}
public class EntityPlayStreamEvent : EntityPlayStreamEvent<object>
{
}
public class EntityPlayStreamFunctionExecutionContext<TPayload, TArg>
{
public PlayFab.ProfilesModels.EntityProfileBody CallerEntityProfile { get; set; }
public EntityPlayStreamEvent<TPayload> PlayStreamEvent { get; set; }
public TitleAuthenticationContext TitleAuthenticationContext { get; set; }
public bool? GeneratePlayStreamEvent { get; set; }
public TArg FunctionArgument { get; set; }
}
public class EntityPlayStreamFunctionExecutionContext : EntityPlayStreamFunctionExecutionContext<object, object>
{
}
}