From 9a723ce1ed9f94146df96f82541c61ca458f8736 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:30:01 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#977) --- .stats.yml | 2 +- src/resources/dns/records.ts | 741 +++++++++++++++++++++--- tests/api-resources/dns/records.test.ts | 18 +- 3 files changed, 684 insertions(+), 77 deletions(-) diff --git a/.stats.yml b/.stats.yml index f05782e4a7..334f00871c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1348 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b6aad108d9bd74ab205190cdefd1d4e7db82406d40095750346b1871e8b1619b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dcc737ab91fdd1e0edc18214494d806b12d41df4d4641e26e718c8b9dced1dc.yml diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 39a7d061c9..2679f19b50 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -19,11 +19,12 @@ export class Records extends APIResource { * were used when creating the record. */ create(params: RecordCreateParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id, ...body } = params; + const { path_zone_id, body_zone_id, ...body } = params; return ( - this._client.post(`/zones/${zone_id}/dns_records`, { body, ...options }) as Core.APIPromise<{ - result: Record; - }> + this._client.post(`/zones/${path_zone_id}/dns_records`, { + body: { zone_id: body_zone_id, ...body }, + ...options, + }) as Core.APIPromise<{ result: Record }> )._thenUnwrap((obj) => obj.result); } @@ -40,10 +41,10 @@ export class Records extends APIResource { params: RecordUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { zone_id, ...body } = params; + const { path_zone_id, body_zone_id, ...body } = params; return ( - this._client.put(`/zones/${zone_id}/dns_records/${dnsRecordId}`, { - body, + this._client.put(`/zones/${path_zone_id}/dns_records/${dnsRecordId}`, { + body: { zone_id: body_zone_id, ...body }, ...options, }) as Core.APIPromise<{ result: Record }> )._thenUnwrap((obj) => obj.result); @@ -92,10 +93,10 @@ export class Records extends APIResource { params: RecordEditParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { zone_id, ...body } = params; + const { path_zone_id, body_zone_id, ...body } = params; return ( - this._client.patch(`/zones/${zone_id}/dns_records/${dnsRecordId}`, { - body, + this._client.patch(`/zones/${path_zone_id}/dns_records/${dnsRecordId}`, { + body: { zone_id: body_zone_id, ...body }, ...options, }) as Core.APIPromise<{ result: Record }> )._thenUnwrap((obj) => obj.result); @@ -2321,7 +2322,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid IPv4 address. @@ -2338,6 +2339,11 @@ export namespace RecordCreateParams { */ type: 'A'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2362,13 +2368,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface AAAARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid IPv6 address. @@ -2385,6 +2396,11 @@ export namespace RecordCreateParams { */ type: 'AAAA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2409,13 +2425,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface CAARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a CAA record. @@ -2432,6 +2453,11 @@ export namespace RecordCreateParams { */ type: 'CAA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2450,6 +2476,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace CAARecord { @@ -2478,7 +2509,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a CERT record. @@ -2495,6 +2526,11 @@ export namespace RecordCreateParams { */ type: 'CERT'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2513,6 +2549,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace CERTRecord { @@ -2546,7 +2587,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid hostname. Must not match the record's name. @@ -2563,6 +2604,11 @@ export namespace RecordCreateParams { */ type: 'CNAME'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2587,13 +2633,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface DNSKEYRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a DNSKEY record. @@ -2610,6 +2661,11 @@ export namespace RecordCreateParams { */ type: 'DNSKEY'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2628,6 +2684,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace DNSKEYRecord { @@ -2661,7 +2722,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a DS record. @@ -2678,6 +2739,11 @@ export namespace RecordCreateParams { */ type: 'DS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2696,6 +2762,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace DSRecord { @@ -2729,7 +2800,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a HTTPS record. @@ -2746,6 +2817,11 @@ export namespace RecordCreateParams { */ type: 'HTTPS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2764,6 +2840,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace HTTPSRecord { @@ -2792,7 +2873,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a LOC record. @@ -2809,6 +2890,11 @@ export namespace RecordCreateParams { */ type: 'LOC'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2827,6 +2913,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace LOCRecord { @@ -2900,7 +2991,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid mail server hostname. @@ -2923,6 +3014,11 @@ export namespace RecordCreateParams { */ type: 'MX'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2941,13 +3037,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface NAPTRRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a NAPTR record. @@ -2964,6 +3065,11 @@ export namespace RecordCreateParams { */ type: 'NAPTR'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -2982,6 +3088,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace NAPTRRecord { @@ -3025,7 +3136,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid name server host name. @@ -3042,6 +3153,11 @@ export namespace RecordCreateParams { */ type: 'NS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3060,13 +3176,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface PTRRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Domain name pointing to the address. @@ -3083,6 +3204,11 @@ export namespace RecordCreateParams { */ type: 'PTR'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3101,13 +3227,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface SMIMEARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SMIMEA record. @@ -3124,6 +3255,11 @@ export namespace RecordCreateParams { */ type: 'SMIMEA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3142,6 +3278,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SMIMEARecord { @@ -3175,7 +3316,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SRV record. @@ -3194,6 +3335,11 @@ export namespace RecordCreateParams { */ type: 'SRV'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3212,6 +3358,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SRVRecord { @@ -3267,7 +3418,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SSHFP record. @@ -3284,6 +3435,11 @@ export namespace RecordCreateParams { */ type: 'SSHFP'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3302,6 +3458,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SSHFPRecord { @@ -3330,7 +3491,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SVCB record. @@ -3347,6 +3508,11 @@ export namespace RecordCreateParams { */ type: 'SVCB'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3365,6 +3531,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SVCBRecord { @@ -3393,7 +3564,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a TLSA record. @@ -3410,6 +3581,11 @@ export namespace RecordCreateParams { */ type: 'TLSA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3428,6 +3604,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace TLSARecord { @@ -3461,7 +3642,7 @@ export namespace RecordCreateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Text content for the record. @@ -3478,6 +3659,11 @@ export namespace RecordCreateParams { */ type: 'TXT'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3496,13 +3682,18 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface URIRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a URI record. @@ -3525,6 +3716,11 @@ export namespace RecordCreateParams { */ type: 'URI'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3543,6 +3739,11 @@ export namespace RecordCreateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace URIRecord { @@ -3590,7 +3791,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid IPv4 address. @@ -3607,6 +3808,11 @@ export namespace RecordUpdateParams { */ type: 'A'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3631,13 +3837,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface AAAARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid IPv6 address. @@ -3654,6 +3865,11 @@ export namespace RecordUpdateParams { */ type: 'AAAA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3678,13 +3894,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface CAARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a CAA record. @@ -3701,6 +3922,11 @@ export namespace RecordUpdateParams { */ type: 'CAA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3719,6 +3945,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace CAARecord { @@ -3747,7 +3978,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a CERT record. @@ -3764,6 +3995,11 @@ export namespace RecordUpdateParams { */ type: 'CERT'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3782,6 +4018,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace CERTRecord { @@ -3815,7 +4056,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid hostname. Must not match the record's name. @@ -3832,6 +4073,11 @@ export namespace RecordUpdateParams { */ type: 'CNAME'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3856,13 +4102,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface DNSKEYRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a DNSKEY record. @@ -3879,6 +4130,11 @@ export namespace RecordUpdateParams { */ type: 'DNSKEY'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3897,6 +4153,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace DNSKEYRecord { @@ -3930,7 +4191,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a DS record. @@ -3947,6 +4208,11 @@ export namespace RecordUpdateParams { */ type: 'DS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -3965,6 +4231,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace DSRecord { @@ -3998,7 +4269,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a HTTPS record. @@ -4015,6 +4286,11 @@ export namespace RecordUpdateParams { */ type: 'HTTPS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4033,6 +4309,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace HTTPSRecord { @@ -4061,7 +4342,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a LOC record. @@ -4078,6 +4359,11 @@ export namespace RecordUpdateParams { */ type: 'LOC'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4096,6 +4382,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace LOCRecord { @@ -4169,7 +4460,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid mail server hostname. @@ -4192,6 +4483,11 @@ export namespace RecordUpdateParams { */ type: 'MX'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4210,13 +4506,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface NAPTRRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a NAPTR record. @@ -4233,6 +4534,11 @@ export namespace RecordUpdateParams { */ type: 'NAPTR'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4251,6 +4557,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace NAPTRRecord { @@ -4294,7 +4605,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid name server host name. @@ -4311,6 +4622,11 @@ export namespace RecordUpdateParams { */ type: 'NS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4329,13 +4645,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface PTRRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Domain name pointing to the address. @@ -4352,6 +4673,11 @@ export namespace RecordUpdateParams { */ type: 'PTR'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4370,13 +4696,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface SMIMEARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SMIMEA record. @@ -4393,6 +4724,11 @@ export namespace RecordUpdateParams { */ type: 'SMIMEA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4411,6 +4747,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SMIMEARecord { @@ -4444,7 +4785,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SRV record. @@ -4463,6 +4804,11 @@ export namespace RecordUpdateParams { */ type: 'SRV'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4481,6 +4827,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SRVRecord { @@ -4536,7 +4887,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SSHFP record. @@ -4553,6 +4904,11 @@ export namespace RecordUpdateParams { */ type: 'SSHFP'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4571,6 +4927,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SSHFPRecord { @@ -4599,7 +4960,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SVCB record. @@ -4616,6 +4977,11 @@ export namespace RecordUpdateParams { */ type: 'SVCB'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4634,6 +5000,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SVCBRecord { @@ -4662,7 +5033,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a TLSA record. @@ -4679,6 +5050,11 @@ export namespace RecordUpdateParams { */ type: 'TLSA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4697,6 +5073,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace TLSARecord { @@ -4730,7 +5111,7 @@ export namespace RecordUpdateParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Text content for the record. @@ -4747,6 +5128,11 @@ export namespace RecordUpdateParams { */ type: 'TXT'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4765,13 +5151,18 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface URIRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a URI record. @@ -4794,6 +5185,11 @@ export namespace RecordUpdateParams { */ type: 'URI'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -4812,6 +5208,11 @@ export namespace RecordUpdateParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace URIRecord { @@ -5036,7 +5437,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid IPv4 address. @@ -5053,6 +5454,11 @@ export namespace RecordEditParams { */ type: 'A'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5077,13 +5483,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface AAAARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid IPv6 address. @@ -5100,6 +5511,11 @@ export namespace RecordEditParams { */ type: 'AAAA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5124,13 +5540,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface CAARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a CAA record. @@ -5147,6 +5568,11 @@ export namespace RecordEditParams { */ type: 'CAA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5165,6 +5591,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace CAARecord { @@ -5193,7 +5624,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a CERT record. @@ -5210,6 +5641,11 @@ export namespace RecordEditParams { */ type: 'CERT'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5228,6 +5664,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace CERTRecord { @@ -5261,7 +5702,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid hostname. Must not match the record's name. @@ -5278,6 +5719,11 @@ export namespace RecordEditParams { */ type: 'CNAME'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5302,13 +5748,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface DNSKEYRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a DNSKEY record. @@ -5325,6 +5776,11 @@ export namespace RecordEditParams { */ type: 'DNSKEY'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5343,6 +5799,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace DNSKEYRecord { @@ -5376,7 +5837,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a DS record. @@ -5393,6 +5854,11 @@ export namespace RecordEditParams { */ type: 'DS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5411,6 +5877,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace DSRecord { @@ -5444,7 +5915,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a HTTPS record. @@ -5461,6 +5932,11 @@ export namespace RecordEditParams { */ type: 'HTTPS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5479,6 +5955,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace HTTPSRecord { @@ -5507,7 +5988,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a LOC record. @@ -5524,6 +6005,11 @@ export namespace RecordEditParams { */ type: 'LOC'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5542,6 +6028,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace LOCRecord { @@ -5615,7 +6106,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid mail server hostname. @@ -5638,6 +6129,11 @@ export namespace RecordEditParams { */ type: 'MX'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5656,13 +6152,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface NAPTRRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a NAPTR record. @@ -5679,6 +6180,11 @@ export namespace RecordEditParams { */ type: 'NAPTR'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5697,6 +6203,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace NAPTRRecord { @@ -5740,7 +6251,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: A valid name server host name. @@ -5757,6 +6268,11 @@ export namespace RecordEditParams { */ type: 'NS'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5775,13 +6291,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface PTRRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Domain name pointing to the address. @@ -5798,6 +6319,11 @@ export namespace RecordEditParams { */ type: 'PTR'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5816,13 +6342,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface SMIMEARecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SMIMEA record. @@ -5839,6 +6370,11 @@ export namespace RecordEditParams { */ type: 'SMIMEA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5857,6 +6393,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SMIMEARecord { @@ -5890,7 +6431,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SRV record. @@ -5909,6 +6450,11 @@ export namespace RecordEditParams { */ type: 'SRV'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -5927,6 +6473,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SRVRecord { @@ -5982,7 +6533,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SSHFP record. @@ -5999,6 +6550,11 @@ export namespace RecordEditParams { */ type: 'SSHFP'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -6017,6 +6573,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SSHFPRecord { @@ -6045,7 +6606,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a SVCB record. @@ -6062,6 +6623,11 @@ export namespace RecordEditParams { */ type: 'SVCB'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -6080,6 +6646,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace SVCBRecord { @@ -6108,7 +6679,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a TLSA record. @@ -6125,6 +6696,11 @@ export namespace RecordEditParams { */ type: 'TLSA'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -6143,6 +6719,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace TLSARecord { @@ -6176,7 +6757,7 @@ export namespace RecordEditParams { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Text content for the record. @@ -6193,6 +6774,11 @@ export namespace RecordEditParams { */ type: 'TXT'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -6211,13 +6797,18 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export interface URIRecord { /** * Path param: Identifier */ - zone_id: string; + path_zone_id: string; /** * Body param: Components of a URI record. @@ -6240,6 +6831,11 @@ export namespace RecordEditParams { */ type: 'URI'; + /** + * Body param: Identifier + */ + id?: string; + /** * Body param: Comments or notes about the DNS record. This field has no effect on * DNS responses. @@ -6258,6 +6854,11 @@ export namespace RecordEditParams { * for Enterprise zones. */ ttl?: TTLParam; + + /** + * Body param: Identifier + */ + body_zone_id?: string; } export namespace URIRecord { diff --git a/tests/api-resources/dns/records.test.ts b/tests/api-resources/dns/records.test.ts index e261eeeb86..2c0d00aaa1 100644 --- a/tests/api-resources/dns/records.test.ts +++ b/tests/api-resources/dns/records.test.ts @@ -13,7 +13,7 @@ describe('resource records', () => { // TODO: investigate broken test test.skip('create: only required params', async () => { const responsePromise = cloudflare.dns.records.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + path_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', content: '198.51.100.4', name: 'example.com', type: 'A', @@ -30,21 +30,23 @@ describe('resource records', () => { // TODO: investigate broken test test.skip('create: required and optional params', async () => { const response = await cloudflare.dns.records.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + path_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', content: '198.51.100.4', name: 'example.com', type: 'A', + id: '023e105f4ecef8ad9ca31a8372d0c353', comment: 'Domain verification record', proxied: false, tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], ttl: 3600, + body_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // TODO: investigate broken test test.skip('update: only required params', async () => { const responsePromise = cloudflare.dns.records.update('023e105f4ecef8ad9ca31a8372d0c353', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + path_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', content: '198.51.100.4', name: 'example.com', type: 'A', @@ -61,14 +63,16 @@ describe('resource records', () => { // TODO: investigate broken test test.skip('update: required and optional params', async () => { const response = await cloudflare.dns.records.update('023e105f4ecef8ad9ca31a8372d0c353', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + path_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', content: '198.51.100.4', name: 'example.com', type: 'A', + id: '023e105f4ecef8ad9ca31a8372d0c353', comment: 'Domain verification record', proxied: false, tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], ttl: 3600, + body_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); @@ -138,7 +142,7 @@ describe('resource records', () => { // TODO: investigate broken test test.skip('edit: only required params', async () => { const responsePromise = cloudflare.dns.records.edit('023e105f4ecef8ad9ca31a8372d0c353', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + path_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', content: '198.51.100.4', name: 'example.com', type: 'A', @@ -155,14 +159,16 @@ describe('resource records', () => { // TODO: investigate broken test test.skip('edit: required and optional params', async () => { const response = await cloudflare.dns.records.edit('023e105f4ecef8ad9ca31a8372d0c353', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + path_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', content: '198.51.100.4', name: 'example.com', type: 'A', + id: '023e105f4ecef8ad9ca31a8372d0c353', comment: 'Domain verification record', proxied: false, tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], ttl: 3600, + body_zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); });