public void Init(string token, string uri)
        {
            if (string.IsNullOrEmpty(token) || string.IsNullOrEmpty(uri))
            {
                throw new ArgumentException("Provide token and host parameters.");
            }

            if (!uri.StartsWith("http"))
            {
                throw new ArgumentException("Please provide valid host url that starts with http or https");
            }

            var client = new IndicoV2.IndicoClient(token, new Uri(uri));

            _submissionsClient       = client.Submissions();
            _submissionResultAwaiter = client.GetSubmissionResultAwaiter();
            _reviewsClient           = client.Reviews();
            _jobAwaiter = client.JobAwaiter();
        }
 /// <summary>
 /// Gets <seealso cref="IStorageClient"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns>Instance of <seealso cref="IStorageClient"/></returns>
 public static IStorageClient Storage(this IndicoClient indicoClient) => new V1StorageClientAdapter(indicoClient.LegacyClient);
 /// <summary>
 /// Gets <seealso cref="IDataSetClient"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns>Instance of <seealso cref="IDataSetClient"/></returns>
 public static IDataSetClient DataSets(this IndicoClient indicoClient) =>
 new DataSetsV1ClientAdapter(indicoClient.LegacyClient);
示例#4
0
 /// <summary>
 /// Gets <seealso cref="IReviewsClient"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns>Instance of <seealso cref="IReviewsClient"/></returns>
 public static IReviewsClient Reviews(this IndicoClient indicoClient) =>
 new ReviewsV1ClientAdapter(indicoClient.LegacyClient);
示例#5
0
 /// <summary>
 /// Gets <seealso cref="IJobsClient"/>
 /// </summary>
 /// <param name="indicoClient">Indico client</param>
 /// <returns>Instance of <seealso cref="IJobsClient"/> /></returns>
 public static IModelClient Models(this IndicoClient indicoClient) => new V1ModelClientAdapter(indicoClient.LegacyClient);
 /// <summary>
 /// Gets <seealso cref="IWorkflowsClient"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns>Instance of <seealso cref="IWorkflowsClient"/></returns>
 public static IWorkflowsClient Workflows(this IndicoClient indicoClient) => new WorkflowsV1ClientAdapter(indicoClient.LegacyClient);
示例#7
0
 /// <summary>
 /// Gets <seealso cref="IJobsClient"/>
 /// </summary>
 /// <param name="indicoClient">Indico client</param>
 /// <returns>Instance of <seealso cref="IJobsClient"/> /></returns>
 public static IJobsClient Jobs(this IndicoClient indicoClient) => new V1JobsClientAdapter(indicoClient.LegacyClient, new JobStatusConverter());
 /// <summary>
 /// Gets <seealso cref="ISubmissionResultAwaiter"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns></returns>
 public static ISubmissionResultAwaiter GetSubmissionResultAwaiter(this IndicoClient indicoClient) =>
 new SubmissionResultAwaiter(indicoClient.Submissions(), indicoClient.JobAwaiter(), indicoClient.Storage());
 /// <summary>
 /// Gets <seealso cref="IOcrClient"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns>Instance of <seealso cref="IOcrClient"/></returns>
 public static IOcrClient Ocr(this IndicoClient indicoClient) =>
 new OcrV1ClientAdapter(indicoClient.LegacyClient, indicoClient.Storage());
 public static IJobAwaiter JobAwaiter(this IndicoClient indicoClient) => new JobAwaiter(indicoClient.Jobs());
示例#11
0
 /// <summary>
 /// Gets <seealso cref="ISubmissionsClient"/>
 /// </summary>
 /// <param name="indicoClient">Instance of <seealso cref="IndicoClient"/></param>
 /// <returns>Instance of <seealso cref="ISubmissionsClient"/></returns>
 public static ISubmissionsClient Submissions(this IndicoClient indicoClient) => new SubmissionsV1ClientAdapter(indicoClient.LegacyClient);