diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Helpers/Constants.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Helpers/Constants.cs index 3535dc04dc40..20f46a2adb67 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Helpers/Constants.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Helpers/Constants.cs @@ -895,7 +895,7 @@ public static Body GetListBody(Content c) /// /// /// - public static Responses GetTextResponse(ContentModeratorClient client, ContentModeratorAPI api, string listid, Stream textContent, string contentType = "text/plain", string language = "eng",bool? isAutoCorrect = false, bool? isPii = false, bool? isClassify = false) + public static Responses GetTextResponse(ContentModeratorClient client, ContentModeratorAPI api, string listid, Stream textContent, string contentType = "text/plain", string language = default(string),bool? isAutoCorrect = false, bool? isPii = false, bool? isClassify = false) { Responses r = new Responses(); Utilities u = new Utilities(); @@ -909,7 +909,7 @@ public static Responses GetTextResponse(ContentModeratorClient client, ContentMo switch (api) { case ContentModeratorAPI.SCREEN_TEXT: - var tempST = client.TextModeration.ScreenTextWithHttpMessagesAsync(language,contentType, textContent,isAutoCorrect,isPii,listid,isClassify); + var tempST = client.TextModeration.ScreenTextWithHttpMessagesAsync(contentType,textContent,language,isAutoCorrect,isPii,listid,isClassify); u.WaitUntilCompleted(tempST); if (tempST.Exception != null) { diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Properties/AssemblyInfo.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Properties/AssemblyInfo.cs index 10cb351ce06e..8180d19109b3 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Properties/AssemblyInfo.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.11.0.0")] -[assembly: AssemblyFileVersion("0.11.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/SessionRecords/TextModerator/ScreenText.json b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/SessionRecords/TextModerator/ScreenText.json index 743544c66fe0..8e1c39fbdfc9 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/SessionRecords/TextModerator/ScreenText.json +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/SessionRecords/TextModerator/ScreenText.json @@ -1,10 +1,10 @@ { "Entries": [ { - "RequestUri": "/contentmoderator/moderate/v1.0/ProcessText/Screen/?language=eng&autocorrect=false&PII=false&listId=&classify=false", - "EncodedRequestUri": "L2NvbnRlbnRtb2RlcmF0b3IvbW9kZXJhdGUvdjEuMC9Qcm9jZXNzVGV4dC9TY3JlZW4vP2xhbmd1YWdlPWVuZyZhdXRvY29ycmVjdD1mYWxzZSZQSUk9ZmFsc2UmbGlzdElkPSZjbGFzc2lmeT1mYWxzZQ==", + "RequestUri": "/contentmoderator/moderate/v1.0/ProcessText/Screen/?autocorrect=false&PII=false&listId=&classify=false", + "EncodedRequestUri": "L2NvbnRlbnRtb2RlcmF0b3IvbW9kZXJhdGUvdjEuMC9Qcm9jZXNzVGV4dC9TY3JlZW4vP2F1dG9jb3JyZWN0PWZhbHNlJlBJST1mYWxzZSZsaXN0SWQ9JmNsYXNzaWZ5PWZhbHNl", "RequestMethod": "POST", - "RequestBody": "crap 764-87-9887", + "RequestBody": "crap 764-879-887", "RequestHeaders": { "Content-Type": [ "text/plain" @@ -22,7 +22,7 @@ "Microsoft.CognitiveServices.ContentModerator.ContentModeratorClient/0.0.0.0" ] }, - "ResponseBody": "{\r\n \"OriginalText\": \"crap 764-87-9887\",\r\n \"NormalizedText\": \"crap 764- 87- 9887\",\r\n \"Misrepresentation\": null,\r\n \"Language\": \"eng\",\r\n \"Terms\": [\r\n {\r\n \"Index\": 0,\r\n \"OriginalIndex\": 0,\r\n \"ListId\": 0,\r\n \"Term\": \"crap\"\r\n }\r\n ],\r\n \"Status\": {\r\n \"Code\": 3000,\r\n \"Description\": \"OK\",\r\n \"Exception\": null\r\n },\r\n \"TrackingId\": \"fdf029a7-fba5-434e-a9b7-0d1d4a8841ca\"\r\n}", + "ResponseBody": "{\r\n \"OriginalText\": \"crap 764-879-887\",\r\n \"NormalizedText\": \"crap 764- 879- 887\",\r\n \"Misrepresentation\": null,\r\n \"Language\": \"eng\",\r\n \"Terms\": [\r\n {\r\n \"Index\": 0,\r\n \"OriginalIndex\": 0,\r\n \"ListId\": 0,\r\n \"Term\": \"crap\"\r\n }\r\n ],\r\n \"Status\": {\r\n \"Code\": 3000,\r\n \"Description\": \"OK\",\r\n \"Exception\": null\r\n },\r\n \"TrackingId\": \"4b411c02-c882-443b-be08-7a736535d0be\"\r\n}", "ResponseHeaders": { "Content-Length": [ "291" @@ -37,7 +37,7 @@ "no-cache" ], "apim-request-id": [ - "8e04a65e-c7ec-4818-82e9-263a40275886" + "16a5bce3-1817-440b-a503-5b4b90ac601d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -49,7 +49,7 @@ "no-cache" ], "Date": [ - "Fri, 06 Apr 2018 18:33:51 GMT" + "Mon, 16 Apr 2018 20:15:26 GMT" ], "X-AspNet-Version": [ "4.0.30319" diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/TextModerator.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/TextModerator.cs index 63a7f82c1fe6..664a16fd36c3 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/TextModerator.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator.Tests/TextModerator.cs @@ -95,12 +95,11 @@ public void ScreenText() using (MockContext context = MockContext.Start("TextModerator")) { HttpMockServer.Initialize("TextModerator", "ScreenText"); - TermListId = ""; byte[] byteArray = Encoding.UTF8.GetBytes("crap 764-87-9887"); MemoryStream stream = new MemoryStream(byteArray); api = ContentModeratorAPI.SCREEN_TEXT; client = Constants.GenerateClient(api, HttpMockServer.CreateInstance()); - results = Constants.GetTextResponse(client, api, TermListId, stream); + results = Constants.GetTextResponse(client, api, "", stream); var screenText = results.ScreenText; Assert.NotNull(screenText); Assert.Equal(HttpStatusCode.OK, screenText.Response.StatusCode); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/ITextModeration.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/ITextModeration.cs index 01f339b2f45b..eeb74e46a4a6 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/ITextModeration.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/ITextModeration.cs @@ -26,9 +26,6 @@ public partial interface ITextModeration /// Detects profanity in more than 100 languages and match against /// custom and shared blacklists. /// - /// - /// Language of the terms. - /// /// /// The content type. Possible values include: 'text/plain', /// 'text/html', 'text/xml', 'text/markdown' @@ -36,6 +33,9 @@ public partial interface ITextModeration /// /// Content to screen. /// + /// + /// Language of the text. + /// /// /// Autocorrect text. /// @@ -63,7 +63,7 @@ public partial interface ITextModeration /// /// Thrown when a required parameter is null /// - Task> ScreenTextWithHttpMessagesAsync(string language, string textContentType, Stream textContent, bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ScreenTextWithHttpMessagesAsync(string textContentType, Stream textContent, string language = default(string), bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// This operation will detect the language of given input content. /// Returns the <a diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModeration.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModeration.cs index 8a2717145611..d0bffb551a12 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModeration.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModeration.cs @@ -53,9 +53,6 @@ public TextModeration(ContentModeratorClient client) /// Detects profanity in more than 100 languages and match against custom and /// shared blacklists. /// - /// - /// Language of the terms. - /// /// /// The content type. Possible values include: 'text/plain', 'text/html', /// 'text/xml', 'text/markdown' @@ -63,6 +60,9 @@ public TextModeration(ContentModeratorClient client) /// /// Content to screen. /// + /// + /// Language of the text. + /// /// /// Autocorrect text. /// @@ -96,16 +96,12 @@ public TextModeration(ContentModeratorClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ScreenTextWithHttpMessagesAsync(string language, string textContentType, Stream textContent, bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ScreenTextWithHttpMessagesAsync(string textContentType, Stream textContent, string language = default(string), bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.BaseUrl == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.BaseUrl"); } - if (language == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "language"); - } if (textContentType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "textContentType"); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModerationExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModerationExtensions.cs index 01488035fef8..070a06422511 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModerationExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Generated/TextModerationExtensions.cs @@ -26,9 +26,6 @@ public static partial class TextModerationExtensions /// /// The operations group for this extension method. /// - /// - /// Language of the terms. - /// /// /// The content type. Possible values include: 'text/plain', 'text/html', /// 'text/xml', 'text/markdown' @@ -36,6 +33,9 @@ public static partial class TextModerationExtensions /// /// Content to screen. /// + /// + /// Language of the text. + /// /// /// Autocorrect text. /// @@ -48,9 +48,9 @@ public static partial class TextModerationExtensions /// /// Classify input. /// - public static Screen ScreenText(this ITextModeration operations, string language, string textContentType, Stream textContent, bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false) + public static Screen ScreenText(this ITextModeration operations, string textContentType, Stream textContent, string language = default(string), bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false) { - return operations.ScreenTextAsync(language, textContentType, textContent, autocorrect, pII, listId, classify).GetAwaiter().GetResult(); + return operations.ScreenTextAsync(textContentType, textContent, language, autocorrect, pII, listId, classify).GetAwaiter().GetResult(); } /// @@ -63,9 +63,6 @@ public static partial class TextModerationExtensions /// /// The operations group for this extension method. /// - /// - /// Language of the terms. - /// /// /// The content type. Possible values include: 'text/plain', 'text/html', /// 'text/xml', 'text/markdown' @@ -73,6 +70,9 @@ public static partial class TextModerationExtensions /// /// Content to screen. /// + /// + /// Language of the text. + /// /// /// Autocorrect text. /// @@ -88,9 +88,9 @@ public static partial class TextModerationExtensions /// /// The cancellation token. /// - public static async Task ScreenTextAsync(this ITextModeration operations, string language, string textContentType, Stream textContent, bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ScreenTextAsync(this ITextModeration operations, string textContentType, Stream textContent, string language = default(string), bool? autocorrect = false, bool? pII = false, string listId = default(string), bool? classify = false, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ScreenTextWithHttpMessagesAsync(language, textContentType, textContent, autocorrect, pII, listId, classify, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ScreenTextWithHttpMessagesAsync(textContentType, textContent, language, autocorrect, pII, listId, classify, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Microsoft.Azure.CognitiveServices.ContentModerator.csproj b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Microsoft.Azure.CognitiveServices.ContentModerator.csproj index 9c601ca1401b..8da30ac00bd5 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Microsoft.Azure.CognitiveServices.ContentModerator.csproj +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/Microsoft.Azure.CognitiveServices.ContentModerator.csproj @@ -5,7 +5,7 @@ Microsoft.Azure.CognitiveServices.ContentModerator This client library provides access to the Microsoft Cognitive Services Content Moderator APIs. - 0.11.0-preview + 0.12.0-preview Microsoft.Azure.CognitiveServices.ContentModerator ContentModerator;Content Moderator; This is a preview release of the Cognitive Services Content Moderator SDK. diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/generate.ps1 b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/generate.ps1 new file mode 100644 index 000000000000..63838e37e196 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/ContentModerator/ContentModerator/generate.ps1 @@ -0,0 +1,4 @@ +<# + This is a template to describe how to call the generateTool.ps1 script to generate the code using AutoRest +#> +powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File "$(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)\..\..\..\..\..\..\..\tools\generateTool.ps1" -ResourceProvider "cognitiveservices/data-plane/ContentModerator" -PowershellInvoker \ No newline at end of file diff --git a/src/SDKs/_metadata/cognitiveservices_data-plane_ContentModerator.txt b/src/SDKs/_metadata/cognitiveservices_data-plane_ContentModerator.txt index 9c87ead944d3..63d02580ed56 100644 --- a/src/SDKs/_metadata/cognitiveservices_data-plane_ContentModerator.txt +++ b/src/SDKs/_metadata/cognitiveservices_data-plane_ContentModerator.txt @@ -1,11 +1,17 @@ -2018-04-06 18:09:46 UTC - +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/ContentModerator/readme.md --csharp --csharp-sdks-folder=C:\LatestSdk\tools\..\src\SDKs\ --version=latest --reflect-api-versions +2018-04-17 23:04:14 UTC 1) azure-rest-api-specs repository information -GitHub user: Azure +GitHub fork: Azure Branch: master -Commit: 55711dc50d55d1a04cf8af2a61da7ab50c7e9f1c +Commit: 9666a766d478b21b587210260fb7de342ae9980e 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\v-sodsou\AppData\Roaming\npm `-- autorest@2.0.4262 +Bootstrapper version: C:\Users\v-sodsou\AppData\Roaming\npm `-- autorest@2.0.4262 + + Latest installed version: +.\tools\generate.ps1 was invoked by generate.ps1 + +