Skip to content

Commit

Permalink
.NET SDK Resource Provider:'ComputerVision'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5721'
REST Spec PR Author 'toothache'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 21, 2019
1 parent c12c8f4 commit e85db9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4231,10 +4231,6 @@ private void Initialize()
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='mode'>
/// Type of text to recognize. Possible values include: 'Handwritten',
/// 'Printed'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -4253,7 +4249,7 @@ private void Initialize()
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationHeaderResponse<BatchReadFileInStreamHeaders>> BatchReadFileInStreamWithHttpMessagesAsync(Stream image, TextRecognitionMode mode, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<HttpOperationHeaderResponse<BatchReadFileInStreamHeaders>> BatchReadFileInStreamWithHttpMessagesAsync(Stream image, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Endpoint == null)
{
Expand All @@ -4271,20 +4267,13 @@ private void Initialize()
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("image", image);
tracingParameters.Add("mode", mode);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BatchReadFileInStream", tracingParameters);
}
// Construct URL
var _baseUrl = BaseUri;
var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "read/core/asyncBatchAnalyze";
_url = _url.Replace("{Endpoint}", Endpoint);
List<string> _queryParameters = new List<string>();
_queryParameters.Add(string.Format("mode={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(mode, SerializationSettings).Trim('"'))));
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,16 +796,12 @@ public static partial class ComputerVisionClientExtensions
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='mode'>
/// Type of text to recognize. Possible values include: 'Handwritten',
/// 'Printed'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<BatchReadFileInStreamHeaders> BatchReadFileInStreamAsync(this IComputerVisionClient operations, Stream image, TextRecognitionMode mode, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<BatchReadFileInStreamHeaders> BatchReadFileInStreamAsync(this IComputerVisionClient operations, Stream image, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BatchReadFileInStreamWithHttpMessagesAsync(image, mode, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.BatchReadFileInStreamWithHttpMessagesAsync(image, null, cancellationToken).ConfigureAwait(false))
{
return _result.Headers;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,13 @@ public partial interface IComputerVisionClient : System.IDisposable
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='mode'>
/// Type of text to recognize. Possible values include: 'Handwritten',
/// 'Printed'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<HttpOperationHeaderResponse<BatchReadFileInStreamHeaders>> BatchReadFileInStreamWithHttpMessagesAsync(Stream image, TextRecognitionMode mode, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<HttpOperationHeaderResponse<BatchReadFileInStreamHeaders>> BatchReadFileInStreamWithHttpMessagesAsync(Stream image, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

}
}

0 comments on commit e85db9b

Please sign in to comment.