Пример #1
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            if (!(jobData is ServiceNowCrawlJobData servicenowcrawlJobData))
            {
                yield break;
            }

            var client = clientFactory.CreateNew(servicenowcrawlJobData);

            foreach (var windows in client.GetIncidents())
            {
                yield return(windows);
            }
        }
Пример #2
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 ServiceNowCrawlJobData servicenowCrawlJobData))
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            var client = _servicenowClientFactory.CreateNew(servicenowCrawlJobData);

            return(await Task.FromResult(client.GetAccountInformation()));
        }