diff --git a/.stats.yml b/.stats.yml index 330be9e14a..0440ff0afa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1343 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0053e474edb7f838f2b1d38334a7ccb983db09216cca0173a3c3d5401cadcf82.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d780b9eb98465e97c30112eb2c9e586883852508d23a6684bd28e5a9cb7da7a1.yml diff --git a/api.md b/api.md index d04b3c56ce..d51d603e37 100644 --- a/api.md +++ b/api.md @@ -3020,13 +3020,9 @@ Methods: ### Downloads -Types: - -- DownloadGetResponse - Methods: -- client.addressing.loaDocuments.downloads.get(loaDocumentId, { ...params }) -> unknown +- client.addressing.loaDocuments.downloads.get(loaDocumentId, { ...params }) -> Response ## Prefixes diff --git a/src/resources/addressing/address-maps/address-maps.ts b/src/resources/addressing/address-maps/address-maps.ts index 866a465e1d..d4a63db063 100644 --- a/src/resources/addressing/address-maps/address-maps.ts +++ b/src/resources/addressing/address-maps/address-maps.ts @@ -148,6 +148,11 @@ export interface AddressMap { */ export type Kind = 'zone' | 'account'; +/** + * The type of the membership. + */ +export type KindParam = 'zone' | 'account'; + export interface AddressMapCreateResponse { /** * Identifier @@ -222,7 +227,7 @@ export namespace AddressMapCreateResponse { created_at?: string; /** - * Identifier + * The identifier for the membership (eg. a zone or account tag). */ identifier?: string; @@ -309,7 +314,7 @@ export namespace AddressMapGetResponse { created_at?: string; /** - * Identifier + * The identifier for the membership (eg. a zone or account tag). */ identifier?: string; @@ -337,6 +342,31 @@ export interface AddressMapCreateParams { * respond with IP addresses on an Address Map until the map is enabled. */ enabled?: boolean | null; + + /** + * Body param: + */ + ips?: Array; + + /** + * Body param: Zones and Accounts which will be assigned IPs on this Address Map. A + * zone membership will take priority over an account membership. + */ + memberships?: Array; +} + +export namespace AddressMapCreateParams { + export interface Membership { + /** + * The identifier for the membership (eg. a zone or account tag). + */ + identifier?: string; + + /** + * The type of the membership. + */ + kind?: AddressMapsAPI.KindParam; + } } export interface AddressMapListParams { diff --git a/src/resources/addressing/loa-documents/downloads.ts b/src/resources/addressing/loa-documents/downloads.ts index 32c281650e..eba729030e 100644 --- a/src/resources/addressing/loa-documents/downloads.ts +++ b/src/resources/addressing/loa-documents/downloads.ts @@ -2,6 +2,7 @@ import * as Core from '../../../core'; import { APIResource } from '../../../resource'; +import { type Response } from '../../../_shims/index'; import * as DownloadsAPI from './downloads'; export class Downloads extends APIResource { @@ -12,17 +13,15 @@ export class Downloads extends APIResource { loaDocumentId: string | null, params: DownloadGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; - return this._client.get( - `/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, - options, - ); + return this._client.get(`/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, { + ...options, + __binaryResponse: true, + }); } } -export type DownloadGetResponse = unknown; - export interface DownloadGetParams { /** * Identifier @@ -31,6 +30,5 @@ export interface DownloadGetParams { } export namespace Downloads { - export import DownloadGetResponse = DownloadsAPI.DownloadGetResponse; export import DownloadGetParams = DownloadsAPI.DownloadGetParams; } diff --git a/src/resources/addressing/loa-documents/index.ts b/src/resources/addressing/loa-documents/index.ts index 70f333d35d..40c4791998 100644 --- a/src/resources/addressing/loa-documents/index.ts +++ b/src/resources/addressing/loa-documents/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DownloadGetResponse, DownloadGetParams, Downloads } from './downloads'; +export { DownloadGetParams, Downloads } from './downloads'; export { LOADocumentCreateResponse, LOADocumentCreateParams, LOADocuments } from './loa-documents'; diff --git a/src/resources/addressing/loa-documents/loa-documents.ts b/src/resources/addressing/loa-documents/loa-documents.ts index 0112ff9578..c4aa3c8ef4 100644 --- a/src/resources/addressing/loa-documents/loa-documents.ts +++ b/src/resources/addressing/loa-documents/loa-documents.ts @@ -49,6 +49,5 @@ export namespace LOADocuments { export import LOADocumentCreateResponse = LOADocumentsAPI.LOADocumentCreateResponse; export import LOADocumentCreateParams = LOADocumentsAPI.LOADocumentCreateParams; export import Downloads = DownloadsAPI.Downloads; - export import DownloadGetResponse = DownloadsAPI.DownloadGetResponse; export import DownloadGetParams = DownloadsAPI.DownloadGetParams; } diff --git a/tests/api-resources/addressing/address-maps/address-maps.test.ts b/tests/api-resources/addressing/address-maps/address-maps.test.ts index 1234cde27a..404c5b613a 100644 --- a/tests/api-resources/addressing/address-maps/address-maps.test.ts +++ b/tests/api-resources/addressing/address-maps/address-maps.test.ts @@ -28,6 +28,12 @@ describe('resource addressMaps', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', description: 'My Ecommerce zones', enabled: true, + ips: ['192.0.2.1', '192.0.2.1', '192.0.2.1'], + memberships: [ + { identifier: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'zone' }, + { identifier: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'zone' }, + { identifier: '023e105f4ecef8ad9ca31a8372d0c353', kind: 'zone' }, + ], }); }); diff --git a/tests/api-resources/addressing/loa-documents/downloads.test.ts b/tests/api-resources/addressing/loa-documents/downloads.test.ts index 1790763377..6ad26ae05a 100644 --- a/tests/api-resources/addressing/loa-documents/downloads.test.ts +++ b/tests/api-resources/addressing/loa-documents/downloads.test.ts @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', @@ -10,20 +9,6 @@ const cloudflare = new Cloudflare({ }); describe('resource downloads', () => { - test('get: only required params', async () => { - const responsePromise = cloudflare.addressing.loaDocuments.downloads.get( - 'd933b1530bc56c9953cf8ce166da8004', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - test('get: required and optional params', async () => { const response = await cloudflare.addressing.loaDocuments.downloads.get( 'd933b1530bc56c9953cf8ce166da8004',