-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.ts
More file actions
105 lines (91 loc) · 3.04 KB
/
utility.ts
File metadata and controls
105 lines (91 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class Utility extends APIResource {
/**
* 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]
*/
prefetch(body: UtilityPrefetchParams, options?: RequestOptions): APIPromise<UtilityPrefetchResponse> {
return this._client.post('/brand/prefetch', { body, ...options });
}
/**
* 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]
*/
prefetchByEmail(
body: UtilityPrefetchByEmailParams,
options?: RequestOptions,
): APIPromise<UtilityPrefetchByEmailResponse> {
return this._client.post('/brand/prefetch-by-email', { body, ...options });
}
}
export interface UtilityPrefetchResponse {
/**
* The domain that was queued for prefetching
*/
domain?: string;
/**
* Success message
*/
message?: string;
/**
* Status of the response, e.g., 'ok'
*/
status?: string;
}
export interface UtilityPrefetchByEmailResponse {
/**
* The domain that was queued for prefetching
*/
domain?: string;
/**
* Success message
*/
message?: string;
/**
* Status of the response, e.g., 'ok'
*/
status?: string;
}
export interface UtilityPrefetchParams {
/**
* Domain name to prefetch brand data for
*/
domain: string;
/**
* Optional timeout in milliseconds for the request. If the request takes longer
* than this value, it will be aborted with a 408 status code. Maximum allowed
* value is 300000ms (5 minutes).
*/
timeoutMS?: number;
}
export interface UtilityPrefetchByEmailParams {
/**
* Email address to prefetch brand data for. The domain will be extracted from the
* email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
* addresses are not allowed.
*/
email: string;
/**
* Optional timeout in milliseconds for the request. If the request takes longer
* than this value, it will be aborted with a 408 status code. Maximum allowed
* value is 300000ms (5 minutes).
*/
timeoutMS?: number;
}
export declare namespace Utility {
export {
type UtilityPrefetchResponse as UtilityPrefetchResponse,
type UtilityPrefetchByEmailResponse as UtilityPrefetchByEmailResponse,
type UtilityPrefetchParams as UtilityPrefetchParams,
type UtilityPrefetchByEmailParams as UtilityPrefetchByEmailParams,
};
}