Skip to content

Commit de93533

Browse files
committedJan 30, 2025
feat: support deprecated markers (#3850)
1 parent 5af08cf commit de93533

23 files changed

+237
-98
lines changed
 

‎accounts/account.go

+8
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ type AccountSettings struct {
184184
//
185185
// Deprecated in favor of
186186
// [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
187+
//
188+
// Deprecated: deprecated
187189
DefaultNameservers AccountSettingsDefaultNameservers `json:"default_nameservers"`
188190
// Indicates whether membership in this account requires that Two-Factor
189191
// Authentication is enabled
@@ -193,6 +195,8 @@ type AccountSettings struct {
193195
//
194196
// Deprecated in favor of
195197
// [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
198+
//
199+
// Deprecated: deprecated
196200
UseAccountCustomNSByDefault bool `json:"use_account_custom_ns_by_default"`
197201
JSON accountSettingsJSON `json:"-"`
198202
}
@@ -272,6 +276,8 @@ type AccountSettingsParam struct {
272276
//
273277
// Deprecated in favor of
274278
// [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
279+
//
280+
// Deprecated: deprecated
275281
DefaultNameservers param.Field[AccountSettingsDefaultNameservers] `json:"default_nameservers"`
276282
// Indicates whether membership in this account requires that Two-Factor
277283
// Authentication is enabled
@@ -281,6 +287,8 @@ type AccountSettingsParam struct {
281287
//
282288
// Deprecated in favor of
283289
// [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
290+
//
291+
// Deprecated: deprecated
284292
UseAccountCustomNSByDefault param.Field[bool] `json:"use_account_custom_ns_by_default"`
285293
}
286294

‎client.go

+37-29
Original file line numberDiff line numberDiff line change
@@ -101,35 +101,43 @@ import (
101101
// interacting with the cloudflare API. You should not instantiate this client
102102
// directly, and instead use the [NewClient] method instead.
103103
type Client struct {
104-
Options []option.RequestOption
105-
Accounts *accounts.AccountService
106-
OriginCACertificates *origin_ca_certificates.OriginCACertificateService
107-
IPs *ips.IPService
108-
Memberships *memberships.MembershipService
109-
User *user.UserService
110-
Zones *zones.ZoneService
111-
LoadBalancers *load_balancers.LoadBalancerService
112-
Cache *cache.CacheService
113-
SSL *ssl.SSLService
114-
ACM *acm.ACMService
115-
Argo *argo.ArgoService
116-
CertificateAuthorities *certificate_authorities.CertificateAuthorityService
117-
ClientCertificates *client_certificates.ClientCertificateService
118-
CustomCertificates *custom_certificates.CustomCertificateService
119-
CustomHostnames *custom_hostnames.CustomHostnameService
120-
CustomNameservers *custom_nameservers.CustomNameserverService
121-
DNSFirewall *dns_firewall.DNSFirewallService
122-
DNS *dns.DNSService
123-
EmailSecurity *email_security.EmailSecurityService
124-
EmailRouting *email_routing.EmailRoutingService
125-
Filters *filters.FilterService
126-
Firewall *firewall.FirewallService
127-
Healthchecks *healthchecks.HealthcheckService
128-
KeylessCertificates *keyless_certificates.KeylessCertificateService
129-
Logpush *logpush.LogpushService
130-
Logs *logs.LogService
131-
OriginTLSClientAuth *origin_tls_client_auth.OriginTLSClientAuthService
132-
PageRules *page_rules.PageRuleService
104+
Options []option.RequestOption
105+
Accounts *accounts.AccountService
106+
OriginCACertificates *origin_ca_certificates.OriginCACertificateService
107+
IPs *ips.IPService
108+
Memberships *memberships.MembershipService
109+
User *user.UserService
110+
Zones *zones.ZoneService
111+
LoadBalancers *load_balancers.LoadBalancerService
112+
Cache *cache.CacheService
113+
SSL *ssl.SSLService
114+
ACM *acm.ACMService
115+
Argo *argo.ArgoService
116+
CertificateAuthorities *certificate_authorities.CertificateAuthorityService
117+
ClientCertificates *client_certificates.ClientCertificateService
118+
CustomCertificates *custom_certificates.CustomCertificateService
119+
CustomHostnames *custom_hostnames.CustomHostnameService
120+
CustomNameservers *custom_nameservers.CustomNameserverService
121+
DNSFirewall *dns_firewall.DNSFirewallService
122+
DNS *dns.DNSService
123+
EmailSecurity *email_security.EmailSecurityService
124+
EmailRouting *email_routing.EmailRoutingService
125+
// Deprecated: The Filters API is deprecated in favour of using the Ruleset Engine.
126+
// See
127+
// https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api
128+
// for full details.
129+
Filters *filters.FilterService
130+
Firewall *firewall.FirewallService
131+
Healthchecks *healthchecks.HealthcheckService
132+
KeylessCertificates *keyless_certificates.KeylessCertificateService
133+
Logpush *logpush.LogpushService
134+
Logs *logs.LogService
135+
OriginTLSClientAuth *origin_tls_client_auth.OriginTLSClientAuthService
136+
PageRules *page_rules.PageRuleService
137+
// Deprecated: Rate limiting API is deprecated in favour of using the Ruleset
138+
// Engine. See
139+
// https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version
140+
// for full details.
133141
RateLimits *rate_limits.RateLimitService
134142
WaitingRooms *waiting_rooms.WaitingRoomService
135143
Web3 *web3.Web3Service

‎custom_nameservers/customnameserver.go

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ type CustomNameserver struct {
113113
// The FQDN of the name server.
114114
NSName string `json:"ns_name,required" format:"hostname"`
115115
// Verification status of the nameserver.
116+
//
117+
// Deprecated: deprecated
116118
Status CustomNameserverStatus `json:"status,required"`
117119
// Identifier
118120
ZoneTag string `json:"zone_tag,required"`

‎email_routing/address.go

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ type Address struct {
136136
Modified time.Time `json:"modified" format:"date-time"`
137137
// Destination address tag. (Deprecated, replaced by destination address
138138
// identifier)
139+
//
140+
// Deprecated: deprecated
139141
Tag string `json:"tag"`
140142
// The date and time the destination address has been verified. Null means not
141143
// verified yet.

‎email_routing/emailrouting.go

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ type Settings struct {
110110
Status SettingsStatus `json:"status"`
111111
// Email Routing settings tag. (Deprecated, replaced by Email Routing settings
112112
// identifier)
113+
//
114+
// Deprecated: deprecated
113115
Tag string `json:"tag"`
114116
JSON settingsJSON `json:"-"`
115117
}

‎email_routing/rule.go

+2
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ type EmailRoutingRule struct {
214214
// Priority of the routing rule.
215215
Priority float64 `json:"priority"`
216216
// Routing rule tag. (Deprecated, replaced by routing rule identifier)
217+
//
218+
// Deprecated: deprecated
217219
Tag string `json:"tag"`
218220
JSON emailRoutingRuleJSON `json:"-"`
219221
}

‎email_routing/rulecatchall.go

+4
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ type RuleCatchAllUpdateResponse struct {
180180
// Routing rule name.
181181
Name string `json:"name"`
182182
// Routing rule tag. (Deprecated, replaced by routing rule identifier)
183+
//
184+
// Deprecated: deprecated
183185
Tag string `json:"tag"`
184186
JSON ruleCatchAllUpdateResponseJSON `json:"-"`
185187
}
@@ -233,6 +235,8 @@ type RuleCatchAllGetResponse struct {
233235
// Routing rule name.
234236
Name string `json:"name"`
235237
// Routing rule tag. (Deprecated, replaced by routing rule identifier)
238+
//
239+
// Deprecated: deprecated
236240
Tag string `json:"tag"`
237241
JSON ruleCatchAllGetResponseJSON `json:"-"`
238242
}

‎email_security/settingallowpolicy.go

+36-24
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,15 @@ type SettingAllowPolicyNewResponse struct {
151151
PatternType SettingAllowPolicyNewResponsePatternType `json:"pattern_type,required"`
152152
// Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
153153
// policies that pass authentication.
154-
VerifySender bool `json:"verify_sender,required"`
155-
Comments string `json:"comments,nullable"`
156-
IsRecipient bool `json:"is_recipient"`
157-
IsSender bool `json:"is_sender"`
158-
IsSpoof bool `json:"is_spoof"`
159-
JSON settingAllowPolicyNewResponseJSON `json:"-"`
154+
VerifySender bool `json:"verify_sender,required"`
155+
Comments string `json:"comments,nullable"`
156+
// Deprecated: deprecated
157+
IsRecipient bool `json:"is_recipient"`
158+
// Deprecated: deprecated
159+
IsSender bool `json:"is_sender"`
160+
// Deprecated: deprecated
161+
IsSpoof bool `json:"is_spoof"`
162+
JSON settingAllowPolicyNewResponseJSON `json:"-"`
160163
}
161164

162165
// settingAllowPolicyNewResponseJSON contains the JSON metadata for the struct
@@ -223,12 +226,15 @@ type SettingAllowPolicyListResponse struct {
223226
PatternType SettingAllowPolicyListResponsePatternType `json:"pattern_type,required"`
224227
// Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
225228
// policies that pass authentication.
226-
VerifySender bool `json:"verify_sender,required"`
227-
Comments string `json:"comments,nullable"`
228-
IsRecipient bool `json:"is_recipient"`
229-
IsSender bool `json:"is_sender"`
230-
IsSpoof bool `json:"is_spoof"`
231-
JSON settingAllowPolicyListResponseJSON `json:"-"`
229+
VerifySender bool `json:"verify_sender,required"`
230+
Comments string `json:"comments,nullable"`
231+
// Deprecated: deprecated
232+
IsRecipient bool `json:"is_recipient"`
233+
// Deprecated: deprecated
234+
IsSender bool `json:"is_sender"`
235+
// Deprecated: deprecated
236+
IsSpoof bool `json:"is_spoof"`
237+
JSON settingAllowPolicyListResponseJSON `json:"-"`
232238
}
233239

234240
// settingAllowPolicyListResponseJSON contains the JSON metadata for the struct
@@ -317,12 +323,15 @@ type SettingAllowPolicyEditResponse struct {
317323
PatternType SettingAllowPolicyEditResponsePatternType `json:"pattern_type,required"`
318324
// Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
319325
// policies that pass authentication.
320-
VerifySender bool `json:"verify_sender,required"`
321-
Comments string `json:"comments,nullable"`
322-
IsRecipient bool `json:"is_recipient"`
323-
IsSender bool `json:"is_sender"`
324-
IsSpoof bool `json:"is_spoof"`
325-
JSON settingAllowPolicyEditResponseJSON `json:"-"`
326+
VerifySender bool `json:"verify_sender,required"`
327+
Comments string `json:"comments,nullable"`
328+
// Deprecated: deprecated
329+
IsRecipient bool `json:"is_recipient"`
330+
// Deprecated: deprecated
331+
IsSender bool `json:"is_sender"`
332+
// Deprecated: deprecated
333+
IsSpoof bool `json:"is_spoof"`
334+
JSON settingAllowPolicyEditResponseJSON `json:"-"`
326335
}
327336

328337
// settingAllowPolicyEditResponseJSON contains the JSON metadata for the struct
@@ -389,12 +398,15 @@ type SettingAllowPolicyGetResponse struct {
389398
PatternType SettingAllowPolicyGetResponsePatternType `json:"pattern_type,required"`
390399
// Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
391400
// policies that pass authentication.
392-
VerifySender bool `json:"verify_sender,required"`
393-
Comments string `json:"comments,nullable"`
394-
IsRecipient bool `json:"is_recipient"`
395-
IsSender bool `json:"is_sender"`
396-
IsSpoof bool `json:"is_spoof"`
397-
JSON settingAllowPolicyGetResponseJSON `json:"-"`
401+
VerifySender bool `json:"verify_sender,required"`
402+
Comments string `json:"comments,nullable"`
403+
// Deprecated: deprecated
404+
IsRecipient bool `json:"is_recipient"`
405+
// Deprecated: deprecated
406+
IsSender bool `json:"is_sender"`
407+
// Deprecated: deprecated
408+
IsSpoof bool `json:"is_spoof"`
409+
JSON settingAllowPolicyGetResponseJSON `json:"-"`
398410
}
399411

400412
// settingAllowPolicyGetResponseJSON contains the JSON metadata for the struct

‎email_security/settingimpersonationregistry.go

+40-36
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,16 @@ func (r *SettingImpersonationRegistryService) Get(ctx context.Context, displayNa
134134
}
135135

136136
type SettingImpersonationRegistryNewResponse struct {
137-
ID int64 `json:"id,required"`
138-
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
139-
Email string `json:"email,required"`
140-
IsEmailRegex bool `json:"is_email_regex,required"`
141-
LastModified time.Time `json:"last_modified,required" format:"date-time"`
142-
Name string `json:"name,required"`
143-
Comments string `json:"comments,nullable"`
144-
DirectoryID int64 `json:"directory_id,nullable"`
145-
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
137+
ID int64 `json:"id,required"`
138+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
139+
Email string `json:"email,required"`
140+
IsEmailRegex bool `json:"is_email_regex,required"`
141+
LastModified time.Time `json:"last_modified,required" format:"date-time"`
142+
Name string `json:"name,required"`
143+
Comments string `json:"comments,nullable"`
144+
DirectoryID int64 `json:"directory_id,nullable"`
145+
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
146+
// Deprecated: deprecated
146147
ExternalDirectoryNodeID string `json:"external_directory_node_id,nullable"`
147148
Provenance string `json:"provenance,nullable"`
148149
JSON settingImpersonationRegistryNewResponseJSON `json:"-"`
@@ -175,15 +176,16 @@ func (r settingImpersonationRegistryNewResponseJSON) RawJSON() string {
175176
}
176177

177178
type SettingImpersonationRegistryListResponse struct {
178-
ID int64 `json:"id,required"`
179-
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
180-
Email string `json:"email,required"`
181-
IsEmailRegex bool `json:"is_email_regex,required"`
182-
LastModified time.Time `json:"last_modified,required" format:"date-time"`
183-
Name string `json:"name,required"`
184-
Comments string `json:"comments,nullable"`
185-
DirectoryID int64 `json:"directory_id,nullable"`
186-
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
179+
ID int64 `json:"id,required"`
180+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
181+
Email string `json:"email,required"`
182+
IsEmailRegex bool `json:"is_email_regex,required"`
183+
LastModified time.Time `json:"last_modified,required" format:"date-time"`
184+
Name string `json:"name,required"`
185+
Comments string `json:"comments,nullable"`
186+
DirectoryID int64 `json:"directory_id,nullable"`
187+
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
188+
// Deprecated: deprecated
187189
ExternalDirectoryNodeID string `json:"external_directory_node_id,nullable"`
188190
Provenance string `json:"provenance,nullable"`
189191
JSON settingImpersonationRegistryListResponseJSON `json:"-"`
@@ -237,15 +239,16 @@ func (r settingImpersonationRegistryDeleteResponseJSON) RawJSON() string {
237239
}
238240

239241
type SettingImpersonationRegistryEditResponse struct {
240-
ID int64 `json:"id,required"`
241-
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
242-
Email string `json:"email,required"`
243-
IsEmailRegex bool `json:"is_email_regex,required"`
244-
LastModified time.Time `json:"last_modified,required" format:"date-time"`
245-
Name string `json:"name,required"`
246-
Comments string `json:"comments,nullable"`
247-
DirectoryID int64 `json:"directory_id,nullable"`
248-
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
242+
ID int64 `json:"id,required"`
243+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
244+
Email string `json:"email,required"`
245+
IsEmailRegex bool `json:"is_email_regex,required"`
246+
LastModified time.Time `json:"last_modified,required" format:"date-time"`
247+
Name string `json:"name,required"`
248+
Comments string `json:"comments,nullable"`
249+
DirectoryID int64 `json:"directory_id,nullable"`
250+
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
251+
// Deprecated: deprecated
249252
ExternalDirectoryNodeID string `json:"external_directory_node_id,nullable"`
250253
Provenance string `json:"provenance,nullable"`
251254
JSON settingImpersonationRegistryEditResponseJSON `json:"-"`
@@ -278,15 +281,16 @@ func (r settingImpersonationRegistryEditResponseJSON) RawJSON() string {
278281
}
279282

280283
type SettingImpersonationRegistryGetResponse struct {
281-
ID int64 `json:"id,required"`
282-
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
283-
Email string `json:"email,required"`
284-
IsEmailRegex bool `json:"is_email_regex,required"`
285-
LastModified time.Time `json:"last_modified,required" format:"date-time"`
286-
Name string `json:"name,required"`
287-
Comments string `json:"comments,nullable"`
288-
DirectoryID int64 `json:"directory_id,nullable"`
289-
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
284+
ID int64 `json:"id,required"`
285+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
286+
Email string `json:"email,required"`
287+
IsEmailRegex bool `json:"is_email_regex,required"`
288+
LastModified time.Time `json:"last_modified,required" format:"date-time"`
289+
Name string `json:"name,required"`
290+
Comments string `json:"comments,nullable"`
291+
DirectoryID int64 `json:"directory_id,nullable"`
292+
DirectoryNodeID int64 `json:"directory_node_id,nullable"`
293+
// Deprecated: deprecated
290294
ExternalDirectoryNodeID string `json:"external_directory_node_id,nullable"`
291295
Provenance string `json:"provenance,nullable"`
292296
JSON settingImpersonationRegistryGetResponseJSON `json:"-"`

0 commit comments

Comments
 (0)
Please sign in to comment.