Exemplo n.º 1
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new SalesforceCrawlJobData();
 }
Exemplo n.º 2
0
 public override Task <IDictionary <string, object> > GetHelperConfiguration(ProviderUpdateContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId, string folderId)
 {
     return(GetHelperConfiguration(context, jobData, organizationId, userId, providerDefinitionId));
 }
Exemplo n.º 3
0
 public override Task <IEnumerable <WebHookSignature> > CreateWebHook(ExecutionContext context, CrawlJobData jobData, IWebhookDefinition webhookDefinition, IDictionary <string, object> config)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
        public override async Task <CrawlLimit> GetRemainingApiAllowance(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }


            //There is no limit set, so you can pull as often and as much as you want.
            return(await Task.FromResult(new CrawlLimit(-1, TimeSpan.Zero)));
        }
Exemplo n.º 5
0
 public override Task <CrawlLimit> GetRemainingApiAllowance(ExecutionContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
 {
     if (jobData == null)
     {
         throw new ArgumentNullException(nameof(jobData));
     }
     return(Task.FromResult(new CrawlLimit(-1, TimeSpan.Zero)));
 }
Exemplo n.º 6
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new ExchangeSharedMailboxCrawlJobData();
 }
Exemplo n.º 7
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new TrinetCrawlJobData();
 }
Exemplo n.º 8
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            var harvestcrawlercrawlJobData = jobData as HarvestCrawlerCrawlJobData;

            //harvestcrawlercrawlJobData.AccountID = "902612";
            //harvestcrawlercrawlJobData.ApiToken = "Bearer 1539967.pt.ArNsOUz4ALmwHMkqiUItpKuKdhckAkfkeHQCCOoS4r5pWpEJrmE1tRVk9FPeEJJBJL5NTHp_hZuSWn8zb_rBfw";

            if (string.IsNullOrEmpty(harvestcrawlercrawlJobData.AccountID))
            {
                yield break;
            }

            if (string.IsNullOrEmpty(harvestcrawlercrawlJobData.ApiToken))
            {
                yield break;
            }

            if (harvestcrawlercrawlJobData == null)
            {
                yield break;
            }

            var client = _clientFactory.CreateNew(harvestcrawlercrawlJobData);

            //crawl data from provider and yield objects

            var        users  = client.GetUserEntries().ToList();
            List <int> usrIds = new List <int>();

            foreach (var u in users)
            {
                usrIds.Add(u.id);
            }

            var projects = client.GetProjectEntries().ToList();
            var expenses = client.GetExpenseEntries().ToList();
            var clients  = client.GetClientEntries().ToList();
            var estimateItemCategories = client.GetEstimateItemCategoryEntries().ToList();
            var estimates             = client.GetEstimateEntries().ToList();
            var expenseCategories     = client.GetExpenseCategoryEntries().ToList();
            var contacts              = client.GetContactEntries().ToList();
            var invoices              = client.GetInvoiceEntries().ToList();
            var tasks                 = client.GetTaskEntries().ToList();
            var taskAssignments       = client.GetTaskAssignmentEntries().ToList();
            var timeEntries           = client.GetTimeEntryEntries().ToList();
            var userAssignments       = client.GetUserAssignmentEntries().ToList();
            var invoiceItemCategories = client.GetInvoiceItemCategoryEntries().ToList();
            var roles                 = client.GetRoleEntries().ToList();

            List <int> estIds = new List <int>();

            foreach (var est in estimates)
            {
                estIds.Add(est.id);

                est.creator.estimate_id = est.id;
                yield return(est.creator);

                foreach (var line_item in est.line_items)
                {
                    line_item.parent_id            = est.id;
                    line_item.is_child_of_estimate = true;
                    line_item.is_child_of_invoice  = false;
                    var eic = estimateItemCategories.First(e => e.name == line_item.kind);
                    if (eic.estimate_ids == null)
                    {
                        eic.estimate_ids = new List <int>();
                    }
                    eic.estimate_ids.Add(line_item.id);
                }
            }

            var estimateMessages = client.GetEstimateMessageEntries(estIds).ToList();

            foreach (var estMsg in estimateMessages)
            {
                yield return(estMsg);

                foreach (var recp in estMsg.recipients)
                {
                    recp.sender_id = estMsg.id;
                    yield return(recp);
                }
            }

            foreach (var exp in expenses)
            {
                if (exp.receipt != null)
                {
                    exp.receipt.expense_id = exp.id;
                    yield return(exp.receipt);
                }

                var u = users.First(e => e.id == exp.user.id);
                if (u != null)
                {
                    if (u.expense_ids == null)
                    {
                        u.expense_ids = new List <int>();
                    }
                    u.expense_ids.Add(exp.id);
                }

                var p = projects.First(e => e.id == exp.project.id);
                if (p != null)
                {
                    if (p.expense_ids == null)
                    {
                        p.expense_ids = new List <int>();
                    }
                    p.expense_ids.Add(exp.id);
                }

                var ec = expenseCategories.First(e => e.id == exp.expense_category.id);
                if (ec != null)
                {
                    if (ec.expense_ids == null)
                    {
                        p.expense_ids = new List <int>();
                    }
                    p.expense_ids.Add(exp.id);
                }

                if (exp.invoice != null)
                {
                    var inv = invoices.First(e => e.id == exp.invoice.id);
                    if (inv != null)
                    {
                        if (inv.expense_ids == null)
                        {
                            inv.expense_ids = new List <int>();
                        }
                        inv.expense_ids.Add(exp.id);
                    }
                }
            }

            foreach (var invoice in invoices)
            {
                var invoiceMessages = client.GetInvoiceMessageEntries(invoice.id).ToList();
                foreach (var invMsg in invoiceMessages)
                {
                    invMsg.invoice_id = invoice.id;
                    yield return(invMsg);

                    foreach (var rep in invMsg.recipients)
                    {
                        rep.sender_id = invMsg.id;
                        yield return(rep);
                    }
                }

                foreach (var line_item in invoice.line_items)
                {
                    line_item.parent_id            = invoice.id;
                    line_item.is_child_of_invoice  = true;
                    line_item.is_child_of_estimate = false;
                    yield return(line_item);

                    var iic = invoiceItemCategories.First(e => e.name == line_item.kind);
                    if (iic != null)
                    {
                        if (iic.invoice_ids == null)
                        {
                            iic.invoice_ids = new List <int>();
                        }
                        iic.invoice_ids.Add(invoice.id);
                    }
                }

                var invoicePayments = client.GetInvoicePaymentEntries(invoice.id).ToList();
                foreach (var invPay in invoicePayments)
                {
                    invPay.invoice_id = invoice.id;
                    yield return(invPay);

                    invPay.payment_gateway.payment_ID = invPay.id;
                    yield return(invPay.payment_gateway);
                }
            }

            foreach (var proj in projects)
            {
                if (proj.client != null)
                {
                    var c = clients.First(e => e.id == proj.client.id);
                    if (c.project_ids == null)
                    {
                        c.project_ids = new List <int>();
                    }
                    c.project_ids.Add(proj.id);
                }
            }

            foreach (var tskAsg in taskAssignments)
            {
                var t = tasks.First(e => e.id == tskAsg.task.id);
                if (t != null)
                {
                    if (t.task_assignment_ids == null)
                    {
                        t.task_assignment_ids = new List <int>();
                    }
                    t.task_assignment_ids.Add(tskAsg.id);
                }

                var p = projects.First(e => e.id == tskAsg.project.id);
                if (p != null)
                {
                    if (p.task_assignment_ids == null)
                    {
                        p.task_assignment_ids = new List <int>();
                    }
                    p.task_assignment_ids.Add(tskAsg.id);
                }
            }

            foreach (var usrAsg in userAssignments)
            {
                var u = users.First(e => e.id == usrAsg.user.id);
                if (u != null)
                {
                    if (u.user_assignment_ids == null)
                    {
                        u.user_assignment_ids = new List <int>();
                    }
                    u.user_assignment_ids.Add(usrAsg.id);
                }

                var p = projects.First(e => e.id == usrAsg.project.id);
                if (p != null)
                {
                    if (p.user_assignment_ids == null)
                    {
                        p.user_assignment_ids = new List <int>();
                    }
                    p.user_assignment_ids.Add(usrAsg.id);
                }
            }

            var projectAssignments = client.GetProjectAssignmentEntries(usrIds).ToList();

            foreach (var prjAsg in projectAssignments)
            {
                yield return(prjAsg);
            }

            foreach (var timeEntry in timeEntries)
            {
                var u = users.First(e => e.id == timeEntry.user.id);
                if (u != null)
                {
                    if (u.time_entry_ids == null)
                    {
                        u.time_entry_ids = new List <int>();
                    }
                    u.time_entry_ids.Add(timeEntry.id);
                }

                if (timeEntry.client != null)
                {
                    var c = clients.First(e => e.id == timeEntry.client.id);
                    if (c != null)
                    {
                        if (c.time_entry_ids == null)
                        {
                            c.time_entry_ids = new List <int>();
                        }
                        c.time_entry_ids.Add(timeEntry.id);
                    }
                }

                if (timeEntry.project != null)
                {
                    var p = projects.First(e => e.id == timeEntry.project.id);
                    if (p != null)
                    {
                        if (p.time_entry_ids == null)
                        {
                            p.time_entry_ids = new List <int>();
                        }
                        p.time_entry_ids.Add(timeEntry.id);
                    }
                }

                if (timeEntry.task != null)
                {
                    var t = tasks.First(e => e.id == timeEntry.task.id);
                    //var t = tasks.FirstOrDefault(e => e.id == timeEntry.task.id);
                    if (t != null)
                    {
                        if (t.time_entry_ids == null)
                        {
                            t.time_entry_ids = new List <int>();
                        }
                        t.time_entry_ids.Add(timeEntry.id);
                    }
                }

                if (timeEntry.user_assignment != null)
                {
                    var t = userAssignments.First(e => e.id == timeEntry.user_assignment.id);
                    if (t != null)
                    {
                        if (t.time_entry_ids == null)
                        {
                            t.time_entry_ids = new List <int>();
                        }
                        t.time_entry_ids.Add(timeEntry.id);
                    }
                }

                if (timeEntry.task_assignment != null)
                {
                    var t = taskAssignments.First(e => e.id == timeEntry.task_assignment.id);
                    if (t != null)
                    {
                        if (t.time_entry_ids == null)
                        {
                            t.time_entry_ids = new List <int>();
                        }
                        t.time_entry_ids.Add(timeEntry.id);
                    }
                }

                if (timeEntry.invoice != null)
                {
                    var i = invoices.First(e => e.id == timeEntry.invoice.id);
                    if (i != null)
                    {
                        if (i.time_entry_ids == null)
                        {
                            i.time_entry_ids = new List <int>();
                        }
                        i.time_entry_ids.Add(timeEntry.id);
                    }
                }
            }

            foreach (var entry in projects)
            {
                yield return(entry);
            }
            foreach (var entry in users)
            {
                yield return(entry);
            }
            foreach (var entry in clients)
            {
                yield return(entry);
            }
            foreach (var entry in expenses)
            {
                yield return(entry);
            }
            foreach (var entry in expenseCategories)
            {
                yield return(entry);
            }
            foreach (var entry in contacts)
            {
                yield return(entry);
            }
            foreach (var entry in invoices)
            {
                yield return(entry);
            }
            foreach (var entry in tasks)
            {
                yield return(entry);
            }
            foreach (var entry in taskAssignments)
            {
                yield return(entry);
            }
            foreach (var entry in timeEntries)
            {
                yield return(entry);
            }
            foreach (var entry in estimateItemCategories)
            {
                yield return(entry);
            }
            foreach (var entry in userAssignments)
            {
                yield return(entry);
            }
            foreach (var entry in invoiceItemCategories)
            {
                yield return(entry);
            }
            foreach (var entry in roles)
            {
                yield return(entry);
            }
        }
Exemplo n.º 9
0
        public override Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            if (!(jobData is SqlServerConnectorJobData result))
            {
                throw new ArgumentException(
                          "Wrong CrawlJobData type", nameof(jobData));
            }

            var accountId = $"{result.Host}.{result.DatabaseName}";

            return(Task.FromResult(new AccountInformation(accountId, $"{accountId}")));
        }
Exemplo n.º 10
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new DropBoxCrawlJobData(DropBoxConfiguration.Create());
 }
Exemplo n.º 11
0
        public async Task <IEnumerable <object> > GetDataAsync(CrawlJobData jobData)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            if (!(jobData is HubSpotCrawlJobData crawlerJobData))
            {
                return(EmptyResult);
            }

            var client = _clientFactory.CreateNew(crawlerJobData);

            var settings = await client.GetSettingsAsync();

            if (settings == null)
            {
                _log.Error("Settings could not be obtained from HubSpot");
                return(EmptyResult);
            }

            var dailyLimit = await client.GetDailyLimitAsync();

            if (dailyLimit.currentUsage >= dailyLimit.usageLimit)
            {
                _log.Error("HubSpot daily usage limit has been reached");
                return(EmptyResult);
            }


            var data = new List <object>();

            data.AddRange(new CompanyIterator(client, crawlerJobData, settings).Iterate());
            data.AddRange(new DealIterator(client, crawlerJobData, settings).Iterate());
            data.AddRange(new ContactIterator(client, crawlerJobData, settings).Iterate());
            data.AddRange(new DynamicContactListIterator(client, crawlerJobData).Iterate());
            data.AddRange(new FormsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new OwnersIterator(client, crawlerJobData).Iterate());
            data.AddRange(new PublishingChannelsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new FilesIterator(client, crawlerJobData).Iterate());
            data.AddRange(new SiteMapsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new TemplatesIterator(client, crawlerJobData).Iterate());
            data.AddRange(new UrlMappingsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new EngagementsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new RecentDealsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new RecentlyCreatedDealsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new SmtpTokensIterator(client, crawlerJobData).Iterate());
            data.AddRange(new SocialCalendarEventsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new StaticContactListIterator(client, crawlerJobData).Iterate());
            data.AddRange(new TaskCalendarEventsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new WorkflowsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new BlogPostsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new BlogsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new BlogTopicsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new DomainsIterator(client, crawlerJobData).Iterate());
            data.AddRange(new BroadcastMessagesIterator(client, crawlerJobData).Iterate());
            data.AddRange(new ProductsIterator(client, crawlerJobData, settings).Iterate());
            data.AddRange(new LineItemsIterator(client, crawlerJobData, settings).Iterate());
            data.AddRange(new TicketsIterator(client, crawlerJobData, settings).Iterate());

            return(data);
        }
        public override async Task <IEnumerable <WebHookSignature> > CreateWebHook(ExecutionContext context, [NotNull] CrawlJobData jobData, [NotNull] IWebhookDefinition webhookDefinition, [NotNull] IDictionary <string, object> config)
        {
            await Task.Run(() =>
            {
                var adversusCrawlJobData = (AdversusCrawlJobData)jobData;
                var webhookSignatures    = new List <WebHookSignature>();
                try
                {
                    var client = _adversusClientFactory.CreateNew(adversusCrawlJobData);

                    var data = client.GetWebhooks(adversusCrawlJobData.Username, adversusCrawlJobData.Password);

                    if (data == null)
                    {
                        return(webhookSignatures);
                    }

                    var hookTypes         = new[] { "lead_saved", "call_ended", "callAnswered", "leadClosedSuccess", "leadClosedAutomaticRedial", "leadClosedPrivateRedial", "leadClosedNotInterested", "leadClosedInvalid", "leadClosedUnqualified", "leadClosedSystem", "leads_deactivated", "leads_inserted", "mail_activity", "sms_sent", "sms_received", "appointment_added", "appointment_updated" };
                    webhookDefinition.Uri = new Uri(this.appContext.System.Configuration.WebhookReturnUrl.Trim('/') /*+ ConfigurationManagerEx.AppSettings["Providers.HubSpot.WebhookEndpoint"]*/);

                    foreach (var subscription in hookTypes)
                    {
                        if (config.ContainsKey("webhooks"))
                        {
                            //var enabledHooks = (List<WebhookEventType>)config["webhooks"];
                            //var enabled = enabledHooks.Where(s => s.Status == "ACTIVE").Select(s => s.Name);
                            //if (!enabled.Contains(subscription))
                            //{
                            //    continue;
                            //}
                        }

                        try
                        {
                            var result = client.CreateWebhooks(webhookDefinition.Uri, subscription);
                            webhookSignatures.Add(new WebHookSignature {
                                Signature = webhookDefinition.ProviderDefinitionId.ToString(), ExternalVersion = "v1", ExternalId = null, EventTypes = "lead_saved,call_ended,callAnswered,leadClosedSuccess,leadClosedAutomaticRedial,leadClosedPrivateRedial,leadClosedNotInterested,leadClosedInvalid,leadClosedUnqualified,leadClosedSystem,leads_deactivated,leads_inserted,mail_activity,sms_sent,sms_received,appointment_added,appointment_updated"
                            });
                        }
                        catch (Exception exception)
                        {
                            context.Log.LogWarning("Could not create HubSpot Webhook for subscription", exception);
                            return(new List <WebHookSignature>());
                        }
                    }


                    webhookDefinition.Verified = true;
                }
                catch (Exception exception)
                {
                    context.Log.LogWarning("Could not create Adversus Webhook", exception);
                    return(new List <WebHookSignature>());
                }

                var organizationProviderDataStore = context.Organization.DataStores.GetDataStore <ProviderDefinition>();
                if (organizationProviderDataStore != null)
                {
                    if (webhookDefinition.ProviderDefinitionId != null)
                    {
                        var webhookEnabled = organizationProviderDataStore.GetById(context, webhookDefinition.ProviderDefinitionId.Value);
                        if (webhookEnabled != null)
                        {
                            webhookEnabled.WebHooks = true;
                            organizationProviderDataStore.Update(context, webhookEnabled);
                        }
                    }
                }

                return(webhookSignatures);
            });

            return(new List <WebHookSignature>());
        }
        public override async Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            if (!(jobData is AdversusCrawlJobData adversusCrawlJobData))
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            try
            {
                var client = _adversusClientFactory.CreateNew(adversusCrawlJobData);
                var result = client.GetAccountInformation();
                if (result != null)
                {
                    return(new AccountInformation(result.AccountId, result.AccountDisplay));
                }
                return(new AccountInformation(string.Empty, string.Empty)
                {
                    Errors = new Dictionary <string, string>()
                    {
                        { "error", "Please contact CluedIn support in the top menu to help you setup with Adversus." }
                    }
                });
            }
            catch (Exception e)
            {
                context.Log.LogError("There was an error getting HubSpot account information {message}", e);
                return(new AccountInformation(string.Empty, string.Empty)
                {
                    Errors = new Dictionary <string, string>()
                    {
                        { "error", "Please contact CluedIn support in the top menu to help you setup with Adversus." }, { "exception", e.Message }
                    }
                });
            }
        }
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new GeomaticCrawlJobData();
 }
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new AdversusCrawlJobData();
 }
Exemplo n.º 16
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            if (!(jobData is SalesforceCrawlJobData salesforcecrawlJobData))
            {
                yield break;
            }

            var client = _clientFactory.CreateNew(salesforcecrawlJobData);

            //retrieve data from provider and yield objects

            foreach (var item in client.Get <Account>("Account"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Asset>("Asset"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Attachment>("Attachment"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Campaign>("Campaign"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Case>("Case"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <CollaborationGroup>("CollaborationGroup"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Company>("Company"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Contact>("Contact"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <ContentDocument>("ContentDocument"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Contract>("Contract"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Dashboard>("Dashboard"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Document>("Document"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <DomainObject>("Domain"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Event>("Event"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Group>("Group"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Idea>("Idea"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Lead>("Lead"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Network>("Network"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Note>("Note"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Opportunity>("Opportunity"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Order>("Order"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Partner>("Partner"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <PriceBook2>("Pricebook"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Product>("Product"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Profile>("Profile"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Quote>("Quote"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Report>("Report"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Site>("Site"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <Solution>("Solution"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <StreamingChannel>("StreamingChannel"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <SalesForceTask>("Task"))
            {
                yield return(item);
            }

            foreach (var item in client.Get <User>("User"))
            {
                yield return(item);
            }
        }
Exemplo n.º 17
0
        public override async Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            var exchangesharedmailboxCrawlJobData = jobData as ExchangeSharedMailboxCrawlJobData;

            if (exchangesharedmailboxCrawlJobData == null)
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            var client = _exchangesharedmailboxClientFactory.CreateNew(exchangesharedmailboxCrawlJobData);

            return(await Task.FromResult(client.GetAccountInformation()));
        }
Exemplo n.º 18
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new GoToWebinarCrawlJobData();
 }
Exemplo n.º 19
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new SitecoreCrawlJobData();
 }
Exemplo n.º 20
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            if (!(jobData is AdventureWorksCrawlJobData adventureworkscrawlJobData))
            {
                yield break;
            }

            var client = clientFactory.CreateNew(adventureworkscrawlJobData);

            //retrieve data from provider and yield objects

            foreach (var obj in client.GetObject <HumanResourcesDepartment>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <HumanResourcesEmployee>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <HumanResourcesEmployeeDepartmentHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <HumanResourcesEmployeePayHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <HumanResourcesJobCandidate>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <HumanResourcesShift>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonAddress>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonAddressType>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonBusinessEntity>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonBusinessEntityAddress>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonBusinessEntityContact>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonContactType>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonCountryRegion>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonEmailAddress>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonPassword>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonPerson>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonPersonPhone>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonPhoneNumberType>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PersonStateProvince>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionBillOfMaterials>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionCulture>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionDocument>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionIllustration>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionLocation>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProduct>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductCategory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductCostHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductDescription>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductDocument>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductInventory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductListPriceHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductModel>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductModelIllustration>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductModelProductDescriptionCulture>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductPhoto>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductProductPhoto>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductReview>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionProductSubcategory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionScrapReason>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionTransactionHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionTransactionHistoryArchive>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionUnitMeasure>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionWorkOrder>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <ProductionWorkOrderRouting>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PurchasingProductVendor>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PurchasingPurchaseOrderDetail>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PurchasingPurchaseOrderHeader>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PurchasingShipMethod>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <PurchasingVendor>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesCountryRegionCurrency>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesCreditCard>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesCurrency>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesCurrencyRate>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesCustomer>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesPersonCreditCard>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesOrderDetail>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesOrderHeader>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesOrderHeaderSalesReason>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesPerson>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesPersonQuotaHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesReason>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesTaxRate>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesTerritory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSalesTerritoryHistory>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesShoppingCartItem>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSpecialOffer>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesSpecialOfferProduct>())
            {
                yield return(obj);
            }

            foreach (var obj in client.GetObject <SalesStore>())
            {
                yield return(obj);
            }
        }
Exemplo n.º 21
0
        public override async Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            if (!(jobData is ParquetCrawlJobData parquetCrawlJobData))
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            var client = _parquetClientFactory.CreateNew(parquetCrawlJobData);

            return(await Task.FromResult(client.GetAccountInformation()));
        }
Exemplo n.º 22
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new Dynamics365CrawlJobData();
 }
Exemplo n.º 23
0
 public override Task DeleteWebHook(ExecutionContext context, CrawlJobData jobData, IWebhookDefinition webhookDefinition)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 24
0
 public override Task <CrawlLimit> GetRemainingApiAllowance(ExecutionContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
 => Task.FromResult(new CrawlLimit(-1, TimeSpan.Zero));
Exemplo n.º 25
0
        public override async Task <IDictionary <string, object> > GetHelperConfiguration(ProviderUpdateContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData is CompanyHouseExternalSearchJobData result)
            {
                return(await Task.FromResult(result.ToDictionary()));
            }

            throw new InvalidOperationException($"Unexpected data type for {nameof(CompanyHouseExternalSearchJobData)}, {jobData.GetType()}");
        }
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new GreenhouseCrawlJobData();
 }
Exemplo n.º 27
0
 public override Task <AccountInformation> GetAccountInformation(ExecutionContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
 {
     return(Task.FromResult(new AccountInformation(providerDefinitionId.ToString(), providerDefinitionId.ToString())));
 }
Exemplo n.º 28
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new NavisionCrawlJobData();
 }
Exemplo n.º 29
0
        public override Task <IEnumerable <WebHookSignature> > CreateWebHook(ExecutionContext context, [NotNull] CrawlJobData jobData, [NotNull] IWebhookDefinition webhookDefinition, [NotNull] IDictionary <string, object> config)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }
            if (webhookDefinition == null)
            {
                throw new ArgumentNullException(nameof(webhookDefinition));
            }
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            throw new NotImplementedException();
        }
Exemplo n.º 30
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new EnalyzerCrawlJobData();
 }