From c64a9ef5fa63e023039ee25df5995ae5075fe31a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 26 Sep 2024 22:31:59 +0000 Subject: [PATCH 1/4] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 79f3b26..dfaaf59 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 6 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-bf9b5b8a950e0a79b0bf1911bf01feb5a3575113be8f5d24f7b487351f3470c5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-eb213564d2ef98cf3d73c3688212227fdbb3974a8422b15d14c5b20bfdf8d22b.yml From 96c2c1dc60a94573ffb5bb8784a1ac78bedaaaf6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:31:48 +0000 Subject: [PATCH 2/4] feat(api): OpenAPI spec update via Stainless API (#11) --- .stats.yml | 4 +-- lib/find-ai.rb | 4 --- lib/find-ai/models/enrich_create_response.rb | 35 ------------------- .../models/enrich_retrieve_response.rb | 35 ------------------- .../resources/company_enrichment/enrich.rb | 32 ----------------- .../resources/people_enrichment/enrich.rb | 33 ----------------- .../company_enrichment/enrich_test.rb | 10 ------ .../people_enrichment/enrich_test.rb | 10 ------ 8 files changed, 2 insertions(+), 161 deletions(-) delete mode 100644 lib/find-ai/models/enrich_create_response.rb delete mode 100644 lib/find-ai/models/enrich_retrieve_response.rb diff --git a/.stats.yml b/.stats.yml index dfaaf59..e458891 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 6 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-eb213564d2ef98cf3d73c3688212227fdbb3974a8422b15d14c5b20bfdf8d22b.yml +configured_endpoints: 2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-703a90257c6ec20e6b67cbb97b6699e96ffef05e62249c4d98bd8fb5b197617d.yml diff --git a/lib/find-ai.rb b/lib/find-ai.rb index a96a53d..1c246e7 100644 --- a/lib/find-ai.rb +++ b/lib/find-ai.rb @@ -17,10 +17,6 @@ require "find-ai/pooled_net_requester" require "find-ai/util" require "find-ai/version" -require "find-ai/models/enrich_create_response" -require "find-ai/models/enrich_retrieve_response" -require "find-ai/models/enrich_create_response" -require "find-ai/models/enrich_retrieve_response" require "find-ai/models/search_create_response" require "find-ai/models/search_retrieve_response" require "find-ai/resources/company_enrichment" diff --git a/lib/find-ai/models/enrich_create_response.rb b/lib/find-ai/models/enrich_create_response.rb deleted file mode 100644 index 6264e22..0000000 --- a/lib/find-ai/models/enrich_create_response.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module FindAI - module Models - class EnrichCreateResponse < BaseModel - # @!attribute [rw] facts - # A list of facts we have on record about the company. - # @return [Array] - required :facts, FindAI::ArrayOf.new(String) - - # @!attribute [rw] name_ - # @return [String] - required :name_, String - - # @!attribute [rw] short_description - # A summary of information about the company. - # @return [String] - required :short_description, String - - # @!attribute [rw] website - # @return [String] - required :website, String - - # @!attribute [rw] linkedin_url - # The URL to the company's LinkedIn profile if one exists. - # @return [String] - optional :linkedin_url, String - - # @!attribute [rw] photo_url - # A URL to an image of the company's logo. Valid for 10 minutes. - # @return [String] - optional :photo_url, String - end - end -end diff --git a/lib/find-ai/models/enrich_retrieve_response.rb b/lib/find-ai/models/enrich_retrieve_response.rb deleted file mode 100644 index a133c10..0000000 --- a/lib/find-ai/models/enrich_retrieve_response.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module FindAI - module Models - class EnrichRetrieveResponse < BaseModel - # @!attribute [rw] facts - # A list of facts we have on record about the company. - # @return [Array] - required :facts, FindAI::ArrayOf.new(String) - - # @!attribute [rw] name_ - # @return [String] - required :name_, String - - # @!attribute [rw] short_description - # A summary of information about the company. - # @return [String] - required :short_description, String - - # @!attribute [rw] website - # @return [String] - required :website, String - - # @!attribute [rw] linkedin_url - # The URL to the company's LinkedIn profile if one exists. - # @return [String] - optional :linkedin_url, String - - # @!attribute [rw] photo_url - # A URL to an image of the company's logo. Valid for 10 minutes. - # @return [String] - optional :photo_url, String - end - end -end diff --git a/lib/find-ai/resources/company_enrichment/enrich.rb b/lib/find-ai/resources/company_enrichment/enrich.rb index 1bfb3eb..cf19d37 100644 --- a/lib/find-ai/resources/company_enrichment/enrich.rb +++ b/lib/find-ai/resources/company_enrichment/enrich.rb @@ -7,38 +7,6 @@ class Enrich def initialize(client:) @client = client end - - # Returns structured data about a company based on a domain input. - # - # @param params [Hash] Attributes to send in this request. - # @option params [String] :domain The domain of the company. - # - # @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request. - # - # @return [FindAI::Models::EnrichCreateResponse] - def create(params = {}, opts = {}) - req = {} - req[:method] = :post - req[:path] = "/v1/companies/enrich" - req[:body] = params - req[:model] = FindAI::Models::EnrichCreateResponse - @client.request(req, opts) - end - - # The endpoint to poll to check the latest results when data about a company isn't - # immediately available. - # - # @param token [String] The token returned with your initial API call. - # @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request. - # - # @return [FindAI::Models::EnrichRetrieveResponse] - def retrieve(token, opts = {}) - req = {} - req[:method] = :get - req[:path] = "/v1/companies/enrich/#{token}" - req[:model] = FindAI::Models::EnrichRetrieveResponse - @client.request(req, opts) - end end end end diff --git a/lib/find-ai/resources/people_enrichment/enrich.rb b/lib/find-ai/resources/people_enrichment/enrich.rb index f20cd9a..5480048 100644 --- a/lib/find-ai/resources/people_enrichment/enrich.rb +++ b/lib/find-ai/resources/people_enrichment/enrich.rb @@ -7,39 +7,6 @@ class Enrich def initialize(client:) @client = client end - - # Returns structured data about a person based on their business email address. - # - # @param params [Hash] Attributes to send in this request. - # @option params [String] :email The person's business email address. We won't accept personal email address such - # as Gmail, Yahoo etc. - # - # @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request. - # - # @return [FindAI::Models::EnrichCreateResponse] - def create(params = {}, opts = {}) - req = {} - req[:method] = :post - req[:path] = "/v1/people/enrich" - req[:body] = params - req[:model] = FindAI::Models::EnrichCreateResponse - @client.request(req, opts) - end - - # The endpoint to poll to check the latest results when data about a person isn't - # immediately available. - # - # @param token [String] The token returned with your initial API call. - # @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request. - # - # @return [FindAI::Models::EnrichRetrieveResponse] - def retrieve(token, opts = {}) - req = {} - req[:method] = :get - req[:path] = "/v1/people/enrich/#{token}" - req[:model] = FindAI::Models::EnrichRetrieveResponse - @client.request(req, opts) - end end end end diff --git a/test/find-ai/resources/company_enrichment/enrich_test.rb b/test/find-ai/resources/company_enrichment/enrich_test.rb index b9b00d5..adbe388 100644 --- a/test/find-ai/resources/company_enrichment/enrich_test.rb +++ b/test/find-ai/resources/company_enrichment/enrich_test.rb @@ -6,14 +6,4 @@ class FindAI::Test::Resources::EnrichTest < Test::Unit::TestCase def setup @find_ai = FindAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") end - - def test_create - response = @find_ai.company_enrichment.enrich.create - assert_kind_of(FindAI::Models::EnrichCreateResponse, response) - end - - def test_retrieve - response = @find_ai.company_enrichment.enrich.retrieve("token") - assert_kind_of(FindAI::Models::EnrichRetrieveResponse, response) - end end diff --git a/test/find-ai/resources/people_enrichment/enrich_test.rb b/test/find-ai/resources/people_enrichment/enrich_test.rb index 3ca76fc..adbe388 100644 --- a/test/find-ai/resources/people_enrichment/enrich_test.rb +++ b/test/find-ai/resources/people_enrichment/enrich_test.rb @@ -6,14 +6,4 @@ class FindAI::Test::Resources::EnrichTest < Test::Unit::TestCase def setup @find_ai = FindAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") end - - def test_create - response = @find_ai.people_enrichment.enrich.create - assert_kind_of(FindAI::Models::EnrichCreateResponse, response) - end - - def test_retrieve - response = @find_ai.people_enrichment.enrich.retrieve("token") - assert_kind_of(FindAI::Models::EnrichRetrieveResponse, response) - end end From 07c3177ed3717f61c7ba031dbf058cfc1212d2d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:38:54 +0000 Subject: [PATCH 3/4] chore(types): more detailed type documentation (#13) --- lib/find-ai/client.rb | 13 +++++++++---- lib/find-ai/resources/searches.rb | 12 ++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/find-ai/client.rb b/lib/find-ai/client.rb index ae00579..c88b88e 100644 --- a/lib/find-ai/client.rb +++ b/lib/find-ai/client.rb @@ -5,7 +5,8 @@ class Client < BaseClient # Default max number of retries to attempt after a failed retryable request. DEFAULT_MAX_RETRIES = 2 - # Client options. + # Client option + # @return [String] attr_reader :api_key # @return [FindAI::Resources::CompanyEnrichment] @@ -23,11 +24,15 @@ def auth_headers end # Creates and returns a new client for interacting with the API. - def initialize(base_url: nil, api_key: nil, max_retries: nil) + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + # @param api_key [String, nil] Defaults to `ENV["FIND_AI_API_KEY"]` + # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. + # + # @return [FindAI::Client] + def initialize(base_url: nil, api_key: nil, max_retries: DEFAULT_MAX_RETRIES) base_url ||= "https://usefind.ai/found" - max_retries ||= DEFAULT_MAX_RETRIES - @api_key = [api_key, ENV["FIND_AI_API_KEY"]].find { |v| !v.nil? } if @api_key.nil? raise ArgumentError, "api_key is required" diff --git a/lib/find-ai/resources/searches.rb b/lib/find-ai/resources/searches.rb index 99c3436..de9bb43 100644 --- a/lib/find-ai/resources/searches.rb +++ b/lib/find-ai/resources/searches.rb @@ -10,12 +10,12 @@ def initialize(client:) # Starts a search. # # @param params [Hash] Attributes to send in this request. - # @option params [Float] :max_matches The maximum number of results to return. optional for result_mode exact - # @option params [String] :query Search query. - # @option params [String] :result_mode The mode of the search. Valid values are 'exact' or 'best'. - # @option params [String] :scope The scope of the search. Valid values are 'people' or 'companies'. + # @option params [Float, nil] :max_matches The maximum number of results to return. optional for result_mode exact + # @option params [String, nil] :query Search query. + # @option params [String, nil] :result_mode The mode of the search. Valid values are 'exact' or 'best'. + # @option params [String, nil] :scope The scope of the search. Valid values are 'people' or 'companies'. # - # @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request. + # @param opts [Hash, FindAI::RequestOptions] Options to specify HTTP behaviour for this request. # # @return [FindAI::Models::SearchCreateResponse] def create(params = {}, opts = {}) @@ -30,7 +30,7 @@ def create(params = {}, opts = {}) # The endpoint to poll to check the latest results of a search. # # @param id [String] The id returned with your initial API call. - # @param opts [Hash|RequestOptions] Options to specify HTTP behaviour for this request. + # @param opts [Hash, FindAI::RequestOptions] Options to specify HTTP behaviour for this request. # # @return [Array] def retrieve(id, opts = {}) From 48264e494e12de1ef1c5641ec5c4802fc6b6ca49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:39:06 +0000 Subject: [PATCH 4/4] release: 0.1.0-alpha.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ lib/find-ai/version.rb | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f14b480..aaf968a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ffe4f..ab63033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.1.0-alpha.3 (2024-10-02) + +Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/Find-AI/find-ai-ruby/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#11](https://github.com/Find-AI/find-ai-ruby/issues/11)) ([96c2c1d](https://github.com/Find-AI/find-ai-ruby/commit/96c2c1dc60a94573ffb5bb8784a1ac78bedaaaf6)) + + +### Chores + +* **types:** more detailed type documentation ([#13](https://github.com/Find-AI/find-ai-ruby/issues/13)) ([07c3177](https://github.com/Find-AI/find-ai-ruby/commit/07c3177ed3717f61c7ba031dbf058cfc1212d2d4)) + ## 0.1.0-alpha.2 (2024-09-26) Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/Find-AI/find-ai-ruby/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) diff --git a/lib/find-ai/version.rb b/lib/find-ai/version.rb index 7a5ea85..c9c373f 100644 --- a/lib/find-ai/version.rb +++ b/lib/find-ai/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module FindAI - VERSION = "0.1.0-alpha.2" + VERSION = "0.1.0-alpha.3" end