/// <summary> /// Static helper used to search for Company Data. /// </summary> /// <returns>The <see cref="CompanyResponse"/>.</returns> /// <param name="apiKey">API key.</param> /// <param name="type">Type.</param> /// <param name="value">Value.</param> /// <param name="conf">Required <see cref="Confidence"/> level.</param> public static CompanyResponse Search(string apiKey, CompanyLookup type, string value, Confidence conf = Confidence.None) { // Create the service. var svc = new Service(apiKey); // Perform the search. return(svc.Search(type, value, conf)); }
/// <summary> /// Creates a new Company Contact Info request. /// </summary> /// <param name="svc">Svc.</param> public CompanyRequest(Service svc, string value, CompanyLookup type, Confidence conf = Confidence.None) { // Create the params. HttpParams parameters = new HttpParams { // Type param. { type.ToString().ToLower(), value.Trim() } }; // Build the confidence section, if there is a given confidence. if (conf != Confidence.None) { parameters.Add("confidence", conf.ToString().ToLower()); } // Execute via the base class. this.Execute(Endpoint.Company, svc.ApiKey, parameters); }
/// <summary> /// Search overload for the Company data endpoint. /// </summary> /// <returns><see cref="CompanyResponse"/></returns> /// <param name="type"><see cref="CompanyLookup"/> Type.</param> /// <param name="value">Value to use in the search.</param> /// <param name="conf">Required <see cref="Confidence"/> level.</param> public CompanyResponse Search(CompanyLookup type, string value, Confidence conf = Confidence.None) => new CompanyResponse(new CompanyRequest(this, value, type, conf));