Class: ContextDev::Resources::Utility

Inherits:
Object
  • Object
show all
Defined in:
lib/context_dev/resources/utility.rb,
sig/context_dev/resources/utility.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Utility

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Utility.

Parameters:



44
45
46
# File 'lib/context_dev/resources/utility.rb', line 44

def initialize(client:)
  @client = client
end

Instance Method Details

#prefetch(identifier:, type:, tags: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::UtilityPrefetchResponse

Some parameter documentations has been truncated, see Models::UtilityPrefetchParams for more details.

Signal that you may fetch data soon to improve latency. The type field selects what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a styleguide extraction) and identifier carries exactly one lookup key: a domain, or an email whose domain is extracted and validated (free email providers and disposable email addresses are not allowed).

Parameters:

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
# File 'lib/context_dev/resources/utility.rb', line 30

def prefetch(params)
  parsed, options = ContextDev::UtilityPrefetchParams.dump_request(params)
  @client.request(
    method: :post,
    path: "utility/prefetch",
    body: parsed,
    model: ContextDev::Models::UtilityPrefetchResponse,
    options: options
  )
end