diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceClient.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceClient.cs index ca42af3bd53a..6b143ded2bb9 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceClient.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceClient.cs @@ -85,6 +85,19 @@ public partial class FaceClient : ServiceClient, IFaceClient /// public virtual ILargeFaceListOperations LargeFaceList { get; private set; } + /// + /// Initializes a new instance of the FaceClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling FaceClient.Dispose(). False: will not dispose provided httpClient + protected FaceClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the FaceClient class. /// @@ -135,6 +148,33 @@ public FaceClient(ServiceClientCredentials credentials, params DelegatingHandler } } + /// + /// Initializes a new instance of the FaceClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling FaceClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public FaceClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + /// /// Initializes a new instance of the FaceClient class. /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperations.cs index 19040fc0afe5..bfe39d8f5987 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperations.cs @@ -63,6 +63,8 @@ public FaceListOperations(FaceClient client) /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// Headers that will be added to request. /// @@ -81,7 +83,7 @@ public FaceListOperations(FaceClient client) /// /// A response object containing the response body and response headers. /// - public async Task CreateWithHttpMessagesAsync(string faceListId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task CreateWithHttpMessagesAsync(string faceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -116,11 +118,12 @@ public FaceListOperations(FaceClient client) throw new ValidationException(ValidationRules.MaxLength, "userData", 16384); } } - NameAndUserDataContract body = new NameAndUserDataContract(); - if (name != null || userData != null) + MetaDataContract body = new MetaDataContract(); + if (name != null || userData != null || recognitionModel != null) { body.Name = name; body.UserData = userData; + body.RecognitionModel = recognitionModel; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperationsExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperationsExtensions.cs index 903936b3faed..375a94566605 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperationsExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceListOperationsExtensions.cs @@ -38,12 +38,14 @@ public static partial class FaceListOperationsExtensions /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IFaceListOperations operations, string faceListId, string name = default(string), string userData = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IFaceListOperations operations, string faceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateWithHttpMessagesAsync(faceListId, name, userData, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.CreateWithHttpMessagesAsync(faceListId, name, userData, recognitionModel, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperations.cs index deadae9b7861..2a9ea6f20a0b 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperations.cs @@ -858,6 +858,9 @@ public FaceOperations(FaceClient client) /// and emotion. Note that each face attribute analysis has additional /// computational and time cost. /// + /// + /// Recognition model name, maximum length is 128. + /// /// /// Headers that will be added to request. /// @@ -879,12 +882,19 @@ public FaceOperations(FaceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> DetectWithUrlWithHttpMessagesAsync(string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> DetectWithUrlWithHttpMessagesAsync(string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Endpoint"); } + if (recognitionModel != null) + { + if (recognitionModel.Length > 128) + { + throw new ValidationException(ValidationRules.MaxLength, "recognitionModel", 128); + } + } if (url == null) { throw new ValidationException(ValidationRules.CannotBeNull, "url"); @@ -904,6 +914,7 @@ public FaceOperations(FaceClient client) tracingParameters.Add("returnFaceId", returnFaceId); tracingParameters.Add("returnFaceLandmarks", returnFaceLandmarks); tracingParameters.Add("returnFaceAttributes", returnFaceAttributes); + tracingParameters.Add("recognitionModel", recognitionModel); tracingParameters.Add("imageUrl", imageUrl); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DetectWithUrl", tracingParameters); @@ -925,6 +936,10 @@ public FaceOperations(FaceClient client) { _queryParameters.Add(string.Format("returnFaceAttributes={0}", System.Uri.EscapeDataString(string.Join(",", returnFaceAttributes)))); } + if (recognitionModel != null) + { + _queryParameters.Add(string.Format("RecognitionModel={0}", System.Uri.EscapeDataString(recognitionModel))); + } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); @@ -1259,6 +1274,9 @@ public FaceOperations(FaceClient client) /// and emotion. Note that each face attribute analysis has additional /// computational and time cost. /// + /// + /// Recognition model name, maximum length is 128. + /// /// /// Headers that will be added to request. /// @@ -1280,7 +1298,7 @@ public FaceOperations(FaceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> DetectWithStreamWithHttpMessagesAsync(Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> DetectWithStreamWithHttpMessagesAsync(Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -1290,6 +1308,13 @@ public FaceOperations(FaceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "image"); } + if (recognitionModel != null) + { + if (recognitionModel.Length > 128) + { + throw new ValidationException(ValidationRules.MaxLength, "recognitionModel", 128); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1301,6 +1326,7 @@ public FaceOperations(FaceClient client) tracingParameters.Add("returnFaceLandmarks", returnFaceLandmarks); tracingParameters.Add("returnFaceAttributes", returnFaceAttributes); tracingParameters.Add("image", image); + tracingParameters.Add("recognitionModel", recognitionModel); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DetectWithStream", tracingParameters); } @@ -1321,6 +1347,10 @@ public FaceOperations(FaceClient client) { _queryParameters.Add(string.Format("returnFaceAttributes={0}", System.Uri.EscapeDataString(string.Join(",", returnFaceAttributes)))); } + if (recognitionModel != null) + { + _queryParameters.Add(string.Format("RecognitionModel={0}", System.Uri.EscapeDataString(recognitionModel))); + } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperationsExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperationsExtensions.cs index 5a18f84990da..241722a6586e 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperationsExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceOperationsExtensions.cs @@ -181,12 +181,15 @@ public static partial class FaceOperationsExtensions /// and emotion. Note that each face attribute analysis has additional /// computational and time cost. /// + /// + /// Recognition model name, maximum length is 128. + /// /// /// The cancellation token. /// - public static async Task> DetectWithUrlAsync(this IFaceOperations operations, string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> DetectWithUrlAsync(this IFaceOperations operations, string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), string recognitionModel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DetectWithUrlWithHttpMessagesAsync(url, returnFaceId, returnFaceLandmarks, returnFaceAttributes, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DetectWithUrlWithHttpMessagesAsync(url, returnFaceId, returnFaceLandmarks, returnFaceAttributes, recognitionModel, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -255,12 +258,15 @@ public static partial class FaceOperationsExtensions /// and emotion. Note that each face attribute analysis has additional /// computational and time cost. /// + /// + /// Recognition model name, maximum length is 128. + /// /// /// The cancellation token. /// - public static async Task> DetectWithStreamAsync(this IFaceOperations operations, Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> DetectWithStreamAsync(this IFaceOperations operations, Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), string recognitionModel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DetectWithStreamWithHttpMessagesAsync(image, returnFaceId, returnFaceLandmarks, returnFaceAttributes, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DetectWithStreamWithHttpMessagesAsync(image, returnFaceId, returnFaceLandmarks, returnFaceAttributes, recognitionModel, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceListOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceListOperations.cs index 1ed9a3f60022..2704c66df48c 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceListOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceListOperations.cs @@ -36,6 +36,8 @@ public partial interface IFaceListOperations /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The headers that will be added to request. /// @@ -48,7 +50,7 @@ public partial interface IFaceListOperations /// /// Thrown when a required parameter is null /// - Task CreateWithHttpMessagesAsync(string faceListId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task CreateWithHttpMessagesAsync(string faceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a face list's information. /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceOperations.cs index 23a7f84c98b1..028dd9e5d534 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IFaceOperations.cs @@ -193,6 +193,9 @@ public partial interface IFaceOperations /// facialHair, glasses and emotion. Note that each face attribute /// analysis has additional computational and time cost. /// + /// + /// Recognition model name, maximum length is 128. + /// /// /// The headers that will be added to request. /// @@ -208,7 +211,7 @@ public partial interface IFaceOperations /// /// Thrown when a required parameter is null /// - Task>> DetectWithUrlWithHttpMessagesAsync(string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> DetectWithUrlWithHttpMessagesAsync(string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Verify whether two faces belong to a same person. Compares a face /// Id with a Person Id @@ -271,6 +274,9 @@ public partial interface IFaceOperations /// facialHair, glasses and emotion. Note that each face attribute /// analysis has additional computational and time cost. /// + /// + /// Recognition model name, maximum length is 128. + /// /// /// The headers that will be added to request. /// @@ -286,6 +292,6 @@ public partial interface IFaceOperations /// /// Thrown when a required parameter is null /// - Task>> DetectWithStreamWithHttpMessagesAsync(Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> DetectWithStreamWithHttpMessagesAsync(Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList returnFaceAttributes = default(IList), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargeFaceListOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargeFaceListOperations.cs index 50237ea1d3a3..43a87fcb8b95 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargeFaceListOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargeFaceListOperations.cs @@ -36,6 +36,8 @@ public partial interface ILargeFaceListOperations /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The headers that will be added to request. /// @@ -48,7 +50,7 @@ public partial interface ILargeFaceListOperations /// /// Thrown when a required parameter is null /// - Task CreateWithHttpMessagesAsync(string largeFaceListId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task CreateWithHttpMessagesAsync(string largeFaceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a large face list's information. /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargePersonGroupOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargePersonGroupOperations.cs index 1dc0e72f7309..787eb37b7326 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargePersonGroupOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/ILargePersonGroupOperations.cs @@ -35,6 +35,8 @@ public partial interface ILargePersonGroupOperations /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The headers that will be added to request. /// @@ -47,7 +49,7 @@ public partial interface ILargePersonGroupOperations /// /// Thrown when a required parameter is null /// - Task CreateWithHttpMessagesAsync(string largePersonGroupId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task CreateWithHttpMessagesAsync(string largePersonGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete an existing large person group. Persisted face features of /// all people in the large person group will also be deleted. diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IPersonGroupOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IPersonGroupOperations.cs index 0fef02f6a473..86e2921a3e7b 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IPersonGroupOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/IPersonGroupOperations.cs @@ -35,6 +35,8 @@ public partial interface IPersonGroupOperations /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The headers that will be added to request. /// @@ -47,7 +49,7 @@ public partial interface IPersonGroupOperations /// /// Thrown when a required parameter is null /// - Task CreateWithHttpMessagesAsync(string personGroupId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task CreateWithHttpMessagesAsync(string personGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete an existing person group. Persisted face features of all /// people in the person group will also be deleted. diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperations.cs index 239606d35cc0..6168cdb0f11c 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperations.cs @@ -63,6 +63,8 @@ public LargeFaceListOperations(FaceClient client) /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// Headers that will be added to request. /// @@ -81,7 +83,7 @@ public LargeFaceListOperations(FaceClient client) /// /// A response object containing the response body and response headers. /// - public async Task CreateWithHttpMessagesAsync(string largeFaceListId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task CreateWithHttpMessagesAsync(string largeFaceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -116,11 +118,12 @@ public LargeFaceListOperations(FaceClient client) throw new ValidationException(ValidationRules.MaxLength, "userData", 16384); } } - NameAndUserDataContract body = new NameAndUserDataContract(); - if (name != null || userData != null) + MetaDataContract body = new MetaDataContract(); + if (name != null || userData != null || recognitionModel != null) { body.Name = name; body.UserData = userData; + body.RecognitionModel = recognitionModel; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperationsExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperationsExtensions.cs index f48952c1f777..a012bf53e8ee 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperationsExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargeFaceListOperationsExtensions.cs @@ -38,12 +38,14 @@ public static partial class LargeFaceListOperationsExtensions /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The cancellation token. /// - public static async Task CreateAsync(this ILargeFaceListOperations operations, string largeFaceListId, string name = default(string), string userData = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this ILargeFaceListOperations operations, string largeFaceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateWithHttpMessagesAsync(largeFaceListId, name, userData, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.CreateWithHttpMessagesAsync(largeFaceListId, name, userData, recognitionModel, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperations.cs index 97ebad890187..03f785e6dab8 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperations.cs @@ -63,6 +63,8 @@ public LargePersonGroupOperations(FaceClient client) /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// Headers that will be added to request. /// @@ -81,7 +83,7 @@ public LargePersonGroupOperations(FaceClient client) /// /// A response object containing the response body and response headers. /// - public async Task CreateWithHttpMessagesAsync(string largePersonGroupId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task CreateWithHttpMessagesAsync(string largePersonGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -116,11 +118,12 @@ public LargePersonGroupOperations(FaceClient client) throw new ValidationException(ValidationRules.MaxLength, "userData", 16384); } } - NameAndUserDataContract body = new NameAndUserDataContract(); - if (name != null || userData != null) + MetaDataContract body = new MetaDataContract(); + if (name != null || userData != null || recognitionModel != null) { body.Name = name; body.UserData = userData; + body.RecognitionModel = recognitionModel; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperationsExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperationsExtensions.cs index e22c33ea2f77..00fc52f12140 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperationsExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/LargePersonGroupOperationsExtensions.cs @@ -37,12 +37,14 @@ public static partial class LargePersonGroupOperationsExtensions /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The cancellation token. /// - public static async Task CreateAsync(this ILargePersonGroupOperations operations, string largePersonGroupId, string name = default(string), string userData = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this ILargePersonGroupOperations operations, string largePersonGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateWithHttpMessagesAsync(largePersonGroupId, name, userData, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.CreateWithHttpMessagesAsync(largePersonGroupId, name, userData, recognitionModel, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/DetectedFace.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/DetectedFace.cs index 2d64fce0d116..4775f2905655 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/DetectedFace.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/DetectedFace.cs @@ -30,9 +30,10 @@ public DetectedFace() /// /// Initializes a new instance of the DetectedFace class. /// - public DetectedFace(FaceRectangle faceRectangle, System.Guid? faceId = default(System.Guid?), FaceLandmarks faceLandmarks = default(FaceLandmarks), FaceAttributes faceAttributes = default(FaceAttributes)) + public DetectedFace(string recognitionModel, FaceRectangle faceRectangle, System.Guid? faceId = default(System.Guid?), FaceLandmarks faceLandmarks = default(FaceLandmarks), FaceAttributes faceAttributes = default(FaceAttributes)) { FaceId = faceId; + RecognitionModel = recognitionModel; FaceRectangle = faceRectangle; FaceLandmarks = faceLandmarks; FaceAttributes = faceAttributes; @@ -49,6 +50,11 @@ public DetectedFace() [JsonProperty(PropertyName = "faceId")] public System.Guid? FaceId { get; set; } + /// + /// + [JsonProperty(PropertyName = "RecognitionModel")] + public string RecognitionModel { get; set; } + /// /// [JsonProperty(PropertyName = "faceRectangle")] @@ -72,6 +78,10 @@ public DetectedFace() /// public virtual void Validate() { + if (RecognitionModel == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "RecognitionModel"); + } if (FaceRectangle == null) { throw new ValidationException(ValidationRules.CannotBeNull, "FaceRectangle"); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/FaceList.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/FaceList.cs index 8b4dc1030a00..fda9c92ef6b2 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/FaceList.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/FaceList.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models /// /// Face list object. /// - public partial class FaceList : NameAndUserDataContract + public partial class FaceList : MetaDataContract { /// /// Initializes a new instance of the FaceList class. @@ -40,8 +40,8 @@ public FaceList() /// exceed 16KB. /// Persisted faces within the face /// list. - public FaceList(string faceListId, string name = default(string), string userData = default(string), IList persistedFaces = default(IList)) - : base(name, userData) + public FaceList(string faceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string), IList persistedFaces = default(IList)) + : base(name, userData, recognitionModel) { FaceListId = faceListId; PersistedFaces = persistedFaces; diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargeFaceList.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargeFaceList.cs index d5c6da592b97..08ed554a2044 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargeFaceList.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargeFaceList.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models /// /// Large face list object. /// - public partial class LargeFaceList : NameAndUserDataContract + public partial class LargeFaceList : MetaDataContract { /// /// Initializes a new instance of the LargeFaceList class. @@ -36,8 +36,8 @@ public LargeFaceList() /// 128. /// User specified data. Length should not /// exceed 16KB. - public LargeFaceList(string largeFaceListId, string name = default(string), string userData = default(string)) - : base(name, userData) + public LargeFaceList(string largeFaceListId, string name = default(string), string userData = default(string), string recognitionModel = default(string)) + : base(name, userData, recognitionModel) { LargeFaceListId = largeFaceListId; CustomInit(); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargePersonGroup.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargePersonGroup.cs index 18d800d5d556..ea5e45e0e26f 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargePersonGroup.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/LargePersonGroup.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models /// /// Large person group object. /// - public partial class LargePersonGroup : NameAndUserDataContract + public partial class LargePersonGroup : MetaDataContract { /// /// Initializes a new instance of the LargePersonGroup class. @@ -36,8 +36,8 @@ public LargePersonGroup() /// 128. /// User specified data. Length should not /// exceed 16KB. - public LargePersonGroup(string largePersonGroupId, string name = default(string), string userData = default(string)) - : base(name, userData) + public LargePersonGroup(string largePersonGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string)) + : base(name, userData, recognitionModel) { LargePersonGroupId = largePersonGroupId; CustomInit(); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/MetaDataContract.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/MetaDataContract.cs new file mode 100644 index 000000000000..bd15c13b38b1 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/MetaDataContract.cs @@ -0,0 +1,66 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A combination of user defined name and user specified data and + /// recognition model name for largePersonGroup/personGroup, and + /// largeFaceList/faceList. + /// + public partial class MetaDataContract : NameAndUserDataContract + { + /// + /// Initializes a new instance of the MetaDataContract class. + /// + public MetaDataContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetaDataContract class. + /// + /// User defined name, maximum length is + /// 128. + /// User specified data. Length should not + /// exceed 16KB. + public MetaDataContract(string name = default(string), string userData = default(string), string recognitionModel = default(string)) + : base(name, userData) + { + RecognitionModel = recognitionModel; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "RecognitionModel")] + public string RecognitionModel { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/PersonGroup.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/PersonGroup.cs index 7794e32f2bdb..61d2500d5a05 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/PersonGroup.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/Models/PersonGroup.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.CognitiveServices.Vision.Face.Models /// /// Person group object. /// - public partial class PersonGroup : NameAndUserDataContract + public partial class PersonGroup : MetaDataContract { /// /// Initializes a new instance of the PersonGroup class. @@ -36,8 +36,8 @@ public PersonGroup() /// 128. /// User specified data. Length should not /// exceed 16KB. - public PersonGroup(string personGroupId, string name = default(string), string userData = default(string)) - : base(name, userData) + public PersonGroup(string personGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string)) + : base(name, userData, recognitionModel) { PersonGroupId = personGroupId; CustomInit(); diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperations.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperations.cs index 1f6a387a086e..8fa0f9b0212f 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperations.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperations.cs @@ -63,6 +63,8 @@ public PersonGroupOperations(FaceClient client) /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// Headers that will be added to request. /// @@ -81,7 +83,7 @@ public PersonGroupOperations(FaceClient client) /// /// A response object containing the response body and response headers. /// - public async Task CreateWithHttpMessagesAsync(string personGroupId, string name = default(string), string userData = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task CreateWithHttpMessagesAsync(string personGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -116,11 +118,12 @@ public PersonGroupOperations(FaceClient client) throw new ValidationException(ValidationRules.MaxLength, "userData", 16384); } } - NameAndUserDataContract body = new NameAndUserDataContract(); - if (name != null || userData != null) + MetaDataContract body = new MetaDataContract(); + if (name != null || userData != null || recognitionModel != null) { body.Name = name; body.UserData = userData; + body.RecognitionModel = recognitionModel; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperationsExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperationsExtensions.cs index 728e30fa9e28..60a0bbf61e4c 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperationsExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/PersonGroupOperationsExtensions.cs @@ -37,12 +37,14 @@ public static partial class PersonGroupOperationsExtensions /// /// User specified data. Length should not exceed 16KB. /// + /// + /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IPersonGroupOperations operations, string personGroupId, string name = default(string), string userData = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IPersonGroupOperations operations, string personGroupId, string name = default(string), string userData = default(string), string recognitionModel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateWithHttpMessagesAsync(personGroupId, name, userData, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.CreateWithHttpMessagesAsync(personGroupId, name, userData, recognitionModel, null, cancellationToken).ConfigureAwait(false)).Dispose(); } ///