Class: ContextDev::Resources::Utility
- Inherits:
-
Object
- Object
- ContextDev::Resources::Utility
- Defined in:
- lib/context_dev/resources/utility.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Utility
constructor
private
A new instance of Utility.
-
#prefetch(domain:, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::UtilityPrefetchResponse
Some parameter documentations has been truncated, see Models::UtilityPrefetchParams for more details.
-
#prefetch_by_email(email:, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::UtilityPrefetchByEmailResponse
Some parameter documentations has been truncated, see Models::UtilityPrefetchByEmailParams for more details.
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.
71 72 73 |
# File 'lib/context_dev/resources/utility.rb', line 71 def initialize(client:) @client = client end |
Instance Method Details
#prefetch(domain:, 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 brand data for a particular domain soon to improve latency. This endpoint does not charge credits and is available for paid customers to optimize future requests. [You must be on a paid plan to use this endpoint]
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/context_dev/resources/utility.rb', line 25 def prefetch(params) parsed, = ContextDev::UtilityPrefetchParams.dump_request(params) @client.request( method: :post, path: "brand/prefetch", body: parsed, model: ContextDev::Models::UtilityPrefetchResponse, options: ) end |
#prefetch_by_email(email:, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::UtilityPrefetchByEmailResponse
Some parameter documentations has been truncated, see Models::UtilityPrefetchByEmailParams for more details.
Signal that you may fetch brand data for a particular domain soon to improve latency. This endpoint accepts an email address, extracts the domain from it, validates that it’s not a disposable or free email provider, and queues the domain for prefetching. This endpoint does not charge credits and is available for paid customers to optimize future requests. [You must be on a paid plan to use this endpoint]
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/context_dev/resources/utility.rb', line 57 def prefetch_by_email(params) parsed, = ContextDev::UtilityPrefetchByEmailParams.dump_request(params) @client.request( method: :post, path: "brand/prefetch-by-email", body: parsed, model: ContextDev::Models::UtilityPrefetchByEmailResponse, options: ) end |