/// <summary> /// Returns client's IP as detected by Dynali. /// </summary> /// <returns>string, IP Address</returns> public async Task <string> RetrieveMyIpAsync() { MyIpResponse response = JsonResponse.Parse <MyIpResponse>(await CallAsync(new MyIpAction())); if (response.IsSuccessful) { return(response.Data.Ip); } throw new DynaliException(response.Code, response.Message); }
/// <summary> /// Executes provided DynaliAction. /// </summary> /// <typeparam name="T">JsonResponse deriative</typeparam> /// <param name="action">Action details</param> /// <returns>JsonResponse deriative</returns> protected async Task <T> ExecuteActionAsync <T>(IDynaliAction action) where T : JsonResponse { return(JsonResponse.Parse <T>(await CallAsync(action))); }
/// <summary> /// Executes provided DynaliAction. /// </summary> /// <typeparam name="T">JsonResponse deriative</typeparam> /// <param name="action">Action details</param> /// <returns>JsonResponse deriative</returns> protected T ExecuteAction <T>(IDynaliAction action) where T : JsonResponse { return(JsonResponse.Parse <T>(Call(action))); }