Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
be8d5e5
Initial commit
Apr 19, 2019
88ca066
regenerated after sawgger update.
Apr 19, 2019
b98de03
Incorporating review comments, updated generated swagger code
Apr 22, 2019
56baa8f
Refactor, fixes, Add new API
Apr 25, 2019
198c1b6
Refactor, Updated datatype definitions
Apr 25, 2019
1570d4f
Fix param type, type definition
Apr 25, 2019
704b8bd
Model* API endpoint updated
Apr 26, 2019
8c5e663
Changed namespace to drop Vision from name
Apr 26, 2019
85af50f
Updated return type for GetModels API
Apr 27, 2019
6e48acd
Generated with approved swagger, partial classes to fix for contentTy…
May 1, 2019
b50f7bc
Incorporating SDK review feedback\comments
May 2, 2019
fb95c83
Review feedback\comments
May 2, 2019
241f014
Adding FR Client Test
May 2, 2019
243c35c
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 2, 2019
ab582d9
Auto generated code
May 3, 2019
57b0809
Fixing test
May 3, 2019
42240c8
Fixing package id
May 3, 2019
c1786b3
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 3, 2019
8c94ad1
Fixed merge issue
May 3, 2019
8d7be42
syncing with master
May 21, 2019
bb06161
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 22, 2019
52526f1
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 22, 2019
2131cd3
Receipt SDK Initial Commit
May 22, 2019
6e3509c
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 30, 2019
95f54eb
merging receipt sdk
May 30, 2019
2c411a6
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 30, 2019
29010d7
Update for Receipts
May 31, 2019
45ece94
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net
May 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions SDKs/_metadata/cognitiveservices_data-plane_FormRecognizer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Installing AutoRest version: latest
AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/FormRecognizer/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=D:\temp\cognitiveservices\Vision.FormRecognizer\src
2019-05-31 12:25:41 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 1e497e5bc4f055f1e890001f254f4c9892f2287b
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4283
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Microsoft.Azure.CognitiveServices.FormRecognizer.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public partial class ElementReference {
private string _resolvedRefProperty = null;
private int _pageIndex;
private int _lineIndex;
private int _wordIndex;

/// <summary>
/// Number of the page containing the element.
/// </summary>
public int Page { get { Resolve(); return _pageIndex + 1; } }

/// <summary>
/// Index of the page containing the element (0-indexed).
/// </summary>
public int PageIndex { get { Resolve(); return _pageIndex; } }

/// <summary>
/// Index of the line within the page containing the element (0-indexed).
/// </summary>
public int LineIndex { get { Resolve(); return _lineIndex; } }

/// <summary>
/// Index of the word within the line containing the element (0-indexed).
/// </summary>
public int WordIndex { get { Resolve(); return _wordIndex; } }

/// <summary>
/// Returns the word referenced by the JSON pointer element reference.
/// </summary>
public Word ResolveWord(ReadReceiptResult result)
{
try
{
return result.RecognitionResults[PageIndex].Lines[LineIndex].Words[WordIndex];
}
catch (Exception e)
{
//throw new ArgumentException("Invalid element reference.");
throw new ArgumentException("Invalid element reference, {0}", e);
}
}

private void Resolve()
{
if (_resolvedRefProperty != RefProperty)
{
var match = Regex.Match(RefProperty, @"^#/recognitionResults/(\d+)/lines/(\d+)/words/(\d+)$");
if (!match.Success)
{
throw new ArgumentException("Invalid element reference.");
}
_pageIndex = int.Parse(match.Groups[1].Value);
_lineIndex = int.Parse(match.Groups[2].Value);
_wordIndex = int.Parse(match.Groups[3].Value);
_resolvedRefProperty = RefProperty;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public static partial class FormRecognizerClientExtensions

public partial class FormRecognizerClient : ServiceClient<FormRecognizerClient>, IFormRecognizerClient
{
partial void CustomInitialize()
{
// Disable metadata property handling when de/serializing models so we can properly support "$ref" in ElementReference.
SerializationSettings.MetadataPropertyHandling = MetadataPropertyHandling.Ignore;
DeserializationSettings.MetadataPropertyHandling = MetadataPropertyHandling.Ignore;
}

public async Task<HttpOperationResponse<AnalyzeResult>> AnalyzeWithCustomModelWithHttpMessagesAsync2(System.Guid id, Stream formStream, IList<string> keys = default(IList<string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken), string contentType = "application/pdf")
{
if (Endpoint == null)
Expand Down
Loading