Skip to content

Commit 12127fa

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#455)
1 parent 3550554 commit 12127fa

File tree

6 files changed

+246
-4
lines changed

6 files changed

+246
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1267
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6229bf7c4bed6b9026088be8817d3c8111576b2d12ff5220d193f479f230e449.yml
1+
configured_endpoints: 1268
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7a581c61bc42c6e3e48c58c941255dca8f4b7b2e5aafd402a61c6438c2830071.yml

api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3143,6 +3143,11 @@ Methods:
31433143
Types:
31443144

31453145
- <code><a href="./src/resources/intel/whois.ts">Whois</a></code>
3146+
- <code><a href="./src/resources/intel/whois.ts">WhoisGetResponse</a></code>
3147+
3148+
Methods:
3149+
3150+
- <code title="get /accounts/{account_id}/intel/whois">client.intel.whois.<a href="./src/resources/intel/whois.ts">get</a>({ ...params }) -> WhoisGetResponse</code>
31463151

31473152
## IndicatorFeeds
31483153

src/resources/intel/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ export {
3333
Miscategorizations,
3434
} from './miscategorizations';
3535
export { Sinkhole, SinkholeListParams, SinkholesSinglePage, Sinkholes } from './sinkholes';
36-
export { Whois } from './whois';
36+
export { Whois, WhoisGetResponse, WhoisGetParams } from './whois';

src/resources/intel/intel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export namespace Intel {
5858
export import MiscategorizationCreateResponse = MiscategorizationsAPI.MiscategorizationCreateResponse;
5959
export import MiscategorizationCreateParams = MiscategorizationsAPI.MiscategorizationCreateParams;
6060
export import Whois = WhoisAPI.Whois;
61+
export import WhoisGetResponse = WhoisAPI.WhoisGetResponse;
62+
export import WhoisGetParams = WhoisAPI.WhoisGetParams;
6163
export import IndicatorFeeds = IndicatorFeedsAPI.IndicatorFeeds;
6264
export import IndicatorFeedCreateResponse = IndicatorFeedsAPI.IndicatorFeedCreateResponse;
6365
export import IndicatorFeedUpdateResponse = IndicatorFeedsAPI.IndicatorFeedUpdateResponse;

src/resources/intel/whois.ts

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import * as Core from 'cloudflare/core';
34
import { APIResource } from 'cloudflare/resource';
45
import * as WhoisAPI from 'cloudflare/resources/intel/whois';
56

6-
export class Whois extends APIResource {}
7+
export class Whois extends APIResource {
8+
/**
9+
* Get WHOIS Record
10+
*/
11+
get(params: WhoisGetParams, options?: Core.RequestOptions): Core.APIPromise<WhoisGetResponse> {
12+
const { account_id, ...query } = params;
13+
return (
14+
this._client.get(`/accounts/${account_id}/intel/whois`, { query, ...options }) as Core.APIPromise<{
15+
result: WhoisGetResponse;
16+
}>
17+
)._thenUnwrap((obj) => obj.result);
18+
}
19+
}
720

821
export interface Whois {
922
created_date?: string;
@@ -25,6 +38,198 @@ export interface Whois {
2538
updated_date?: string;
2639
}
2740

41+
export interface WhoisGetResponse {
42+
dnnsec: unknown;
43+
44+
domain: string;
45+
46+
extension: string;
47+
48+
found: boolean;
49+
50+
nameservers: Array<string>;
51+
52+
punycode: string;
53+
54+
registrant: string;
55+
56+
registrar: string;
57+
58+
id?: string;
59+
60+
administrative_city?: string;
61+
62+
administrative_country?: string;
63+
64+
administrative_email?: string;
65+
66+
administrative_fax?: string;
67+
68+
administrative_fax_ext?: string;
69+
70+
administrative_id?: string;
71+
72+
administrative_name?: string;
73+
74+
administrative_org?: string;
75+
76+
administrative_phone?: string;
77+
78+
administrative_phone_ext?: string;
79+
80+
administrative_postal_code?: string;
81+
82+
administrative_province?: string;
83+
84+
administrative_referral_url?: string;
85+
86+
administrative_street?: string;
87+
88+
billing_city?: string;
89+
90+
billing_country?: string;
91+
92+
billing_email?: string;
93+
94+
billing_fax?: string;
95+
96+
billing_fax_ext?: string;
97+
98+
billing_id?: string;
99+
100+
billing_name?: string;
101+
102+
billing_org?: string;
103+
104+
billing_phone?: string;
105+
106+
billing_phone_ext?: string;
107+
108+
billing_postal_code?: string;
109+
110+
billing_province?: string;
111+
112+
billing_referral_url?: string;
113+
114+
billing_street?: string;
115+
116+
created_date?: string;
117+
118+
created_date_raw?: string;
119+
120+
dnssec?: boolean;
121+
122+
expiration_date?: string;
123+
124+
expiration_date_raw?: string;
125+
126+
registrant_city?: string;
127+
128+
registrant_country?: string;
129+
130+
registrant_email?: string;
131+
132+
registrant_fax?: string;
133+
134+
registrant_fax_ext?: string;
135+
136+
registrant_id?: string;
137+
138+
registrant_name?: string;
139+
140+
registrant_org?: string;
141+
142+
registrant_phone?: string;
143+
144+
registrant_phone_ext?: string;
145+
146+
registrant_postal_code?: string;
147+
148+
registrant_province?: string;
149+
150+
registrant_referral_url?: string;
151+
152+
registrant_street?: string;
153+
154+
registrar_city?: string;
155+
156+
registrar_country?: string;
157+
158+
registrar_email?: string;
159+
160+
registrar_fax?: string;
161+
162+
registrar_fax_ext?: string;
163+
164+
registrar_id?: string;
165+
166+
registrar_name?: string;
167+
168+
registrar_org?: string;
169+
170+
registrar_phone?: string;
171+
172+
registrar_phone_ext?: string;
173+
174+
registrar_postal_code?: string;
175+
176+
registrar_province?: string;
177+
178+
registrar_referral_url?: string;
179+
180+
registrar_street?: string;
181+
182+
status?: Array<string>;
183+
184+
technical_city?: string;
185+
186+
technical_country?: string;
187+
188+
technical_email?: string;
189+
190+
technical_fax?: string;
191+
192+
technical_fax_ext?: string;
193+
194+
technical_id?: string;
195+
196+
technical_name?: string;
197+
198+
technical_org?: string;
199+
200+
technical_phone?: string;
201+
202+
technical_phone_ext?: string;
203+
204+
technical_postal_code?: string;
205+
206+
technical_province?: string;
207+
208+
technical_referral_url?: string;
209+
210+
technical_street?: string;
211+
212+
updated_date?: string;
213+
214+
updated_date_raw?: string;
215+
216+
whois_server?: string;
217+
}
218+
219+
export interface WhoisGetParams {
220+
/**
221+
* Path param: Identifier
222+
*/
223+
account_id: string;
224+
225+
/**
226+
* Query param:
227+
*/
228+
domain?: string;
229+
}
230+
28231
export namespace Whois {
29232
export import Whois = WhoisAPI.Whois;
233+
export import WhoisGetResponse = WhoisAPI.WhoisGetResponse;
234+
export import WhoisGetParams = WhoisAPI.WhoisGetParams;
30235
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import Cloudflare from 'cloudflare';
4+
import { Response } from 'node-fetch';
5+
6+
const cloudflare = new Cloudflare({
7+
apiKey: '144c9defac04969c7bfad8efaa8ea194',
8+
apiEmail: '[email protected]',
9+
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
10+
});
11+
12+
describe('resource whois', () => {
13+
test('get: only required params', async () => {
14+
const responsePromise = cloudflare.intel.whois.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' });
15+
const rawResponse = await responsePromise.asResponse();
16+
expect(rawResponse).toBeInstanceOf(Response);
17+
const response = await responsePromise;
18+
expect(response).not.toBeInstanceOf(Response);
19+
const dataAndResponse = await responsePromise.withResponse();
20+
expect(dataAndResponse.data).toBe(response);
21+
expect(dataAndResponse.response).toBe(rawResponse);
22+
});
23+
24+
test('get: required and optional params', async () => {
25+
const response = await cloudflare.intel.whois.get({
26+
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
27+
domain: 'string',
28+
});
29+
});
30+
});

0 commit comments

Comments
 (0)