Skip to content

Commit

Permalink
remove tts voice test create function (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeyuanh authored Jul 3, 2020
1 parent b55edf0 commit cda03b4
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class API_V3
private static string VoiceTests_Base => TextToSpeechBasePath_V3_beta1 + "tests";
public static string VoiceTests_GetByModelId => VoiceTests_Base + "/model/{0}";
public static string VoiceTests_GetByProjectId => VoiceTests_Base + "/project/{0}";
public static string VoiceTests_Create => VoiceTests_Base;
public static string VoiceTests_DeleteById => VoiceTests_Base + "/{0}";

//Voice Endpoints
Expand Down
24 changes: 0 additions & 24 deletions CustomVoice-API-Samples/CSharp/CustomVoice-API/API/VoiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,5 @@ public static bool DeleteById(string subscriptionKey, string hostURI, string voi

return true;
}

public static bool Create(string subscriptionKey, string hostURI, Guid projectId, Guid modelId, string script, bool isSSML)
{
string TextKind = "Text";
if (isSSML)
{
TextKind = "SSML";
}

var voiceTestDefinition = VoiceTestDefinition.Create(
new Identity(modelId),
script,
TextKind,
new Identity(projectId));

var response = APIHelper.Submit<VoiceTestDefinition>(subscriptionKey, hostURI + API_V3.VoiceTests_Create, voiceTestDefinition);

if (response.StatusCode != HttpStatusCode.Accepted)
{
APIHelper.PrintErrorMessage(response);
return false;
}
return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,6 @@ public static Dictionary<string, List<string>> GetParameters(APIKind apiKind, Ac
OptionalParameters = new List<string>() { ProjectId, Description };
break;
}
case nameof(APIKind.voicetest) + "-" + nameof(Action.create):
{
RequiredParameters = new List<string>() { SubscriptionKey, HostUri, ProjectId, ModelId, "script" };
OptionalParameters = new List<string>() { "isSSML" };
break;
}
case nameof(APIKind.voicetest) + "-" + nameof(Action.get):
{
RequiredParameters = new List<string>() { SubscriptionKey, HostUri, ModelId };
Expand Down
29 changes: 1 addition & 28 deletions CustomVoice-API-Samples/CSharp/CustomVoice-API/APIHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ private static void ExecuteVoiceTestApi(Action action, Dictionary<string, string
break;
case Action.delete:
VoiceTestDeleteById(arguments);
break;
case Action.create:
VoiceTestCreate(arguments);
break;
break;
default:
break;
}
Expand Down Expand Up @@ -531,30 +528,6 @@ private static void VoiceTestDeleteById(Dictionary<string, string> arguments)
}
}

private static void VoiceTestCreate(Dictionary<string, string> arguments)
{
string subscriptionKey = arguments["subscriptionkey"];
string hostURI = arguments["hosturi"];
string projectId = arguments["projectid"];
string modelId = arguments["modelid"];
string script = arguments["script"];
bool isSSML = false;

if (arguments.Keys.ToList().Contains("isssml"))
{
isSSML = Convert.ToBoolean(arguments["isssml"]);
}

if (VoiceTest.Create(subscriptionKey, hostURI, new Guid(projectId), new Guid(modelId), script, isSSML))
{
Console.WriteLine("Create voice test successfully");
}
else
{
Console.WriteLine("Create voice test failed");
}
}

private static void EndpointGet(Dictionary<string, string> arguments)
{
string subscriptionKey = arguments["subscriptionkey"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ public static void PrintAPIKindUsage(APIKind apiKind)
Console.WriteLine(" Get");
Console.WriteLine(" Gets details of the specified model's voice test.");
Console.WriteLine(" GetByProjectId");
Console.WriteLine(" Get the list of voice tests for specified project.");
Console.WriteLine(" Create");
Console.WriteLine(" Creates a new voice test.");
Console.WriteLine(" Get the list of voice tests for specified project.");
Console.WriteLine(" Delete");
Console.WriteLine(" Deletes the specified voice test.");
Console.WriteLine("");
Expand Down Expand Up @@ -334,12 +332,6 @@ public static void PrintVoiceTestActionUsage(Action action, Dictionary<string, L
sampleCommand = $"CustomVoice-API voicetest getbyprojectid subscriptionKey [YourSubscriptionKey] hostURI {hostUri} projectId [ProjectId]";
PrintActionUsageBase(actionString, description, sampleCommand, parameters);
break;
case Action.create:
actionString = "voicetest create";
description = "Creates a new voice test.";
sampleCommand = $"CustomVoice-API voicetest create subscriptionKey [YourSubscriptionKey] hostURI {hostUri} projectId [ProjectId] modelId [ModelId] script 12345 isSSML false";
PrintActionUsageBase(actionString, description, sampleCommand, parameters);
break;
case Action.delete:
actionString = "voicetest delete";
description = "Deletes the specified voice test.";
Expand Down

0 comments on commit cda03b4

Please sign in to comment.