Esempio n. 1
0
 public ExternClientServices(
     ContentManagementOptions contentManagementOptions,
     IHttpRequestFactory http,
     IJsonSerializer jsonSerializer,
     IExternHttpClient api,
     IPollingStrategy longOperationsPollingStrategy,
     IAuthenticator authenticator,
     ICrypt crypt)
 {
     Http           = http ?? throw new ArgumentNullException(nameof(http));
     JsonSerializer = jsonSerializer ?? throw new ArgumentNullException(nameof(jsonSerializer));
     Api            = api ?? throw new ArgumentNullException(nameof(api));
     LongOperationsPollingStrategy = longOperationsPollingStrategy ?? throw new ArgumentNullException(nameof(longOperationsPollingStrategy));
     Authenticator  = authenticator ?? throw new ArgumentNullException(nameof(authenticator));
     Crypt          = crypt ?? throw new ArgumentNullException(nameof(crypt));
     ContentService = new ContentService(api.Contents, contentManagementOptions);
 }
Esempio n. 2
0
        internal static IEntityList <IDocflow> DocflowsList(
            IExternHttpClient apiClient,
            Guid accountId,
            Guid docflowId,
            Guid documentId,
            DocflowFilterBuilder?filterBuilder,
            LoadPage loadPage)
        {
            var docflowFilter = filterBuilder?.CreateFilter() ?? new DocflowFilter();

            return(new EntityList <IDocflow>(
                       async(skip, take, timeout) =>
            {
                docflowFilter.SetSkip(skip);
                docflowFilter.SetTake(take);

                var relatedDocflows = await loadPage(apiClient, accountId, docflowId, documentId, docflowFilter, timeout).ConfigureAwait(false);
                return (relatedDocflows.DocflowsPageItem, relatedDocflows.TotalCount);
            }));
        }
 public Configured WithExternHttpClient(IExternHttpClient client)
 {
     apiClient = client;
     return(this);
 }