public async global::System.Threading.Tasks.Task HelloWorldAsync(global::automl.HelloWorldStruct input, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("HelloWorld", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.HelloWorldArgs()
                {
                    Input = input,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.HelloWorldResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
Beispiel #2
0
            public async Task TestAsync(int _class, int _struct, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Test", TMessageType.Call, SeqId), cancellationToken);

                var args = new TestArgs();

                args._class  = _class;
                args._struct = _struct;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new TestResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
Beispiel #3
0
            public async Task UpdateAsync(Person person, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Update", TMessageType.Call, SeqId), cancellationToken);

                var args = new UpdateArgs();

                args.Person = person;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new UpdateResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
Beispiel #4
0
            public async Task ShowInGameOverlayAsync(Ruyi.SDK.Overlay.OverlayState arguments, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("ShowInGameOverlay", TMessageType.Call, SeqId), cancellationToken);

                var args = new ShowInGameOverlayArgs();

                args.Arguments = arguments;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new ShowInGameOverlayResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
Beispiel #5
0
            public async Task needSplitAsync(long rootID, TNeedSplitInfo splitInfo, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("needSplit", TMessageType.Call, SeqId), cancellationToken);

                var args = new needSplitArgs();

                args.RootID    = rootID;
                args.SplitInfo = splitInfo;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new needSplitResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
        public async Task pingAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("ping", TMessageType.Call, SeqId), cancellationToken);

            var args = new pingArgs();

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new pingResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            return;
        }
Beispiel #7
0
            public async Task <List <User> > GetAllAsync(CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("GetAll", TMessageType.Call, SeqId), cancellationToken);

                var args = new GetAllArgs();

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new GetAllResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetAll failed: unknown result");
            }
        public async Task zipAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("zip", TMessageType.Oneway, SeqId), cancellationToken);

            var args = new zipArgs();

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);
        }
Beispiel #9
0
            public async Task saveDependenciesAsync(Dependencies dependencies, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("saveDependencies", TMessageType.Oneway, SeqId), cancellationToken);

                var args = new saveDependenciesArgs();

                args.Dependencies = dependencies;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);
            }
Beispiel #10
0
            public async Task emitBatchAsync(Jaeger.Thrift.Batch batch, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("emitBatch", TMessageType.Oneway, SeqId), cancellationToken);

                var args = new emitBatchArgs();

                args.Batch = batch;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);
            }
Beispiel #11
0
            public async Task removeCacheAsync(long key, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("removeCache", TMessageType.Oneway, SeqId), cancellationToken);

                var args = new removeCacheArgs();

                args.Key = key;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);
            }
Beispiel #12
0
            public async Task emitZipkinBatchAsync(List <Jaeger.Thrift.Agent.Zipkin.Span> spans, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("emitZipkinBatch", TMessageType.Oneway, SeqId), cancellationToken);

                var args = new emitZipkinBatchArgs();

                args.Spans = spans;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);
            }
Beispiel #13
0
            public async global::System.Threading.Tasks.Task saveDependenciesAsync(global::Jaeger.Thrift.Agent.Dependencies dependencies, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("saveDependencies", TMessageType.Oneway, SeqId), cancellationToken);

                var args = new InternalStructs.saveDependenciesArgs()
                {
                    Dependencies = dependencies,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);
            }
            public async global::System.Threading.Tasks.Task emitBatchAsync(global::Jaeger.Thrift.Batch batch, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("emitBatch", TMessageType.Oneway, SeqId), cancellationToken);

                var args = new InternalStructs.emitBatchArgs()
                {
                    Batch = batch,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);
            }
Beispiel #15
0
        public async Task <short> getLibraryByIdConsumerAsync(short idConsumer, CancellationToken cancellationToken = default(CancellationToken))
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("getLibraryByIdConsumer", TMessageType.Call, SeqId), cancellationToken);

            var args = new getLibraryByIdConsumerArgs();

            args.IdConsumer = idConsumer;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new getLibraryByIdConsumerResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.sErrorNotFoundE)
            {
                throw result.SErrorNotFoundE;
            }
            if (result.__isset.sErrorSystemE)
            {
                throw result.SErrorSystemE;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getLibraryByIdConsumer failed: unknown result");
        }
Beispiel #16
0
        public async Task <SpotNearbyResponse> lookupNearbyAsync(Location location, SpotCategory category, string query, string countryAreaCode, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("lookupNearby", TMessageType.Call, SeqId), cancellationToken);

            var args = new lookupNearbyArgs();

            args.Location        = location;
            args.Category        = category;
            args.Query           = query;
            args.CountryAreaCode = countryAreaCode;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new lookupNearbyResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "lookupNearby failed: unknown result");
        }
Beispiel #17
0
        public async Task <SnsFriends> getSnsFriendsAsync(SnsIdType snsIdType, string snsAccessToken, int startIdx, int limit, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("getSnsFriends", TMessageType.Call, SeqId), cancellationToken);

            var args = new getSnsFriendsArgs();

            args.SnsIdType      = snsIdType;
            args.SnsAccessToken = snsAccessToken;
            args.StartIdx       = startIdx;
            args.Limit          = limit;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new getSnsFriendsResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getSnsFriends failed: unknown result");
        }
Beispiel #18
0
        public async Task <MessageOperations> fetchMessageOperationsAsync(long localRevision, long lastOpTimestamp, int count, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("fetchMessageOperations", TMessageType.Call, SeqId), cancellationToken);

            var args = new fetchMessageOperationsArgs();

            args.LocalRevision   = localRevision;
            args.LastOpTimestamp = lastOpTimestamp;
            args.Count           = count;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new fetchMessageOperationsResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "fetchMessageOperations failed: unknown result");
        }
Beispiel #19
0
            public async global::System.Threading.Tasks.Task <THashSet <THashSet <THashSet <global::OptReqDefTest.Distance> > > > DoItNowAsync(List <List <List <global::OptReqDefTest.RaceDetails> > > rd, int mitDefault, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("DoItNow", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.DoItNowArgs()
                {
                    Rd         = rd,
                    MitDefault = mitDefault,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.DoItNowResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.cbb)
                {
                    throw result.Cbb;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "DoItNow failed: unknown result");
            }
Beispiel #20
0
            public async global::System.Threading.Tasks.Task <global::Thrift5320.enums.Task> TaskAsync(global::Thrift5320.structs.Task foo, global::Thrift5320.Task.Foobar bar, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Task", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.TaskArgs()
                {
                    Foo = foo,
                    Bar = bar,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.TaskResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.error)
                {
                    throw result.Error;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Task failed: unknown result");
            }
Beispiel #21
0
            public async Task <Ruyi.SDK.UserServiceExternal.UserInfo_Public> GetPlayingUserInfoAsync(string appId, string userId, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("GetPlayingUserInfo", TMessageType.Call, SeqId), cancellationToken);

                var args = new GetPlayingUserInfoArgs();

                args.AppId  = appId;
                args.UserId = userId;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new GetPlayingUserInfoResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.error1)
                {
                    throw result.Error1;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetPlayingUserInfo failed: unknown result");
            }
Beispiel #22
0
        public async Task <SpotPhoneNumberResponse> lookupByPhoneNumberAsync(string countryAreaCode, string phoneNumber, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("lookupByPhoneNumber", TMessageType.Call, SeqId), cancellationToken);

            var args = new lookupByPhoneNumberArgs();

            args.CountryAreaCode = countryAreaCode;
            args.PhoneNumber     = phoneNumber;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new lookupByPhoneNumberResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "lookupByPhoneNumber failed: unknown result");
        }
Beispiel #23
0
            public async global::System.Threading.Tasks.Task <global::APIGateway.Thrift.Generated.NotificationTypes.NotificationQueueResponse> SendNotificationAsync(global::APIGateway.Thrift.Generated.NotificationTypes.NotificationQueueRequest queueRequest, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("SendNotification", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.SendNotificationArgs()
                {
                    QueueRequest = queueRequest,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.SendNotificationResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.ne)
                {
                    throw result.Ne;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendNotification failed: unknown result");
            }
Beispiel #24
0
            public async Task <int> calculateAsync(int logid, Work w, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("calculate", TMessageType.Call, SeqId), cancellationToken);

                var args = new calculateArgs();

                args.Logid = logid;
                args.W     = w;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new calculateResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.ouch)
                {
                    throw result.Ouch;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "calculate failed: unknown result");
            }
Beispiel #25
0
        public async Task <List <LastReadMessageIds> > multiGetLastReadMessageIdsAsync(List <string> chatIds, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("multiGetLastReadMessageIds", TMessageType.Call, SeqId), cancellationToken);

            var args = new multiGetLastReadMessageIdsArgs();

            args.ChatIds = chatIds;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new multiGetLastReadMessageIdsResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "multiGetLastReadMessageIds failed: unknown result");
        }
Beispiel #26
0
        public async Task <BotUseInfo> getBotUseInfoAsync(string botMid, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("getBotUseInfo", TMessageType.Call, SeqId), cancellationToken);

            var args = new getBotUseInfoArgs();

            args.BotMid = botMid;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new getBotUseInfoResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getBotUseInfo failed: unknown result");
        }
Beispiel #27
0
        public async Task sendChatCheckedByWatermarkAsync(int seq, string mid, long watermark, sbyte sessionId, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("sendChatCheckedByWatermark", TMessageType.Call, SeqId), cancellationToken);

            var args = new sendChatCheckedByWatermarkArgs();

            args.Seq       = seq;
            args.Mid       = mid;
            args.Watermark = watermark;
            args.SessionId = sessionId;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new sendChatCheckedByWatermarkResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.e)
            {
                throw result.E;
            }
            return;
        }
Beispiel #28
0
        public async Task postSnsInvitationMessageAsync(SnsIdType snsIdType, string snsAccessToken, string toSnsUserId, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("postSnsInvitationMessage", TMessageType.Call, SeqId), cancellationToken);

            var args = new postSnsInvitationMessageArgs();

            args.SnsIdType      = snsIdType;
            args.SnsAccessToken = snsAccessToken;
            args.ToSnsUserId    = toSnsUserId;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new postSnsInvitationMessageResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.e)
            {
                throw result.E;
            }
            return;
        }
            public async global::System.Threading.Tasks.Task <List <global::Jaeger.Thrift.BatchSubmitResponse> > submitBatchesAsync(List <global::Jaeger.Thrift.Batch> batches, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("submitBatches", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.submitBatchesArgs()
                {
                    Batches = batches,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.submitBatchesResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "submitBatches failed: unknown result");
            }
            public async global::System.Threading.Tasks.Task <global::PElementServer.Thrift.PElement> @GetAsync(string name, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Get", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.GetArgs()
                {
                    Name = name,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.GetResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Get failed: unknown result");
            }