-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.ts
More file actions
149 lines (129 loc) · 4.15 KB
/
Copy pathutility.ts
File metadata and controls
149 lines (129 loc) · 4.15 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// 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.
*/
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.
*/
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;
/**
* Metadata about the API key used for the request. Included in every response
* whenever a valid API key is provided, even when the response status is not 200.
*/
key_metadata?: UtilityPrefetchResponse.KeyMetadata;
/**
* Success message
*/
message?: string;
/**
* Status of the response, e.g., 'ok'
*/
status?: string;
}
export namespace UtilityPrefetchResponse {
/**
* Metadata about the API key used for the request. Included in every response
* whenever a valid API key is provided, even when the response status is not 200.
*/
export interface KeyMetadata {
/**
* The number of credits consumed by this request.
*/
credits_consumed: number;
/**
* The number of credits remaining for your organization after this request.
*/
credits_remaining: number;
}
}
export interface UtilityPrefetchByEmailResponse {
/**
* The domain that was queued for prefetching
*/
domain?: string;
/**
* Metadata about the API key used for the request. Included in every response
* whenever a valid API key is provided, even when the response status is not 200.
*/
key_metadata?: UtilityPrefetchByEmailResponse.KeyMetadata;
/**
* Success message
*/
message?: string;
/**
* Status of the response, e.g., 'ok'
*/
status?: string;
}
export namespace UtilityPrefetchByEmailResponse {
/**
* Metadata about the API key used for the request. Included in every response
* whenever a valid API key is provided, even when the response status is not 200.
*/
export interface KeyMetadata {
/**
* The number of credits consumed by this request.
*/
credits_consumed: number;
/**
* The number of credits remaining for your organization after this request.
*/
credits_remaining: number;
}
}
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,
};
}