Class: FindAI::Resources::CompanyEnrichment::Enrich

Inherits:
Object
  • Object
show all
Defined in:
lib/find-ai/resources/company_enrichment/enrich.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Enrich

Returns a new instance of Enrich.



7
8
9
# File 'lib/find-ai/resources/company_enrichment/enrich.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ FindAI::Models::EnrichCreateResponse

Returns structured data about a company based on a domain input.

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :domain (String)

    The domain of the company.

Returns:



19
20
21
22
23
24
25
26
# File 'lib/find-ai/resources/company_enrichment/enrich.rb', line 19

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

#retrieve(token, opts = {}) ⇒ FindAI::Models::EnrichRetrieveResponse

The endpoint to poll to check the latest results when data about a company isn't immediately available.

Parameters:

  • token (String)

    The token returned with your initial API call.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



35
36
37
38
39
40
41
# File 'lib/find-ai/resources/company_enrichment/enrich.rb', line 35

def retrieve(token, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/v1/companies/enrich/#{token}"
  req[:model] = FindAI::Models::EnrichRetrieveResponse
  @client.request(req, opts)
end