|
| 1 | + |
| 2 | +namespace Beamable.Api.Autogenerated.Session |
| 3 | +{ |
| 4 | + using Beamable.Api.Autogenerated.Models; |
| 5 | + using Beamable.Common.Content; |
| 6 | + using Beamable.Common; |
| 7 | + using IBeamableRequester = Beamable.Common.Api.IBeamableRequester; |
| 8 | + using Method = Beamable.Common.Api.Method; |
| 9 | + using Beamable.Common.Dependencies; |
| 10 | + |
| 11 | + public partial interface IBeamSessionApi |
| 12 | + { |
| 13 | + /// <summary> |
| 14 | + /// Start a session for a player. Used by old clients whose POST /basic/session |
| 15 | + ///is forwarded by the Scala proxy. |
| 16 | + /// |
| 17 | + /// POST call to `/api/sessions` endpoint. |
| 18 | + /// </summary> |
| 19 | + /// <param name="gsReq">The <see cref="SessionActorStartSessionRequest"/> instance to use for the request</param> |
| 20 | + /// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param> |
| 21 | + /// <returns>A promise containing the <see cref="ApiSessionsPostSessionResponse"/></returns> |
| 22 | + Promise<ApiSessionsPostSessionResponse> PostApiSessions(SessionActorStartSessionRequest gsReq, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader); |
| 23 | + /// <summary> |
| 24 | + /// Legacy session heartbeat. Bridges into the actor presence system |
| 25 | + ///so old clients that don't use WebSocket presence pings appear online. |
| 26 | + /// |
| 27 | + /// POST call to `/api/sessions/heartbeat` endpoint. |
| 28 | + /// </summary> |
| 29 | + /// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param> |
| 30 | + /// <returns>A promise containing the <see cref="ApiSessionsHeartbeatPostSessionResponse"/></returns> |
| 31 | + Promise<ApiSessionsHeartbeatPostSessionResponse> PostHeartbeat([System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader); |
| 32 | + /// <summary> |
| 33 | + /// Legacy online status endpoint. Handles GET /sessions/status forwarded |
| 34 | + ///by the Scala proxy for old clients that query online status via the |
| 35 | + ///session service rather than the presence API. |
| 36 | + /// |
| 37 | + /// GET call to `/api/sessions/status` endpoint. |
| 38 | + /// </summary> |
| 39 | + /// <param name="intervalSecs"></param> |
| 40 | + /// <param name="playerIds"></param> |
| 41 | + /// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param> |
| 42 | + /// <returns>A promise containing the <see cref="ApiSessionsStatusGetSessionResponse"/></returns> |
| 43 | + Promise<ApiSessionsStatusGetSessionResponse> GetStatus([System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<long> intervalSecs, [System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<string> playerIds, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader); |
| 44 | + } |
| 45 | + public partial class BeamSessionApi : IBeamSessionApi |
| 46 | + { |
| 47 | + /// <summary> |
| 48 | + /// Start a session for a player. Used by old clients whose POST /basic/session |
| 49 | + ///is forwarded by the Scala proxy. |
| 50 | + /// |
| 51 | + /// POST call to `/api/sessions` endpoint. |
| 52 | + /// </summary> |
| 53 | + /// <param name="gsReq">The <see cref="SessionActorStartSessionRequest"/> instance to use for the request</param> |
| 54 | + /// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param> |
| 55 | + /// <returns>A promise containing the <see cref="ApiSessionsPostSessionResponse"/></returns> |
| 56 | + public virtual Promise<ApiSessionsPostSessionResponse> PostApiSessions(SessionActorStartSessionRequest gsReq, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader) |
| 57 | + { |
| 58 | + string gsUrl = "/api/sessions"; |
| 59 | + // make the request and return the result |
| 60 | + return _requester.Request<ApiSessionsPostSessionResponse>(Method.POST, gsUrl, Beamable.Serialization.JsonSerializable.ToJson(gsReq), includeAuthHeader, this.Serialize<ApiSessionsPostSessionResponse>); |
| 61 | + } |
| 62 | + /// <summary> |
| 63 | + /// Legacy session heartbeat. Bridges into the actor presence system |
| 64 | + ///so old clients that don't use WebSocket presence pings appear online. |
| 65 | + /// |
| 66 | + /// POST call to `/api/sessions/heartbeat` endpoint. |
| 67 | + /// </summary> |
| 68 | + /// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param> |
| 69 | + /// <returns>A promise containing the <see cref="ApiSessionsHeartbeatPostSessionResponse"/></returns> |
| 70 | + public virtual Promise<ApiSessionsHeartbeatPostSessionResponse> PostHeartbeat([System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader) |
| 71 | + { |
| 72 | + string gsUrl = "/api/sessions/heartbeat"; |
| 73 | + // make the request and return the result |
| 74 | + return _requester.Request<ApiSessionsHeartbeatPostSessionResponse>(Method.POST, gsUrl, default(object), includeAuthHeader, this.Serialize<ApiSessionsHeartbeatPostSessionResponse>); |
| 75 | + } |
| 76 | + /// <summary> |
| 77 | + /// Legacy online status endpoint. Handles GET /sessions/status forwarded |
| 78 | + ///by the Scala proxy for old clients that query online status via the |
| 79 | + ///session service rather than the presence API. |
| 80 | + /// |
| 81 | + /// GET call to `/api/sessions/status` endpoint. |
| 82 | + /// </summary> |
| 83 | + /// <param name="intervalSecs"></param> |
| 84 | + /// <param name="playerIds"></param> |
| 85 | + /// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param> |
| 86 | + /// <returns>A promise containing the <see cref="ApiSessionsStatusGetSessionResponse"/></returns> |
| 87 | + public virtual Promise<ApiSessionsStatusGetSessionResponse> GetStatus([System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<long> intervalSecs, [System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<string> playerIds, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader) |
| 88 | + { |
| 89 | + string gsUrl = "/api/sessions/status"; |
| 90 | + string gsQuery = "?"; |
| 91 | + System.Collections.Generic.List<string> gsQueries = new System.Collections.Generic.List<string>(); |
| 92 | + if (((playerIds != default(OptionalString)) |
| 93 | + && playerIds.HasValue)) |
| 94 | + { |
| 95 | + gsQueries.Add(string.Concat("playerIds=", playerIds.Value.ToString())); |
| 96 | + } |
| 97 | + if (((intervalSecs != default(OptionalLong)) |
| 98 | + && intervalSecs.HasValue)) |
| 99 | + { |
| 100 | + gsQueries.Add(string.Concat("intervalSecs=", intervalSecs.Value.ToString())); |
| 101 | + } |
| 102 | + if ((gsQueries.Count > 0)) |
| 103 | + { |
| 104 | + gsQuery = string.Concat(gsQuery, string.Join("&", gsQueries)); |
| 105 | + gsUrl = string.Concat(gsUrl, gsQuery); |
| 106 | + } |
| 107 | + // make the request and return the result |
| 108 | + return _requester.Request<ApiSessionsStatusGetSessionResponse>(Method.GET, gsUrl, default(object), includeAuthHeader, this.Serialize<ApiSessionsStatusGetSessionResponse>); |
| 109 | + } |
| 110 | + } |
| 111 | +} |
0 commit comments