Request for Syncano Api Command.
Inheritance: ISyncanoRequest
        private Task <T> SendCommandAsync <T>(ApiCommandRequest request, Func <JToken, T> getResult)
        {
            var syncanoConversation = new SyncanoConversation <T>(request, getResult);

            _conversationsByMessageId.TryAdd(syncanoConversation.Id, syncanoConversation);

            SendRequestAsync(syncanoConversation).ContinueWith(task =>
            {
                if (task.IsFaulted)
                {
                    syncanoConversation.SetError(new SyncanoException("Failed to send request", task.Exception.Flatten()));
                }
            });

            return(syncanoConversation.ResponseObservable.ToTask());
        }
        private ApiCommandRequest CreateCommandRequest(string methodName, object parameters)
        {
            var request = new ApiCommandRequest(methodName, GetMessageId());


            if (parameters != null)
            {
                foreach (var eachProperty in parameters.GetType().GetProperties())
                {
                    if (eachProperty.GetValue(parameters) != null)
                    {
                        if (eachProperty.GetValue(parameters).GetType().IsConstructedGenericType&&
                            eachProperty.GetValue(parameters).GetType().GetGenericTypeDefinition() == typeof(Dictionary <,>))
                        {
                            if (eachProperty.GetValue(parameters) is Dictionary <string, string> )
                            {
                                var dictionary = (Dictionary <string, string>)eachProperty.GetValue(parameters);
                                foreach (var item in dictionary)
                                {
                                    request.Params.Add(item.Key, item.Value);
                                }
                            }
                            else
                            {
                                var dictionary = (Dictionary <string, object>)eachProperty.GetValue(parameters);
                                foreach (var item in dictionary)
                                {
                                    request.Params.Add(item.Key, item.Value);
                                }
                            }
                        }
                        else
                        {
                            request.Params.Add(eachProperty.Name, eachProperty.GetValue(parameters));
                        }
                    }
                }
            }
            return(request);
        }
 private Task <T> SendCommandAsync <T>(ApiCommandRequest request, string contentToken)
 {
     return(SendCommandAsync <T>(request, jo => jo.SelectToken("data").SelectToken(contentToken).ToObject <T>()));
 }