public LRClient() { _serializer = LRUtils.GetSerializer(); _encoder = LRUtils.GetEncoder(); _harvester = new Harvester(); SslValidationCallback = AcceptAllCertificates; }
public PublishResponse Publish(lr_Envelope docs) { string rawData = LRUtils.HttpPostRequest(_baseUri, LRUtils.Routes.Publish, docs.Serialize(), "application/json", this.Username, this.Password); return(_serializer.Deserialize <PublishResponse>(rawData)); }
private HarvestResult harvestFromDateRange(string action, DateTime fromDate, DateTime untilDate) { var args = new Dictionary <string, object>(); args["from"] = fromDate.ToString(LRUtils.ISO_8061_FORMAT); args["until"] = untilDate.ToString(LRUtils.ISO_8061_FORMAT); return(LRUtils.Harvest(_baseUri, action, args)); }
private HarvestResult harvestFromDateBoundary(string action, string boundaryType, DateTime date) { return(LRUtils.Harvest(_baseUri, action, new Dictionary <string, object>() { { boundaryType, date.ToString(LRUtils.ISO_8061_FORMAT) } })); }
public LRClient(string baseUri, string username, string password) { _baseUri = new Uri(baseUri); _serializer = LRUtils.GetSerializer(); _encoder = LRUtils.GetEncoder(); _harvester = new Harvester(_baseUri); Username = username; Password = password; SslValidationCallback = AcceptAllCertificates; }
public ObtainResult ObtainDocsByResourceLocator(string locator, bool ids_only = false) { Dictionary <string, object> args = new Dictionary <string, object>(); if (ids_only) { args["ids_only"] = "true"; args["by_doc_ID"] = "true"; //we only want doc ids } return(LRUtils.Obtain(_baseUri, locator, args)); }
public lr_document ObtainDocByID(string docId) { Dictionary <string, object> args = new Dictionary <string, object>(); args["by_doc_ID"] = true; var result = LRUtils.Obtain(_baseUri, docId, args, this.Username, this.Password); if (result.documents.Count < 1) { throw new Exception("Document with id " + docId + " does not exist."); } return(result.documents[0].document[0]); }
private GetRecordHarvestResult getRecord(string requestId, bool byDocId = false) { Console.WriteLine(_baseUri.AbsoluteUri); var args = new Dictionary <string, object>(); args["request_ID"] = requestId; if (byDocId) { args["by_doc_ID"] = true.ToString(); } var result = (GetRecordHarvestResult)LRUtils.Harvest(_baseUri, HarvesterActions.GetRecord, args); return(result); }
protected override ResumableResult getPage() { return(LRUtils.Slice(this.BaseUri, this._Args)); }
protected override ResumableResult getPage() { return(LRUtils.Harvest(this.BaseUri, this.Action, _Args, this.HttpUsername, this.HttpPassword)); }
public ListMetadataFormatsHarvestResult ListMetadataFormats() { return((ListMetadataFormatsHarvestResult)LRUtils.Harvest(_baseUri, HarvesterActions.ListMetadataFormats, null)); }
public ListIdentifiersHarvestResult ListIdentifiers() { return((ListIdentifiersHarvestResult)LRUtils.Harvest(_baseUri, HarvesterActions.ListIdentifiers, null)); }
public ListRecordsHarvestResult ListRecords() { return((ListRecordsHarvestResult)LRUtils.Harvest(_baseUri, HarvesterActions.ListRecords, null)); }
protected override ResumableResult getPage() { return(LRUtils.Obtain(BaseUri, new List <string>(), _Args, HttpUsername, HttpPassword)); }