Skip to content

Commit

Permalink
ComputerVision SDK update
Browse files Browse the repository at this point in the history
Generated from [PR](Azure/azure-rest-api-specs#3145).
  • Loading branch information
cthrash committed May 29, 2018
1 parent b05009d commit 624268b
Show file tree
Hide file tree
Showing 19 changed files with 538 additions and 246 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public Category()
/// </summary>
/// <param name="name">Name of the category.</param>
/// <param name="score">Scoring of the category.</param>
/// <param name="detail">Additional category detail if
/// available.</param>
public Category(string name = default(string), double? score = default(double?), CategoryDetail detail = default(CategoryDetail))
{
Name = name;
Expand All @@ -59,7 +57,6 @@ public Category()
public double? Score { get; set; }

/// <summary>
/// Gets or sets additional category detail if available.
/// </summary>
[JsonProperty(PropertyName = "detail")]
public CategoryDetail Detail { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// 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.Azure.CognitiveServices.Vision.ComputerVision.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// List of celebrities recognized in the image.
/// </summary>
public partial class CelebrityResults
{
/// <summary>
/// Initializes a new instance of the CelebrityResults class.
/// </summary>
public CelebrityResults()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the CelebrityResults class.
/// </summary>
/// <param name="requestId">Id of the REST API request.</param>
public CelebrityResults(IList<CelebritiesModel> celebrities = default(IList<CelebritiesModel>), string requestId = default(string), ImageMetadata metadata = default(ImageMetadata))
{
Celebrities = celebrities;
RequestId = requestId;
Metadata = metadata;
CustomInit();
}

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

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "celebrities")]
public IList<CelebritiesModel> Celebrities { get; set; }

/// <summary>
/// Gets or sets id of the REST API request.
/// </summary>
[JsonProperty(PropertyName = "requestId")]
public string RequestId { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "metadata")]
public ImageMetadata Metadata { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@

namespace Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// Result of image analysis using a specific domain model including
/// additional metadata.
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class DomainModelResults
{
/// <summary>
Expand All @@ -35,13 +30,11 @@ public DomainModelResults()
/// <summary>
/// Initializes a new instance of the DomainModelResults class.
/// </summary>
/// <param name="celebrities">An array of possible celebritied
/// identified in the image.</param>
/// <param name="result">Model-specific response</param>
/// <param name="requestId">Id of the REST API request.</param>
/// <param name="metadata">Additional image metadata</param>
public DomainModelResults(IList<CelebritiesModel> celebrities = default(IList<CelebritiesModel>), string requestId = default(string), ImageMetadata metadata = default(ImageMetadata))
public DomainModelResults(object result = default(object), string requestId = default(string), ImageMetadata metadata = default(ImageMetadata))
{
Celebrities = celebrities;
Result = result;
RequestId = requestId;
Metadata = metadata;
CustomInit();
Expand All @@ -53,11 +46,10 @@ public DomainModelResults()
partial void CustomInit();

/// <summary>
/// Gets or sets an array of possible celebritied identified in the
/// image.
/// Gets or sets model-specific response
/// </summary>
[JsonProperty(PropertyName = "result.celebrities")]
public IList<CelebritiesModel> Celebrities { get; set; }
[JsonProperty(PropertyName = "result")]
public object Result { get; set; }

/// <summary>
/// Gets or sets id of the REST API request.
Expand All @@ -66,7 +58,6 @@ public DomainModelResults()
public string RequestId { get; set; }

/// <summary>
/// Gets or sets additional image metadata
/// </summary>
[JsonProperty(PropertyName = "metadata")]
public ImageMetadata Metadata { get; set; }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public FaceDescription()
/// <param name="age">Possible age of the face.</param>
/// <param name="gender">Possible gender of the face. Possible values
/// include: 'Male', 'Female'</param>
public FaceDescription(int? age = default(int?), string gender = default(string), FaceRectangle faceRectangle = default(FaceRectangle))
public FaceDescription(int? age = default(int?), Gender? gender = default(Gender?), FaceRectangle faceRectangle = default(FaceRectangle))
{
Age = age;
Gender = gender;
Expand All @@ -56,7 +56,7 @@ public FaceDescription()
/// 'Male', 'Female'
/// </summary>
[JsonProperty(PropertyName = "gender")]
public string Gender { get; set; }
public Gender? Gender { get; set; }

/// <summary>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,43 @@ namespace Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models
using System.Runtime.Serialization;

/// <summary>
/// Defines values for Language1.
/// Defines values for Gender.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum Language1
public enum Gender
{
[EnumMember(Value = "en")]
En,
[EnumMember(Value = "zh")]
Zh
[EnumMember(Value = "Male")]
Male,
[EnumMember(Value = "Female")]
Female
}
internal static class Language1EnumExtension
internal static class GenderEnumExtension
{
internal static string ToSerializedValue(this Language1? value)
internal static string ToSerializedValue(this Gender? value)
{
return value == null ? null : ((Language1)value).ToSerializedValue();
return value == null ? null : ((Gender)value).ToSerializedValue();
}

internal static string ToSerializedValue(this Language1 value)
internal static string ToSerializedValue(this Gender value)
{
switch( value )
{
case Language1.En:
return "en";
case Language1.Zh:
return "zh";
case Gender.Male:
return "Male";
case Gender.Female:
return "Female";
}
return null;
}

internal static Language1? ParseLanguage1(this string value)
internal static Gender? ParseGender(this string value)
{
switch( value )
{
case "en":
return Language1.En;
case "zh":
return Language1.Zh;
case "Male":
return Gender.Male;
case "Female":
return Gender.Female;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,11 @@ public ImageAnalysis()
/// </summary>
/// <param name="categories">An array indicating identified
/// categories.</param>
/// <param name="adult">A property scoring on whether the image is
/// adult-oriented and/or racy.</param>
/// <param name="color">A property scoring on color spectrums.</param>
/// <param name="imageType">A property indicating type of image
/// (whether it's clipart or line drawing)</param>
/// <param name="tags">A list of tags with confidence level.</param>
/// <param name="description">Description of the image.</param>
/// <param name="faces">An array of possible faces within the
/// image.</param>
/// <param name="requestId">Id of the request for tracking
/// purposes.</param>
/// <param name="metadata">Image metadata</param>
public ImageAnalysis(IList<Category> categories = default(IList<Category>), AdultInfo adult = default(AdultInfo), ColorInfo color = default(ColorInfo), ImageType imageType = default(ImageType), IList<ImageTag> tags = default(IList<ImageTag>), ImageDescriptionDetails description = default(ImageDescriptionDetails), IList<FaceDescription> faces = default(IList<FaceDescription>), string requestId = default(string), ImageMetadata metadata = default(ImageMetadata))
{
Categories = categories;
Expand All @@ -71,21 +64,16 @@ public ImageAnalysis()
public IList<Category> Categories { get; set; }

/// <summary>
/// Gets or sets a property scoring on whether the image is
/// adult-oriented and/or racy.
/// </summary>
[JsonProperty(PropertyName = "adult")]
public AdultInfo Adult { get; set; }

/// <summary>
/// Gets or sets a property scoring on color spectrums.
/// </summary>
[JsonProperty(PropertyName = "color")]
public ColorInfo Color { get; set; }

/// <summary>
/// Gets or sets a property indicating type of image (whether it's
/// clipart or line drawing)
/// </summary>
[JsonProperty(PropertyName = "imageType")]
public ImageType ImageType { get; set; }
Expand All @@ -97,7 +85,6 @@ public ImageAnalysis()
public IList<ImageTag> Tags { get; set; }

/// <summary>
/// Gets or sets description of the image.
/// </summary>
[JsonProperty(PropertyName = "description")]
public ImageDescriptionDetails Description { get; set; }
Expand All @@ -115,7 +102,6 @@ public ImageAnalysis()
public string RequestId { get; set; }

/// <summary>
/// Gets or sets image metadata
/// </summary>
[JsonProperty(PropertyName = "metadata")]
public ImageMetadata Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public ImageDescription()
/// <param name="captions">A list of captions, sorted by confidence
/// level.</param>
/// <param name="requestId">Id of the REST API request.</param>
/// <param name="metadata">Image metadata</param>
public ImageDescription(IList<string> tags = default(IList<string>), IList<ImageCaption> captions = default(IList<ImageCaption>), string requestId = default(string), ImageMetadata metadata = default(ImageMetadata))
{
Tags = tags;
Expand Down Expand Up @@ -73,7 +72,6 @@ public ImageDescription()
public string RequestId { get; set; }

/// <summary>
/// Gets or sets image metadata
/// </summary>
[JsonProperty(PropertyName = "description.metadata")]
public ImageMetadata Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public ImageDescriptionDetails()
/// <param name="captions">A list of captions, sorted by confidence
/// level.</param>
/// <param name="requestId">Id of the REST API request.</param>
/// <param name="metadata">Image metadata</param>
public ImageDescriptionDetails(IList<string> tags = default(IList<string>), IList<ImageCaption> captions = default(IList<ImageCaption>), string requestId = default(string), ImageMetadata metadata = default(ImageMetadata))
{
Tags = tags;
Expand Down Expand Up @@ -70,7 +69,6 @@ public ImageDescriptionDetails()
public string RequestId { get; set; }

/// <summary>
/// Gets or sets image metadata
/// </summary>
[JsonProperty(PropertyName = "metadata")]
public ImageMetadata Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public ImageUrl()
/// <summary>
/// Initializes a new instance of the ImageUrl class.
/// </summary>
/// <param name="url">Publicly reachable URL of an image</param>
public ImageUrl(string url)
{
Url = url;
Expand All @@ -39,6 +40,7 @@ public ImageUrl(string url)
partial void CustomInit();

/// <summary>
/// Gets or sets publicly reachable URL of an image
/// </summary>
[JsonProperty(PropertyName = "url")]
public string Url { get; set; }
Expand Down
Loading

0 comments on commit 624268b

Please sign in to comment.