Skip to content

Commit 8f4a870

Browse files
committedJan 30, 2025
feat(api): api update (#3864)
1 parent 3d94ec6 commit 8f4a870

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed
 

‎.stats.yml

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

‎dns/setting.go

+64
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ type SettingEditResponseZoneDefaults struct {
125125
FlattenAllCNAMEs bool `json:"flatten_all_cnames"`
126126
// Whether to enable Foundation DNS Advanced Nameservers on the zone.
127127
FoundationDNS bool `json:"foundation_dns"`
128+
// Settings for this internal zone.
129+
InternalDNS SettingEditResponseZoneDefaultsInternalDNS `json:"internal_dns"`
128130
// Whether to enable multi-provider DNS, which causes Cloudflare to activate the
129131
// zone even when non-Cloudflare NS records exist, and to respect NS records at the
130132
// zone apex during outbound zone transfers.
@@ -148,6 +150,7 @@ type SettingEditResponseZoneDefaults struct {
148150
type settingEditResponseZoneDefaultsJSON struct {
149151
FlattenAllCNAMEs apijson.Field
150152
FoundationDNS apijson.Field
153+
InternalDNS apijson.Field
151154
MultiProvider apijson.Field
152155
Nameservers apijson.Field
153156
NSTTL apijson.Field
@@ -166,6 +169,29 @@ func (r settingEditResponseZoneDefaultsJSON) RawJSON() string {
166169
return r.raw
167170
}
168171

172+
// Settings for this internal zone.
173+
type SettingEditResponseZoneDefaultsInternalDNS struct {
174+
// The ID of the zone to fallback to.
175+
ReferenceZoneID string `json:"reference_zone_id"`
176+
JSON settingEditResponseZoneDefaultsInternalDNSJSON `json:"-"`
177+
}
178+
179+
// settingEditResponseZoneDefaultsInternalDNSJSON contains the JSON metadata for
180+
// the struct [SettingEditResponseZoneDefaultsInternalDNS]
181+
type settingEditResponseZoneDefaultsInternalDNSJSON struct {
182+
ReferenceZoneID apijson.Field
183+
raw string
184+
ExtraFields map[string]apijson.Field
185+
}
186+
187+
func (r *SettingEditResponseZoneDefaultsInternalDNS) UnmarshalJSON(data []byte) (err error) {
188+
return apijson.UnmarshalRoot(data, r)
189+
}
190+
191+
func (r settingEditResponseZoneDefaultsInternalDNSJSON) RawJSON() string {
192+
return r.raw
193+
}
194+
169195
// Settings determining the nameservers through which the zone should be available.
170196
type SettingEditResponseZoneDefaultsNameservers struct {
171197
// Nameserver type
@@ -296,6 +322,8 @@ type SettingGetResponseZoneDefaults struct {
296322
FlattenAllCNAMEs bool `json:"flatten_all_cnames"`
297323
// Whether to enable Foundation DNS Advanced Nameservers on the zone.
298324
FoundationDNS bool `json:"foundation_dns"`
325+
// Settings for this internal zone.
326+
InternalDNS SettingGetResponseZoneDefaultsInternalDNS `json:"internal_dns"`
299327
// Whether to enable multi-provider DNS, which causes Cloudflare to activate the
300328
// zone even when non-Cloudflare NS records exist, and to respect NS records at the
301329
// zone apex during outbound zone transfers.
@@ -319,6 +347,7 @@ type SettingGetResponseZoneDefaults struct {
319347
type settingGetResponseZoneDefaultsJSON struct {
320348
FlattenAllCNAMEs apijson.Field
321349
FoundationDNS apijson.Field
350+
InternalDNS apijson.Field
322351
MultiProvider apijson.Field
323352
Nameservers apijson.Field
324353
NSTTL apijson.Field
@@ -337,6 +366,29 @@ func (r settingGetResponseZoneDefaultsJSON) RawJSON() string {
337366
return r.raw
338367
}
339368

369+
// Settings for this internal zone.
370+
type SettingGetResponseZoneDefaultsInternalDNS struct {
371+
// The ID of the zone to fallback to.
372+
ReferenceZoneID string `json:"reference_zone_id"`
373+
JSON settingGetResponseZoneDefaultsInternalDNSJSON `json:"-"`
374+
}
375+
376+
// settingGetResponseZoneDefaultsInternalDNSJSON contains the JSON metadata for the
377+
// struct [SettingGetResponseZoneDefaultsInternalDNS]
378+
type settingGetResponseZoneDefaultsInternalDNSJSON struct {
379+
ReferenceZoneID apijson.Field
380+
raw string
381+
ExtraFields map[string]apijson.Field
382+
}
383+
384+
func (r *SettingGetResponseZoneDefaultsInternalDNS) UnmarshalJSON(data []byte) (err error) {
385+
return apijson.UnmarshalRoot(data, r)
386+
}
387+
388+
func (r settingGetResponseZoneDefaultsInternalDNSJSON) RawJSON() string {
389+
return r.raw
390+
}
391+
340392
// Settings determining the nameservers through which the zone should be available.
341393
type SettingGetResponseZoneDefaultsNameservers struct {
342394
// Nameserver type
@@ -458,6 +510,8 @@ type SettingEditParamsZoneDefaults struct {
458510
FlattenAllCNAMEs param.Field[bool] `json:"flatten_all_cnames"`
459511
// Whether to enable Foundation DNS Advanced Nameservers on the zone.
460512
FoundationDNS param.Field[bool] `json:"foundation_dns"`
513+
// Settings for this internal zone.
514+
InternalDNS param.Field[SettingEditParamsZoneDefaultsInternalDNS] `json:"internal_dns"`
461515
// Whether to enable multi-provider DNS, which causes Cloudflare to activate the
462516
// zone even when non-Cloudflare NS records exist, and to respect NS records at the
463517
// zone apex during outbound zone transfers.
@@ -479,6 +533,16 @@ func (r SettingEditParamsZoneDefaults) MarshalJSON() (data []byte, err error) {
479533
return apijson.MarshalRoot(r)
480534
}
481535

536+
// Settings for this internal zone.
537+
type SettingEditParamsZoneDefaultsInternalDNS struct {
538+
// The ID of the zone to fallback to.
539+
ReferenceZoneID param.Field[string] `json:"reference_zone_id"`
540+
}
541+
542+
func (r SettingEditParamsZoneDefaultsInternalDNS) MarshalJSON() (data []byte, err error) {
543+
return apijson.MarshalRoot(r)
544+
}
545+
482546
// Settings determining the nameservers through which the zone should be available.
483547
type SettingEditParamsZoneDefaultsNameservers struct {
484548
// Nameserver type

‎dns/setting_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ func TestSettingEditWithOptionalParams(t *testing.T) {
3333
ZoneDefaults: cloudflare.F(dns.SettingEditParamsZoneDefaults{
3434
FlattenAllCNAMEs: cloudflare.F(false),
3535
FoundationDNS: cloudflare.F(false),
36-
MultiProvider: cloudflare.F(false),
36+
InternalDNS: cloudflare.F(dns.SettingEditParamsZoneDefaultsInternalDNS{
37+
ReferenceZoneID: cloudflare.F("reference_zone_id"),
38+
}),
39+
MultiProvider: cloudflare.F(false),
3740
Nameservers: cloudflare.F(dns.SettingEditParamsZoneDefaultsNameservers{
3841
Type: cloudflare.F(dns.SettingEditParamsZoneDefaultsNameserversTypeCloudflareStandard),
3942
}),

0 commit comments

Comments
 (0)
Please sign in to comment.