protected DataConnectorProperties GetDataConnectorProperties() { var result = new DataConnectorProperties(); result.TenantCode = this.GetValueFromHeaderKey(TenantCodeHeaderKey); result.Username = this.GetValueFromHeaderKey(UsernameHeaderKey); result.Password = this.GetValueFromHeaderKey(PasswordHeaderKey); return result; }
protected DataConnectorProperties GetDataConnectorProperties() { var result = new DataConnectorProperties(); result.TenantCode = this.GetValueFromHeaderKey(TenantCodeHeaderKey); result.Username = this.GetValueFromHeaderKey(UsernameHeaderKey); result.Password = this.GetValueFromHeaderKey(PasswordHeaderKey); return(result); }
public async Task <IEnumerable <RecorderUser> > GetUsersAsync(DataConnectorProperties properties) { var list = new List <RecorderUser>(); for (var i = 0; i < 1000; i++) { var user = new RecorderUser { UserId = i.ToString(), AccountId = i.ToString(), Username = string.Format("agent.{0}", i), FirstName = "Agent", LastName = i.ToString(), Mail = string.Format("agent.{0}@qualtrak.com", i) }; list.Add(user); } return(await Task.FromResult(list)); }
public async Task<IEnumerable<RecorderUser>> GetUsersAsync(DataConnectorProperties properties) { var list = new List<RecorderUser>(); for (var i = 0; i < 1000; i++) { var user = new RecorderUser { UserId = i.ToString(), AccountId = i.ToString(), Username = string.Format("agent.{0}", i), FirstName = "Agent", LastName = i.ToString(), Mail = string.Format("agent.{0}@qualtrak.com", i) }; list.Add(user); } return await Task.FromResult(list); }
/// <summary> /// For args.Limit see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit /// For args.SearchCriteria see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-range /// </summary> /// <param name="userId"></param> /// <param name="args">See http://data-connector-api.readthedocs.org/en/latest/before-you-start.html for guidance</param> /// <param name="properties"></param> /// <returns></returns> public async Task<IEnumerable<Media>> GetMediaForUserAsync(string userId, MediaForUserArgs args, DataConnectorProperties properties) { /* * Note for Integration Engineer: * * It is crucial that you incorporate and honour the args.Limit property. Please let Coach dictate how many recordings it needs. * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit * It is also crucial you implement a filter on a date range. Without a date filter you will always return the same set of recordings * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-rang */ int recordingsProcessedSoFar = 0; var list = new List<Media>(); PurgeOldRecordings(); for (var i = 0; i < 1000; i++) { var media = new Media { RecorderUserId = userId, Id = Guid.NewGuid().ToString(), // i.ToString(), Date = DateTime.Now.AddDays(-1), Metadata = "{ \"metadata\" : [{\"label\" : \"Claim No\", \"value\" : \"123456\", \"field\" : \"claim_no\", \"type\" : \"number\"},{\"label\" : \"Caller Id\", \"value\" : \"004401232312311\", \"field\" : \"caller_id\", \"type\" : \"number\" }, {\"label\" : \"Account No\", \"value\" : \"12121231314AB\", \"field\" : \"account_no\", \"type\" : \"string\" }, {\"label\" : \"A really long label description\", \"value\" : \"A really long piece of call metadata information 1234567890 1234567890\", \"field\" : \"notes\", \"type\" : \"string\" }] }", FileName = ConvertAgentIdToMediaFile(userId) }; _agentRecordingsLookup.Add(new AgentRecordingLookup(userId, media.Id, media.FileName)); list.Add(media); recordingsProcessedSoFar++; if (recordingsProcessedSoFar > args.Limit) break; } return await Task.FromResult(list); ; }
public async Task SendEvaluationScoreAsync(SendEvaluationScoreArgs args, DataConnectorProperties properties) { throw new NotImplementedException(); }
public async Task<string> GetMediaUrlAsync(string id, string originalUrl, DataConnectorProperties properties) { return await Task.FromResult(originalUrl); }
public async Task<IEnumerable<Media>> GetMediaByIdsAsync(IEnumerable<string> ids, DataConnectorProperties properties) { var list = new List<Media>(); foreach (var recordingId in ids) { var media = new Media { Id = recordingId, Date = DateTime.Now.AddDays(-1), Metadata = "{ \"metadata\" : [{\"label\" : \"Claim No\", \"value\" : \"123456\", \"field\" : \"claim_no\", \"type\" : \"number\"},{\"label\" : \"Caller Id\", \"value\" : \"004401232312311\", \"field\" : \"caller_id\", \"type\" : \"number\" }, {\"label\" : \"Account No\", \"value\" : \"12121231314AB\", \"field\" : \"account_no\", \"type\" : \"string\" }, {\"label\" : \"A really long label description\", \"value\" : \"A really long piece of call metadata information 1234567890 1234567890\", \"field\" : \"notes\", \"type\" : \"string\" }] }", FileName = GetRecordingById(recordingId) }; list.Add(media); } return await Task.FromResult(list); }
/// <summary> /// For args.Limit see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit /// For args.SearchCriteria see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-range /// </summary> /// <param name="args">See http://data-connector-api.readthedocs.org/en/latest/before-you-start.html for guidance</param> /// <param name="properties"></param> /// <returns></returns> public async Task<IEnumerable<MediaUser>> GetMediaForUsersAsync(MediaForUsersArgs args, DataConnectorProperties properties) { /* * Note for Integration Engineer: * * It is crucial that you incorporate and honour the args.Limit property. Please let Coach dictate how many recordings it needs. * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit * It is also crucial you implement a filter on a date range. Without a date filter you will always return the same set of recordings * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-rang */ var result = new List<MediaUser>(); MediaForUserArgs userArgs = CreateMediaForUserArgs(args); foreach (var userId in args.UserIds) { IEnumerable<Media> media = await this.GetMediaForUserAsync(userId, userArgs, properties); IEnumerable<MediaUser> mediaUsers = media.Select(x => new MediaUser { MediaId = x.Id, RecorderUserId = x.RecorderUserId }).ToList(); result.AddRange(mediaUsers); media.ToList().Clear(); mediaUsers.ToList().Clear(); } return result; }
/// <summary> /// For args.Limit see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit /// For args.SearchCriteria see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-range /// </summary> /// <param name="userId"></param> /// <param name="args">See http://data-connector-api.readthedocs.org/en/latest/before-you-start.html for guidance</param> /// <param name="properties"></param> /// <returns></returns> public async Task <IEnumerable <Media> > GetMediaForUserAsync(string userId, MediaForUserArgs args, DataConnectorProperties properties) { /* * Note for Integration Engineer: * * It is crucial that you incorporate and honour the args.Limit property. Please let Coach dictate how many recordings it needs. * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit * It is also crucial you implement a filter on a date range. Without a date filter you will always return the same set of recordings * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-rang */ int recordingsProcessedSoFar = 0; var list = new List <Media>(); PurgeOldRecordings(); for (var i = 0; i < 1000; i++) { var media = new Media { RecorderUserId = userId, Id = Guid.NewGuid().ToString(), // i.ToString(), Date = DateTime.Now.AddDays(-1), Metadata = "{ \"metadata\" : [{\"label\" : \"Claim No\", \"value\" : \"123456\", \"field\" : \"claim_no\", \"type\" : \"number\"},{\"label\" : \"Caller Id\", \"value\" : \"004401232312311\", \"field\" : \"caller_id\", \"type\" : \"number\" }, {\"label\" : \"Account No\", \"value\" : \"12121231314AB\", \"field\" : \"account_no\", \"type\" : \"string\" }, {\"label\" : \"A really long label description\", \"value\" : \"A really long piece of call metadata information 1234567890 1234567890\", \"field\" : \"notes\", \"type\" : \"string\" }] }", FileName = ConvertAgentIdToMediaFile(userId) }; _agentRecordingsLookup.Add(new AgentRecordingLookup(userId, media.Id, media.FileName)); list.Add(media); recordingsProcessedSoFar++; if (recordingsProcessedSoFar > args.Limit) { break; } } return(await Task.FromResult(list));; }
public async Task <string> GetMediaUrlAsync(string id, string originalUrl, DataConnectorProperties properties) { return(await Task.FromResult(originalUrl)); }
public async Task <IEnumerable <Media> > GetMediaByIdsAsync(IEnumerable <string> ids, DataConnectorProperties properties) { var list = new List <Media>(); foreach (var recordingId in ids) { var media = new Media { Id = recordingId, Date = DateTime.Now.AddDays(-1), Metadata = "{ \"metadata\" : [{\"label\" : \"Claim No\", \"value\" : \"123456\", \"field\" : \"claim_no\", \"type\" : \"number\"},{\"label\" : \"Caller Id\", \"value\" : \"004401232312311\", \"field\" : \"caller_id\", \"type\" : \"number\" }, {\"label\" : \"Account No\", \"value\" : \"12121231314AB\", \"field\" : \"account_no\", \"type\" : \"string\" }, {\"label\" : \"A really long label description\", \"value\" : \"A really long piece of call metadata information 1234567890 1234567890\", \"field\" : \"notes\", \"type\" : \"string\" }] }", FileName = GetRecordingById(recordingId) }; list.Add(media); } return(await Task.FromResult(list)); }
/// <summary> /// For args.Limit see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit /// For args.SearchCriteria see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-range /// </summary> /// <param name="args">See http://data-connector-api.readthedocs.org/en/latest/before-you-start.html for guidance</param> /// <param name="properties"></param> /// <returns></returns> public async Task <IEnumerable <MediaUser> > GetMediaForUsersAsync(MediaForUsersArgs args, DataConnectorProperties properties) { /* * Note for Integration Engineer: * * It is crucial that you incorporate and honour the args.Limit property. Please let Coach dictate how many recordings it needs. * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#limit * It is also crucial you implement a filter on a date range. Without a date filter you will always return the same set of recordings * - see http://data-connector-api.readthedocs.org/en/latest/before-you-start.html#date-rang */ var result = new List <MediaUser>(); MediaForUserArgs userArgs = CreateMediaForUserArgs(args); foreach (var userId in args.UserIds) { IEnumerable <Media> media = await this.GetMediaForUserAsync(userId, userArgs, properties); IEnumerable <MediaUser> mediaUsers = media.Select(x => new MediaUser { MediaId = x.Id, RecorderUserId = x.RecorderUserId }).ToList(); result.AddRange(mediaUsers); media.ToList().Clear(); mediaUsers.ToList().Clear(); } return(result); }