Example #1
0
        public void CreateExpansions()
        {
            IamConfig config = new IamConfig(
                apikey: apikey
                );

            DiscoveryService service = new DiscoveryService(versionDate, config);

            service.SetEndpoint(url);

            var expansions = new List <Expansion>()
            {
                new Expansion()
                {
                    InputTerms = new List <string>()
                    {
                        "input-term"
                    },
                    ExpandedTerms = new List <string>()
                    {
                        "expanded-term"
                    }
                }
            };

            var result = service.CreateExpansions(
                environmentId: environmentId,
                collectionId: collectionId,
                expansions: expansions
                );

            Console.WriteLine(result.Response);
        }
        public void CreateExpansions()
        {
            IamAuthenticator authenticator = new IamAuthenticator(
                apikey: "{apikey}");

            DiscoveryService service = new DiscoveryService("2019-04-30", authenticator);

            service.SetServiceUrl("{serviceUrl}");

            var expansions = new List <Expansion>()
            {
                new Expansion()
                {
                    InputTerms = new List <string>()
                    {
                        "input-term"
                    },
                    ExpandedTerms = new List <string>()
                    {
                        "expanded-term"
                    }
                }
            };

            var result = service.CreateExpansions(
                environmentId: "{environmentId}",
                collectionId: "{collectionId}",
                expansions: expansions
                );

            Console.WriteLine(result.Response);
        }
        public void CreateExpansions()
        {
            TokenOptions tokenOptions = new TokenOptions()
            {
                IamApiKey  = apikey,
                ServiceUrl = url
            };

            DiscoveryService service = new DiscoveryService(tokenOptions, versionDate);

            var expansions = new List <Expansion>()
            {
                new Expansion()
                {
                    InputTerms = new List <string>()
                    {
                        "input-term"
                    },
                    ExpandedTerms = new List <string>()
                    {
                        "expanded-term"
                    }
                }
            };

            var result = service.CreateExpansions(
                environmentId: environmentId,
                collectionId: collectionId,
                expansions: expansions
                );

            Console.WriteLine(result.Response);
        }