public virtual int CreateConfigurations(List <ConfigurationDefinition> items)
        {
            var url      = RepositoryClient.BuildUrl(ApiKeys, "configurations");
            var data     = JsonConvert.SerializeObject(items);
            var response = RepositoryClient.PostStatus(url, data);

            return(response);
        }
コード例 #2
0
        public virtual int SendDocument(DocumentRequest doc, string configId = null)
        {
            string url      = RepositoryClient.BuildUrl(ApiKeys, "document", configId);
            string data     = JsonConvert.SerializeObject(doc);
            int    response = RepositoryClient.PostStatus(url, data);

            return(response);
        }
コード例 #3
0
        public virtual int CreateBlacklistItem(List <string> items, string configId = null)
        {
            string url      = RepositoryClient.BuildUrl(ApiKeys, "blacklist", configId);
            var    data     = JsonConvert.SerializeObject(items);
            var    response = RepositoryClient.PostStatus(url, data);

            return(response);
        }
コード例 #4
0
        public virtual int SendCollection(CollectionRequest collection, string configId = null, string jobId = null)
        {
            string url = RepositoryClient.BuildUrl(ApiKeys, "collection", configId);

            if (!string.IsNullOrEmpty(jobId))
            {
                var delimiter = string.IsNullOrWhiteSpace(configId) ? "?" : "&";
                url = $"{url}{delimiter}job_id={jobId}";
            }
            string data     = JsonConvert.SerializeObject(collection);
            var    response = RepositoryClient.PostStatus(url, data);

            return(response);
        }