Skip to content

Commit 01274e2

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#841)
1 parent 59bd980 commit 01274e2

File tree

8 files changed

+47
-33
lines changed

8 files changed

+47
-33
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1343
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0053e474edb7f838f2b1d38334a7ccb983db09216cca0173a3c3d5401cadcf82.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d780b9eb98465e97c30112eb2c9e586883852508d23a6684bd28e5a9cb7da7a1.yml

api.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -3020,13 +3020,9 @@ Methods:
30203020

30213021
### Downloads
30223022

3023-
Types:
3024-
3025-
- <code><a href="./src/resources/addressing/loa-documents/downloads.ts">DownloadGetResponse</a></code>
3026-
30273023
Methods:
30283024

3029-
- <code title="get /accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download">client.addressing.loaDocuments.downloads.<a href="./src/resources/addressing/loa-documents/downloads.ts">get</a>(loaDocumentId, { ...params }) -> unknown</code>
3025+
- <code title="get /accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download">client.addressing.loaDocuments.downloads.<a href="./src/resources/addressing/loa-documents/downloads.ts">get</a>(loaDocumentId, { ...params }) -> Response</code>
30303026

30313027
## Prefixes
30323028

src/resources/addressing/address-maps/address-maps.ts

+32-2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ export interface AddressMap {
148148
*/
149149
export type Kind = 'zone' | 'account';
150150

151+
/**
152+
* The type of the membership.
153+
*/
154+
export type KindParam = 'zone' | 'account';
155+
151156
export interface AddressMapCreateResponse {
152157
/**
153158
* Identifier
@@ -222,7 +227,7 @@ export namespace AddressMapCreateResponse {
222227
created_at?: string;
223228

224229
/**
225-
* Identifier
230+
* The identifier for the membership (eg. a zone or account tag).
226231
*/
227232
identifier?: string;
228233

@@ -309,7 +314,7 @@ export namespace AddressMapGetResponse {
309314
created_at?: string;
310315

311316
/**
312-
* Identifier
317+
* The identifier for the membership (eg. a zone or account tag).
313318
*/
314319
identifier?: string;
315320

@@ -337,6 +342,31 @@ export interface AddressMapCreateParams {
337342
* respond with IP addresses on an Address Map until the map is enabled.
338343
*/
339344
enabled?: boolean | null;
345+
346+
/**
347+
* Body param:
348+
*/
349+
ips?: Array<string>;
350+
351+
/**
352+
* Body param: Zones and Accounts which will be assigned IPs on this Address Map. A
353+
* zone membership will take priority over an account membership.
354+
*/
355+
memberships?: Array<AddressMapCreateParams.Membership>;
356+
}
357+
358+
export namespace AddressMapCreateParams {
359+
export interface Membership {
360+
/**
361+
* The identifier for the membership (eg. a zone or account tag).
362+
*/
363+
identifier?: string;
364+
365+
/**
366+
* The type of the membership.
367+
*/
368+
kind?: AddressMapsAPI.KindParam;
369+
}
340370
}
341371

342372
export interface AddressMapListParams {

src/resources/addressing/loa-documents/downloads.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import * as Core from '../../../core';
44
import { APIResource } from '../../../resource';
5+
import { type Response } from '../../../_shims/index';
56
import * as DownloadsAPI from './downloads';
67

78
export class Downloads extends APIResource {
@@ -12,17 +13,15 @@ export class Downloads extends APIResource {
1213
loaDocumentId: string | null,
1314
params: DownloadGetParams,
1415
options?: Core.RequestOptions,
15-
): Core.APIPromise<unknown> {
16+
): Core.APIPromise<Response> {
1617
const { account_id } = params;
17-
return this._client.get(
18-
`/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`,
19-
options,
20-
);
18+
return this._client.get(`/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, {
19+
...options,
20+
__binaryResponse: true,
21+
});
2122
}
2223
}
2324

24-
export type DownloadGetResponse = unknown;
25-
2625
export interface DownloadGetParams {
2726
/**
2827
* Identifier
@@ -31,6 +30,5 @@ export interface DownloadGetParams {
3130
}
3231

3332
export namespace Downloads {
34-
export import DownloadGetResponse = DownloadsAPI.DownloadGetResponse;
3533
export import DownloadGetParams = DownloadsAPI.DownloadGetParams;
3634
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export { DownloadGetResponse, DownloadGetParams, Downloads } from './downloads';
3+
export { DownloadGetParams, Downloads } from './downloads';
44
export { LOADocumentCreateResponse, LOADocumentCreateParams, LOADocuments } from './loa-documents';

src/resources/addressing/loa-documents/loa-documents.ts

-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,5 @@ export namespace LOADocuments {
4949
export import LOADocumentCreateResponse = LOADocumentsAPI.LOADocumentCreateResponse;
5050
export import LOADocumentCreateParams = LOADocumentsAPI.LOADocumentCreateParams;
5151
export import Downloads = DownloadsAPI.Downloads;
52-
export import DownloadGetResponse = DownloadsAPI.DownloadGetResponse;
5352
export import DownloadGetParams = DownloadsAPI.DownloadGetParams;
5453
}

tests/api-resources/addressing/address-maps/address-maps.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ describe('resource addressMaps', () => {
2828
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
2929
description: 'My Ecommerce zones',
3030
enabled: true,
31+
ips: ['192.0.2.1', '192.0.2.1', '192.0.2.1'],
32+
memberships: [
33+
{ identifier: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'zone' },
34+
{ identifier: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'zone' },
35+
{ identifier: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'zone' },
36+
],
3137
});
3238
});
3339

tests/api-resources/addressing/loa-documents/downloads.test.ts

-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import Cloudflare from 'cloudflare';
4-
import { Response } from 'node-fetch';
54

65
const cloudflare = new Cloudflare({
76
apiKey: '144c9defac04969c7bfad8efaa8ea194',
@@ -10,20 +9,6 @@ const cloudflare = new Cloudflare({
109
});
1110

1211
describe('resource downloads', () => {
13-
test('get: only required params', async () => {
14-
const responsePromise = cloudflare.addressing.loaDocuments.downloads.get(
15-
'd933b1530bc56c9953cf8ce166da8004',
16-
{ account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
17-
);
18-
const rawResponse = await responsePromise.asResponse();
19-
expect(rawResponse).toBeInstanceOf(Response);
20-
const response = await responsePromise;
21-
expect(response).not.toBeInstanceOf(Response);
22-
const dataAndResponse = await responsePromise.withResponse();
23-
expect(dataAndResponse.data).toBe(response);
24-
expect(dataAndResponse.response).toBe(rawResponse);
25-
});
26-
2712
test('get: required and optional params', async () => {
2813
const response = await cloudflare.addressing.loaDocuments.downloads.get(
2914
'd933b1530bc56c9953cf8ce166da8004',

0 commit comments

Comments
 (0)