Class: FindAI::Resources::PeopleEnrichment::Enrich

Inherits:
Object
  • Object
show all
Defined in:
lib/find-ai/resources/people_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/people_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 person based on their business email address.

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):

  • :email (String)

    The person's business email address. We won't accept personal email address such as Gmail, Yahoo etc.

Returns:



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

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

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

The endpoint to poll to check the latest results when data about a person 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:



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

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