@@ -12,25 +12,25 @@ namespace Dres.Unityclient
1212 /// <br />
1313 /// This class is held deliberately stateless (no session ID etc.) to allow multi-user scenarios in the future.
1414 /// </summary>
15- public static class DresWrapper
15+ internal static class DresWrapper
1616 {
1717
1818 /// <summary>
1919 /// The deliberately single Logging Api instance of DRES. Used to send logs to DRES
2020 /// </summary>
21- public static readonly LogApi LogApi = new LogApi ( DresConfigManager . Instance . ApiConfiguration ) ;
21+ internal static readonly LogApi LogApi = new LogApi ( DresConfigManager . Instance . ApiConfiguration ) ;
2222 /// <summary>
2323 /// The deliberately single Status Api instance of DRES. Used to get the status of DRES
2424 /// </summary>
25- public static readonly StatusApi StatusApi = new StatusApi ( DresConfigManager . Instance . ApiConfiguration ) ;
25+ internal static readonly StatusApi StatusApi = new StatusApi ( DresConfigManager . Instance . ApiConfiguration ) ;
2626 /// <summary>
2727 /// The deliberately single Submission Api instance of DRES. Used to submit media items during competitions to DRES:
2828 /// </summary>
29- public static readonly SubmissionApi SubmissionApi = new SubmissionApi ( DresConfigManager . Instance . ApiConfiguration ) ;
29+ internal static readonly SubmissionApi SubmissionApi = new SubmissionApi ( DresConfigManager . Instance . ApiConfiguration ) ;
3030 /// <summary>
3131 /// The deliberately single User Api instance of DRES. Used to log into DRES and retrieve the session id of the user.
3232 /// </summary>
33- public static readonly UserApi UserApi = new UserApi ( DresConfigManager . Instance . ApiConfiguration ) ;
33+ internal static readonly UserApi UserApi = new UserApi ( DresConfigManager . Instance . ApiConfiguration ) ;
3434
3535 /// <summary>
3636 /// Login to DRES with given username and password.
@@ -41,7 +41,7 @@ public static class DresWrapper
4141 /// <param name="password">The DRES password</param>
4242 /// <returns>The login state on success.</returns>
4343 /// <exception cref="ApiException">If the config has no credentials set and no credentials file exists</exception>
44- public static async Task < UserDetails > Login ( string user , string password )
44+ internal static async Task < UserDetails > Login ( string user , string password )
4545 {
4646 var loginRequest = new LoginRequest ( user , password ) ;
4747 return await UserApi . PostApiV1LoginAsync ( loginRequest ) ;
@@ -57,10 +57,24 @@ public static async Task<UserDetails> Login(string user, string password)
5757 /// If no notion of frames exist for the item, this can likely be omitted.</param>
5858 /// <returns>The submission state on success / failure.</returns>
5959 /// <exception cref="ApiException">A 404 if there is no ongoing competition for this session, a 403 if there is no such user</exception>
60- public static async Task < SuccessfulSubmissionsStatus > Submit ( string item , string session , int ? frame = null )
60+ internal static async Task < SuccessfulSubmissionsStatus > Submit ( string item , string session , int ? frame = null )
6161 {
6262 return await SubmissionApi . GetApiV1SubmitAsync ( item : item , frame : frame , session : session ) ;
6363 }
64+
65+ /// <summary>
66+ /// Submits given TEXT to the DRES endpoint.
67+ /// Submissions are only allowed during active competitions (inferred from the given sesssion id)
68+ /// </summary>
69+ /// <param name="text">The submission in textual form (might also be a number) submit</param>
70+ /// <param name="session">The session id to which this submission belongs</param>
71+ /// <returns>The submission state on success / failure.</returns>
72+ /// <exception cref="ApiException">A 404 if there is no ongoing competition for this session, a 403 if there is no such user</exception>
73+ internal static async Task < SuccessfulSubmissionsStatus > SubmitText ( string text , string session )
74+ {
75+ return await SubmissionApi . GetApiV1SubmitAsync ( text = text , session = session ) ;
76+ }
77+
6478
6579 /// <summary>
6680 /// Send result logs to the DRES endpoint.
@@ -75,7 +89,7 @@ public static async Task<SuccessfulSubmissionsStatus> Submit(string item, string
7589 /// <param name="session">The session id to which this log belongs</param>
7690 /// <returns>The state of success / failure of the log sending.</returns>
7791 /// <exception cref="ApiException">A 404 if there is no ongoing competition for this session, a 403 if there is no such user</exception>
78- public static async Task < SuccessStatus > LogResults ( long timestamp , string sortType , string resultSetAvailability ,
92+ internal static async Task < SuccessStatus > LogResults ( long timestamp , string sortType , string resultSetAvailability ,
7993 List < QueryResult > results , List < QueryEvent > events , string session )
8094 {
8195 var resultLog = new QueryResultLog ( timestamp , sortType , resultSetAvailability , results , events ) ;
@@ -92,7 +106,7 @@ public static async Task<SuccessStatus> LogResults(long timestamp, string sortTy
92106 /// <param name="session">The session id to which this log belongs</param>
93107 /// <returns>The state of success / failure of the log sending.</returns>
94108 /// <exception cref="ApiException">A 404 if there is no ongoing competition for this session, a 403 if there is no such user</exception>
95- public static async Task < SuccessStatus > LogQueryEvents ( long timestamp , List < QueryEvent > events , string session )
109+ internal static async Task < SuccessStatus > LogQueryEvents ( long timestamp , List < QueryEvent > events , string session )
96110 {
97111 var queryEventLog = new QueryEventLog ( timestamp , events ) ;
98112 return await LogApi . PostApiV1LogQueryAsync ( session , queryEventLog ) ;
0 commit comments