public void SearchFacetAsync()
        {
            using (var httpTest = new HttpTest())
            {
                Dictionary <string, string[]> filterDict = new Dictionary <string, string[]>
                {
                    { "TestKey", new string[] { "TestValue" } }
                };
                var mds    = new MetadataService(_cfg);
                var filter = new ArtesianSearchFilter
                {
                    Page       = 1,
                    PageSize   = 1,
                    SearchText = "testText",
                    Filters    = filterDict
                };
                var mdq = mds.SearchFacetAsync(filter).ConfigureAwait(true).GetAwaiter().GetResult();

                httpTest.ShouldHaveCalled($"{_cfg.BaseAddress}v2.1/marketdata/searchfacet"
                                          .SetQueryParam("pageSize", 1)
                                          .SetQueryParam("page", 1)
                                          .SetQueryParam("searchText", "testText")
                                          .SetQueryParam("filters", "TestKey%3ATestValue", true)
                                          )
                .WithVerb(HttpMethod.Get)
                .Times(1);
            }
        }
예제 #2
0
        public void SearchFacet_SearchFacet()
        {
            using (var httpTest = new HttpTest())
            {
                Dictionary <string, string[]> filterDict = new Dictionary <string, string[]>
                {
                    { "TestKey", new [] { "TestValue" } }
                };
                var mds    = new MarketDataService(_cfg);
                var filter = new ArtesianSearchFilter
                {
                    Page       = 1,
                    PageSize   = 1,
                    SearchText = "testText",
                    Filters    = filterDict,
                    Sorts      = new List <string>()
                    {
                        "OriginalTimezone"
                    }
                };
                var mdq = mds.SearchFacetAsync(filter, false).ConfigureAwait(true).GetAwaiter().GetResult();

                httpTest.ShouldHaveCalledPath($"{_cfg.BaseAddress}v2.1/marketdata/searchfacet")
                .WithQueryParam("pageSize", 1)
                .WithQueryParam("page", 1)
                .WithQueryParam("searchText", "testText")
                .WithQueryParam("filters", "TestKey:TestValue")
                .WithQueryParam("sorts", "OriginalTimezone")
                .WithVerb(HttpMethod.Get)
                .Times(1);
            }
        }
예제 #3
0
        public List <MarketDataEntity.Output> MetadataRequest(string curveName, string provider)
        {
            var _cfg   = _config(provider);
            var mds    = new MetaDataService(_cfg);
            var filter = new ArtesianSearchFilter();

            filter.SearchText = curveName;
            filter.Page       = 1;
            filter.PageSize   = 1;

            try
            {
                return(mds.SearchFacetAsync(filter)
                       .ConfigureAwait(true)
                       .GetAwaiter()
                       .GetResult()
                       .Results);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.InnerException);
            }

            return(null);
        }
예제 #4
0
        /// <summary>
        /// Search the marketdata metadata
        /// </summary>
        /// <param name="filter">ArtesianSearchFilter containing the search params</param>
        /// <param name="ctk">CancellationToken</param>
        /// <returns></returns>
        public Task <ArtesianSearchResults> SearchFacetAsync(ArtesianSearchFilter filter, CancellationToken ctk = default)
        {
            filter.Validate();

            var url = "/marketdata/searchfacet"
                      .SetQueryParam("pageSize", filter.PageSize)
                      .SetQueryParam("page", filter.Page)
                      .SetQueryParam("searchText", filter.SearchText)
                      .SetQueryParam("filters", filter.Filters?.SelectMany(s => s.Value.Select(x => $@"{s.Key}:{x}")))
                      .SetQueryParam("sorts", filter.Sorts)
            ;

            return(_client.Exec <ArtesianSearchResults>(HttpMethod.Get, url.ToString(), ctk: ctk));
        }
 /// <summary>
 /// Search the marketdata metadata
 /// </summary>
 /// <param name="filter">ArtesianSearchFilter containing the search params</param>
 /// <param name="ctk">CancellationToken</param>
 /// <returns>ArtesianSearchResults entity</returns>
 public Task <ArtesianSearchResults> SearchFacetAsync(ArtesianSearchFilter filter, CancellationToken ctk = default)
 => SearchFacetAsync(filter: filter, doNotLoadAdditionalInfo: false, ctk: ctk);
예제 #6
0
 public Task <ArtesianSearchResults> SearchFacetAsync(ArtesianSearchFilter filter, CancellationToken ctk = default)
 {
     throw new NotImplementedException();
 }