public CustomVoiceModel updateCustomVoiceModel(CustomVoiceModel model)
        {
            CustomVoiceModelUpdate updateModel = new CustomVoiceModelUpdate()
            {
                Name        = model.Name,
                Description = model.Description,
                Words       = model.Words ?? new List <CustomWordTranslation>()
            };

            string s      = JsonConvert.SerializeObject(updateModel);
            var    result = RepositoryClient.WithAuthentication(ApiKeys.TextToSpeechUsername, ApiKeys.TextToSpeechPassword)
                            .PostAsync($"{ApiKeys.TextToSpeechEndpoint}{customizationsUrl}{model.Id}", updateModel)
                            .WithBody <CustomVoiceModelUpdate>(updateModel)
                            .AsMessage();

            return(model);
        }
Exemplo n.º 2
0
        public CustomVoiceModel updateCustomVoiceModel(CustomVoiceModel model)
        {
            string path = string.Format(PATH_CUSTOMIZATION, model.Id);

            CustomVoiceModelUpdate updateModel = new CustomVoiceModelUpdate()
            {
                Name        = model.Name,
                Description = model.Description,
                Words       = model.Words == null ? new List <CustomWordTranslation>() : model.Words
            };

            string s       = JsonConvert.SerializeObject(updateModel);
            var    retorno =
                Client.WithAuthentication(this.UserName, this.Password)
                .PostAsync(this.Endpoint + path, updateModel)
                .WithBody <CustomVoiceModelUpdate>(updateModel)
                .AsMessage();

            return(model);
        }