-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfbf0ec
commit 7eef138
Showing
9 changed files
with
215 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Mindee.Exceptions; | ||
using Mindee.Input; | ||
|
||
namespace Mindee.Http | ||
{ | ||
/// <summary> | ||
/// G | ||
/// </summary> | ||
public class GenericParameter | ||
{ | ||
|
||
/// <summary> | ||
/// A local input source. | ||
/// </summary> | ||
public LocalInputSource LocalSource { get; } | ||
|
||
/// <summary> | ||
/// A URL input source. | ||
/// </summary> | ||
public UrlInputSource UrlSource { get; } | ||
|
||
/// <summary> | ||
/// Whether to include the full text data for async APIs. | ||
/// This performs a full OCR operation on the server and will increase response time and payload size. | ||
/// </summary> | ||
/// <remarks>It is not available on all API.</remarks> | ||
public bool FullText { get; } | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="localSource"></param> | ||
/// <param name="urlSource"></param> | ||
/// <param name="fullText"></param> | ||
/// <exception cref="MindeeException"></exception> | ||
public GenericParameter(LocalInputSource localSource, UrlInputSource urlSource, bool fullText) | ||
{ | ||
|
||
if (localSource != null && urlSource != null) | ||
{ | ||
throw new MindeeException("localSource and urlSource may not both be specified."); | ||
} | ||
if (localSource == null && urlSource == null) | ||
{ | ||
throw new MindeeException("One of localSource or urlSource must be specified."); | ||
} | ||
LocalSource = localSource; | ||
UrlSource = urlSource; | ||
FullText = fullText; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Mindee.Input; | ||
|
||
namespace Mindee.Http | ||
{ | ||
/// <summary> | ||
/// Parameter required to use the workflow feature. | ||
/// </summary> | ||
public class WorkflowParameter : GenericParameter | ||
{ | ||
/// <summary> | ||
/// Alias to give to the file. | ||
/// </summary> | ||
public string Alias { get; } | ||
|
||
|
||
/// <summary> | ||
/// Priority to give to the execution. | ||
/// </summary> | ||
public string Priority { get; } | ||
|
||
/// <summary> | ||
/// Workflow parameters. | ||
/// </summary> | ||
/// <param name="localSource">Local input source containing the file.<see cref="GenericParameter.LocalSource"/></param> | ||
/// <param name="urlSource">Source URL to use.<see cref="GenericParameter.UrlSource"/></param> | ||
/// <param name="fullText">Whether to include the full text in the payload (compatible APIs only)<see cref="GenericParameter.FullText"/></param> | ||
/// <param name="alias">Alias to give to the document.<see cref="Alias"/></param> | ||
/// <param name="priority">Priority to give to the document.<see cref="Priority"/></param> | ||
public WorkflowParameter( | ||
LocalInputSource localSource, | ||
UrlInputSource urlSource, bool fullText, | ||
string alias, string priority) : base(localSource, urlSource, | ||
fullText) | ||
{ | ||
Alias = alias; | ||
Priority = priority; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.