/// <summary>
 /// 
 /// </summary>
 /// <param name="audio"></param>
 /// <param name="device"></param>
 internal UserProfileModel PostProfile(UserProfileModel userProfile, DeviceProfile device)
 {
     try
     {
         string relativeUri = String.Format(UriTemplates.POST_PROFILE_URI, _session.SessionId);
         string absoluteUri = TywiConfiguration.TywiServiceUri + relativeUri;
         SessionApiRequest<UserProfileModel, UserProfileModel> request = new SessionApiRequest<UserProfileModel, UserProfileModel>(
             device, absoluteUri, Http.HttpUtilities.Methods.POST, userProfile);
         return this.ProcessRequest<UserProfileModel, UserProfileModel>(request);
     }
     catch (Exception exc)
     {
         throw new AccessDeniedException(String.Format("Failed to post audio from device {0}: {1}", device.profile.id, exc.Message), exc);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="gender"></param>
 /// <param name="language"></param>
 /// <param name="translationEngine"></param>
 private void InitUser(string name, string textLanguage, string audioLanguage)
 {
     UserProfileModel user = new UserProfileModel()
     {
         name = name,
         language = textLanguage,
         textLanguage = new LanguageStreamModel() { language = textLanguage, translationProvider = "Google" },
         audioLanguage = new LanguageStreamModel() { language = audioLanguage, translationProvider = "Google" },
     };
     Device.profile = _service.PostProfile(user, Device);
 }