Пример #1
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 gotomeetingCrawlJobData = jobData as GoToMeetingCrawlJobData;

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

            var client = _gotomeetingClientFactory.CreateNew(gotomeetingCrawlJobData);

            return(client.GetAccountInformation());
        }
Пример #2
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            var gotomeetingcrawlJobData = jobData as GoToMeetingCrawlJobData;

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

            if (string.IsNullOrEmpty(gotomeetingcrawlJobData.AccessToken))
            {
                throw new System.Exception("jobData must have valid access token");
            }

            var client = _clientFactory.CreateNew(gotomeetingcrawlJobData);

            //crawl data from provider and yield objects
            var meetings = client.GetMeetings();

            foreach (var meeting in meetings)
            {
                yield return(meeting);

                if (meeting.Organizer != null)
                {
                    yield return(meeting.Organizer);
                }

                if (meeting.Attendees != null)
                {
                    foreach (var attendee in meeting.Attendees)
                    {
                        yield return(attendee);
                    }
                }
            }
        }