Skip to content

Commit

Permalink
Content moderator update (#4082)
Browse files Browse the repository at this point in the history
* Content moderator update

* modified screen text api

* Updated the version
  • Loading branch information
v-sodsou authored and shahabhijeet committed Feb 20, 2018
1 parent 9212a31 commit c95b3ed
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ public static bool VerifyScreenText(Screen s,bool isAutoCorrect = false, bool is
error = " Classification is null";
else
{
if (s.Classification.AdultScore == null)
error += " Classification.Adult Score is null";
if (s.Classification.RacyScore == null)
error += " Classification.Racy Score is null";
if (s.Classification.OffensiveScore== null)
error += " Classification.OffensiveScore is null";
if (s.Classification.Category1 == null)
error += " Classification.Category1 Score is null";
if (s.Classification.Category2 == null)
error += " Classification.Category2 Score is null";
if (s.Classification.Category3== null)
error += " Classification.Category3 Score is null";
if (s.Classification.ReviewRecommended == null)
error += " Classification.ReviewRecommended is null";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]
[assembly: AssemblyVersion("0.10.0.0")]
[assembly: AssemblyFileVersion("0.10.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,8 @@ public ImageModeration(ContentModeratorClient client)
}
if (imageStream != null && imageStream != Stream.Null)
{
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
}
// Set Credentials
if (Client.Credentials != null)
Expand Down Expand Up @@ -1401,8 +1401,8 @@ public ImageModeration(ContentModeratorClient client)
}
if (imageStream != null && imageStream != Stream.Null)
{
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
}
// Set Credentials
if (Client.Credentials != null)
Expand Down Expand Up @@ -1576,8 +1576,8 @@ public ImageModeration(ContentModeratorClient client)
}
if (imageStream != null && imageStream != Stream.Null)
{
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
}
// Set Credentials
if (Client.Credentials != null)
Expand Down Expand Up @@ -2143,8 +2143,8 @@ public ImageModeration(ContentModeratorClient client)
}
if (imageStream != null && imageStream != Stream.Null)
{
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
}
// Set Credentials
if (Client.Credentials != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,8 @@ public ListManagementImage(ContentModeratorClient client)
}
if (imageStream != null && imageStream != Stream.Null)
{
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
_httpRequest.Content = new StreamContent(imageStream);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("image/gif");
}
// Set Credentials
if (Client.Credentials != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,22 @@ public Classification()
/// <summary>
/// Initializes a new instance of the Classification class.
/// </summary>
/// <param name="adultScore">The adult score.</param>
/// <param name="racyScore">The racy score.</param>
/// <param name="offensiveScore">The offensive score.</param>
/// <param name="category1">The category1 score details of the text.
/// &lt;a href="https://aka.ms/textClassifyCategories"&gt;Click
/// here&lt;/a&gt; for more details on category classification.</param>
/// <param name="category2">The category2 score details of the text.
/// &lt;a href="https://aka.ms/textClassifyCategories"&gt;Click
/// here&lt;/a&gt; for more details on category classification.</param>
/// <param name="category3">The category3 score details of the text.
/// &lt;a href="https://aka.ms/textClassifyCategories"&gt;Click
/// here&lt;/a&gt; for more details on category classification.</param>
/// <param name="reviewRecommended">The review recommended
/// flag.</param>
public Classification(double? adultScore = default(double?), double? racyScore = default(double?), double? offensiveScore = default(double?), bool? reviewRecommended = default(bool?))
public Classification(ClassificationCategory1 category1 = default(ClassificationCategory1), ClassificationCategory2 category2 = default(ClassificationCategory2), ClassificationCategory3 category3 = default(ClassificationCategory3), bool? reviewRecommended = default(bool?))
{
AdultScore = adultScore;
RacyScore = racyScore;
OffensiveScore = offensiveScore;
Category1 = category1;
Category2 = category2;
Category3 = category3;
ReviewRecommended = reviewRecommended;
CustomInit();
}
Expand All @@ -45,22 +51,28 @@ public Classification()
partial void CustomInit();

/// <summary>
/// Gets or sets the adult score.
/// Gets or sets the category1 score details of the text. &amp;lt;a
/// href="https://aka.ms/textClassifyCategories"&amp;gt;Click
/// here&amp;lt;/a&amp;gt; for more details on category classification.
/// </summary>
[JsonProperty(PropertyName = "AdultScore")]
public double? AdultScore { get; set; }
[JsonProperty(PropertyName = "Category1")]
public ClassificationCategory1 Category1 { get; set; }

/// <summary>
/// Gets or sets the racy score.
/// Gets or sets the category2 score details of the text. &amp;lt;a
/// href="https://aka.ms/textClassifyCategories"&amp;gt;Click
/// here&amp;lt;/a&amp;gt; for more details on category classification.
/// </summary>
[JsonProperty(PropertyName = "RacyScore")]
public double? RacyScore { get; set; }
[JsonProperty(PropertyName = "Category2")]
public ClassificationCategory2 Category2 { get; set; }

/// <summary>
/// Gets or sets the offensive score.
/// Gets or sets the category3 score details of the text. &amp;lt;a
/// href="https://aka.ms/textClassifyCategories"&amp;gt;Click
/// here&amp;lt;/a&amp;gt; for more details on category classification.
/// </summary>
[JsonProperty(PropertyName = "OffensiveScore")]
public double? OffensiveScore { get; set; }
[JsonProperty(PropertyName = "Category3")]
public ClassificationCategory3 Category3 { get; set; }

/// <summary>
/// Gets or sets the review recommended flag.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.CognitiveServices.ContentModerator.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// The category1 score details of the text. &lt;a
/// href="https://aka.ms/textClassifyCategories"&gt;Click here&lt;/a&gt;
/// for more details on category classification.
/// </summary>
public partial class ClassificationCategory1
{
/// <summary>
/// Initializes a new instance of the ClassificationCategory1 class.
/// </summary>
public ClassificationCategory1()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ClassificationCategory1 class.
/// </summary>
/// <param name="score">The category1 score.</param>
public ClassificationCategory1(double? score = default(double?))
{
Score = score;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets the category1 score.
/// </summary>
[JsonProperty(PropertyName = "Score")]
public double? Score { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.CognitiveServices.ContentModerator.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// The category2 score details of the text. &lt;a
/// href="https://aka.ms/textClassifyCategories"&gt;Click here&lt;/a&gt;
/// for more details on category classification.
/// </summary>
public partial class ClassificationCategory2
{
/// <summary>
/// Initializes a new instance of the ClassificationCategory2 class.
/// </summary>
public ClassificationCategory2()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ClassificationCategory2 class.
/// </summary>
/// <param name="score">The category2 score.</param>
public ClassificationCategory2(double? score = default(double?))
{
Score = score;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets the category2 score.
/// </summary>
[JsonProperty(PropertyName = "Score")]
public double? Score { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.CognitiveServices.ContentModerator.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// The category3 score details of the text. &lt;a
/// href="https://aka.ms/textClassifyCategories"&gt;Click here&lt;/a&gt;
/// for more details on category classification.
/// </summary>
public partial class ClassificationCategory3
{
/// <summary>
/// Initializes a new instance of the ClassificationCategory3 class.
/// </summary>
public ClassificationCategory3()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ClassificationCategory3 class.
/// </summary>
/// <param name="score">The category3 score.</param>
public ClassificationCategory3(double? score = default(double?))
{
Score = score;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets the category3 score.
/// </summary>
[JsonProperty(PropertyName = "Score")]
public double? Score { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1691,8 +1691,8 @@ public Reviews(ContentModeratorClient client)
}
if (vTTfile != null && vTTfile != Stream.Null)
{
_httpRequest.Content = new StreamContent(vTTfile);
_httpRequest.Content.Headers.ContentType =MediaTypeHeaderValue.Parse("text/plain");
_httpRequest.Content = new StreamContent(vTTfile);
_httpRequest.Content.Headers.ContentType =MediaTypeHeaderValue.Parse("text/plain");
}
// Set Credentials
if (Client.Credentials != null)
Expand Down Expand Up @@ -2292,7 +2292,7 @@ public Reviews(ContentModeratorClient client)
MultipartFormDataContent _multiPartContent = new MultipartFormDataContent();
if (frameImageZip != null)
{
StreamContent _frameImageZip = new StreamContent(frameImageZip);
StreamContent _frameImageZip = new StreamContent(frameImageZip);
_frameImageZip.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
FileStream _frameImageZipAsFileStream = frameImageZip as FileStream;
if (_frameImageZipAsFileStream != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<PackageId>Microsoft.Azure.CognitiveServices.ContentModerator</PackageId>
<Description>This client library provides access to the Microsoft Cognitive Services Content Moderator APIs.</Description>
<Version>0.9.0-preview</Version>
<Version>0.10.0-preview</Version>
<AssemblyName>Microsoft.Azure.CognitiveServices.ContentModerator</AssemblyName>
<PackageTags>ContentModerator;Content Moderator;</PackageTags>
<PackageReleaseNotes>This is a preview release of the Cognitive Services Content Moderator SDK.</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
::

@echo off
call %~dp0..\..\..\..\..\..\tools\generate.cmd cognitiveservices/data-plane/ContentModerator %*
call %~dp0..\..\..\..\..\..\..\tools\generate.cmd cognitiveservices/data-plane/ContentModerator %*
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
2017-12-08 20:25:38 UTC
2018-02-16 21:45:48 UTC

1) azure-rest-api-specs repository information
GitHub user: Azure
Branch: current
Commit: 58b5052b90deb9f280725ca7811896fb98d2c63c
Branch: master
Commit: b1bd5185dc7575232b0c4bc14eff76b877dd3d7b

2) AutoRest information
Requested version: latest
Bootstrapper version: C:\Users\v-sodsou\AppData\Roaming\npm `-- [email protected]
Latest installed version:
Bootstrapper version: C:\Users\v-sodsou\AppData\Roaming\npm `-- [email protected]

0 comments on commit c95b3ed

Please sign in to comment.