diff --git a/api.md b/api.md index dbdda79c160..2a07bd5e47d 100644 --- a/api.md +++ b/api.md @@ -349,361 +349,361 @@ Methods: Response Types: -- zones.ZoneSetting0rtt +- zones.ZeroRTT Methods: -- client.Zones.Settings.ZeroRTT.Edit(ctx context.Context, params zones.SettingZeroRTTEditParams) (zones.ZoneSetting0rtt, error) -- client.Zones.Settings.ZeroRTT.Get(ctx context.Context, query zones.SettingZeroRTTGetParams) (zones.ZoneSetting0rtt, error) +- client.Zones.Settings.ZeroRTT.Edit(ctx context.Context, params zones.SettingZeroRTTEditParams) (zones.ZeroRTT, error) +- client.Zones.Settings.ZeroRTT.Get(ctx context.Context, query zones.SettingZeroRTTGetParams) (zones.ZeroRTT, error) ### AdvancedDDoS Response Types: -- zones.ZoneSettingAdvancedDDoS +- zones.AdvancedDDoS Methods: -- client.Zones.Settings.AdvancedDDoS.Get(ctx context.Context, query zones.SettingAdvancedDDoSGetParams) (zones.ZoneSettingAdvancedDDoS, error) +- client.Zones.Settings.AdvancedDDoS.Get(ctx context.Context, query zones.SettingAdvancedDDoSGetParams) (zones.AdvancedDDoS, error) ### AlwaysOnline Response Types: -- zones.ZoneSettingAlwaysOnline +- zones.AlwaysOnline Methods: -- client.Zones.Settings.AlwaysOnline.Edit(ctx context.Context, params zones.SettingAlwaysOnlineEditParams) (zones.ZoneSettingAlwaysOnline, error) -- client.Zones.Settings.AlwaysOnline.Get(ctx context.Context, query zones.SettingAlwaysOnlineGetParams) (zones.ZoneSettingAlwaysOnline, error) +- client.Zones.Settings.AlwaysOnline.Edit(ctx context.Context, params zones.SettingAlwaysOnlineEditParams) (zones.AlwaysOnline, error) +- client.Zones.Settings.AlwaysOnline.Get(ctx context.Context, query zones.SettingAlwaysOnlineGetParams) (zones.AlwaysOnline, error) ### AlwaysUseHTTPS Response Types: -- zones.ZoneSettingAlwaysUseHTTPS +- zones.AlwaysUseHTTPS Methods: -- client.Zones.Settings.AlwaysUseHTTPS.Edit(ctx context.Context, params zones.SettingAlwaysUseHTTPSEditParams) (zones.ZoneSettingAlwaysUseHTTPS, error) -- client.Zones.Settings.AlwaysUseHTTPS.Get(ctx context.Context, query zones.SettingAlwaysUseHTTPSGetParams) (zones.ZoneSettingAlwaysUseHTTPS, error) +- client.Zones.Settings.AlwaysUseHTTPS.Edit(ctx context.Context, params zones.SettingAlwaysUseHTTPSEditParams) (zones.AlwaysUseHTTPS, error) +- client.Zones.Settings.AlwaysUseHTTPS.Get(ctx context.Context, query zones.SettingAlwaysUseHTTPSGetParams) (zones.AlwaysUseHTTPS, error) ### AutomaticHTTPSRewrites Response Types: -- zones.ZoneSettingAutomaticHTTPSRewrites +- zones.AutomaticHTTPSRewrites Methods: -- client.Zones.Settings.AutomaticHTTPSRewrites.Edit(ctx context.Context, params zones.SettingAutomaticHTTPSRewriteEditParams) (zones.ZoneSettingAutomaticHTTPSRewrites, error) -- client.Zones.Settings.AutomaticHTTPSRewrites.Get(ctx context.Context, query zones.SettingAutomaticHTTPSRewriteGetParams) (zones.ZoneSettingAutomaticHTTPSRewrites, error) +- client.Zones.Settings.AutomaticHTTPSRewrites.Edit(ctx context.Context, params zones.SettingAutomaticHTTPSRewriteEditParams) (zones.AutomaticHTTPSRewrites, error) +- client.Zones.Settings.AutomaticHTTPSRewrites.Get(ctx context.Context, query zones.SettingAutomaticHTTPSRewriteGetParams) (zones.AutomaticHTTPSRewrites, error) ### AutomaticPlatformOptimization Params Types: -- zones.ZoneSettingAutomaticPlatformOptimizationParam +- zones.AutomaticPlatformOptimizationParam Response Types: -- zones.ZoneSettingAutomaticPlatformOptimization +- zones.AutomaticPlatformOptimization Methods: -- client.Zones.Settings.AutomaticPlatformOptimization.Edit(ctx context.Context, params zones.SettingAutomaticPlatformOptimizationEditParams) (zones.ZoneSettingAutomaticPlatformOptimization, error) -- client.Zones.Settings.AutomaticPlatformOptimization.Get(ctx context.Context, query zones.SettingAutomaticPlatformOptimizationGetParams) (zones.ZoneSettingAutomaticPlatformOptimization, error) +- client.Zones.Settings.AutomaticPlatformOptimization.Edit(ctx context.Context, params zones.SettingAutomaticPlatformOptimizationEditParams) (zones.AutomaticPlatformOptimization, error) +- client.Zones.Settings.AutomaticPlatformOptimization.Get(ctx context.Context, query zones.SettingAutomaticPlatformOptimizationGetParams) (zones.AutomaticPlatformOptimization, error) ### Brotli Response Types: -- zones.ZoneSettingBrotli +- zones.Brotli Methods: -- client.Zones.Settings.Brotli.Edit(ctx context.Context, params zones.SettingBrotliEditParams) (zones.ZoneSettingBrotli, error) -- client.Zones.Settings.Brotli.Get(ctx context.Context, query zones.SettingBrotliGetParams) (zones.ZoneSettingBrotli, error) +- client.Zones.Settings.Brotli.Edit(ctx context.Context, params zones.SettingBrotliEditParams) (zones.Brotli, error) +- client.Zones.Settings.Brotli.Get(ctx context.Context, query zones.SettingBrotliGetParams) (zones.Brotli, error) ### BrowserCacheTTL Response Types: -- zones.ZoneSettingBrowserCacheTTL +- zones.BrowserCacheTTL Methods: -- client.Zones.Settings.BrowserCacheTTL.Edit(ctx context.Context, params zones.SettingBrowserCacheTTLEditParams) (zones.ZoneSettingBrowserCacheTTL, error) -- client.Zones.Settings.BrowserCacheTTL.Get(ctx context.Context, query zones.SettingBrowserCacheTTLGetParams) (zones.ZoneSettingBrowserCacheTTL, error) +- client.Zones.Settings.BrowserCacheTTL.Edit(ctx context.Context, params zones.SettingBrowserCacheTTLEditParams) (zones.BrowserCacheTTL, error) +- client.Zones.Settings.BrowserCacheTTL.Get(ctx context.Context, query zones.SettingBrowserCacheTTLGetParams) (zones.BrowserCacheTTL, error) ### BrowserCheck Response Types: -- zones.ZoneSettingBrowserCheck +- zones.BrowserCheck Methods: -- client.Zones.Settings.BrowserCheck.Edit(ctx context.Context, params zones.SettingBrowserCheckEditParams) (zones.ZoneSettingBrowserCheck, error) -- client.Zones.Settings.BrowserCheck.Get(ctx context.Context, query zones.SettingBrowserCheckGetParams) (zones.ZoneSettingBrowserCheck, error) +- client.Zones.Settings.BrowserCheck.Edit(ctx context.Context, params zones.SettingBrowserCheckEditParams) (zones.BrowserCheck, error) +- client.Zones.Settings.BrowserCheck.Get(ctx context.Context, query zones.SettingBrowserCheckGetParams) (zones.BrowserCheck, error) ### CacheLevel Response Types: -- zones.ZoneSettingCacheLevel +- zones.CacheLevel Methods: -- client.Zones.Settings.CacheLevel.Edit(ctx context.Context, params zones.SettingCacheLevelEditParams) (zones.ZoneSettingCacheLevel, error) -- client.Zones.Settings.CacheLevel.Get(ctx context.Context, query zones.SettingCacheLevelGetParams) (zones.ZoneSettingCacheLevel, error) +- client.Zones.Settings.CacheLevel.Edit(ctx context.Context, params zones.SettingCacheLevelEditParams) (zones.CacheLevel, error) +- client.Zones.Settings.CacheLevel.Get(ctx context.Context, query zones.SettingCacheLevelGetParams) (zones.CacheLevel, error) ### ChallengeTTL Response Types: -- zones.ZoneSettingChallengeTTL +- zones.ChallengeTTL Methods: -- client.Zones.Settings.ChallengeTTL.Edit(ctx context.Context, params zones.SettingChallengeTTLEditParams) (zones.ZoneSettingChallengeTTL, error) -- client.Zones.Settings.ChallengeTTL.Get(ctx context.Context, query zones.SettingChallengeTTLGetParams) (zones.ZoneSettingChallengeTTL, error) +- client.Zones.Settings.ChallengeTTL.Edit(ctx context.Context, params zones.SettingChallengeTTLEditParams) (zones.ChallengeTTL, error) +- client.Zones.Settings.ChallengeTTL.Get(ctx context.Context, query zones.SettingChallengeTTLGetParams) (zones.ChallengeTTL, error) ### Ciphers Response Types: -- zones.ZoneSettingCiphers +- zones.Ciphers Methods: -- client.Zones.Settings.Ciphers.Edit(ctx context.Context, params zones.SettingCipherEditParams) (zones.ZoneSettingCiphers, error) -- client.Zones.Settings.Ciphers.Get(ctx context.Context, query zones.SettingCipherGetParams) (zones.ZoneSettingCiphers, error) +- client.Zones.Settings.Ciphers.Edit(ctx context.Context, params zones.SettingCipherEditParams) (zones.Ciphers, error) +- client.Zones.Settings.Ciphers.Get(ctx context.Context, query zones.SettingCipherGetParams) (zones.Ciphers, error) ### DevelopmentMode Response Types: -- zones.ZoneSettingDevelopmentMode +- zones.DevelopmentMode Methods: -- client.Zones.Settings.DevelopmentMode.Edit(ctx context.Context, params zones.SettingDevelopmentModeEditParams) (zones.ZoneSettingDevelopmentMode, error) -- client.Zones.Settings.DevelopmentMode.Get(ctx context.Context, query zones.SettingDevelopmentModeGetParams) (zones.ZoneSettingDevelopmentMode, error) +- client.Zones.Settings.DevelopmentMode.Edit(ctx context.Context, params zones.SettingDevelopmentModeEditParams) (zones.DevelopmentMode, error) +- client.Zones.Settings.DevelopmentMode.Get(ctx context.Context, query zones.SettingDevelopmentModeGetParams) (zones.DevelopmentMode, error) ### EarlyHints Response Types: -- zones.ZoneSettingEarlyHints +- zones.EarlyHints Methods: -- client.Zones.Settings.EarlyHints.Edit(ctx context.Context, params zones.SettingEarlyHintEditParams) (zones.ZoneSettingEarlyHints, error) -- client.Zones.Settings.EarlyHints.Get(ctx context.Context, query zones.SettingEarlyHintGetParams) (zones.ZoneSettingEarlyHints, error) +- client.Zones.Settings.EarlyHints.Edit(ctx context.Context, params zones.SettingEarlyHintEditParams) (zones.EarlyHints, error) +- client.Zones.Settings.EarlyHints.Get(ctx context.Context, query zones.SettingEarlyHintGetParams) (zones.EarlyHints, error) ### EmailObfuscation Response Types: -- zones.ZoneSettingEmailObfuscation +- zones.EmailObfuscation Methods: -- client.Zones.Settings.EmailObfuscation.Edit(ctx context.Context, params zones.SettingEmailObfuscationEditParams) (zones.ZoneSettingEmailObfuscation, error) -- client.Zones.Settings.EmailObfuscation.Get(ctx context.Context, query zones.SettingEmailObfuscationGetParams) (zones.ZoneSettingEmailObfuscation, error) +- client.Zones.Settings.EmailObfuscation.Edit(ctx context.Context, params zones.SettingEmailObfuscationEditParams) (zones.EmailObfuscation, error) +- client.Zones.Settings.EmailObfuscation.Get(ctx context.Context, query zones.SettingEmailObfuscationGetParams) (zones.EmailObfuscation, error) ### H2Prioritization Params Types: -- zones.ZoneSettingH2PrioritizationParam +- zones.H2PrioritizationParam Response Types: -- zones.ZoneSettingH2Prioritization +- zones.H2Prioritization Methods: -- client.Zones.Settings.H2Prioritization.Edit(ctx context.Context, params zones.SettingH2PrioritizationEditParams) (zones.ZoneSettingH2Prioritization, error) -- client.Zones.Settings.H2Prioritization.Get(ctx context.Context, query zones.SettingH2PrioritizationGetParams) (zones.ZoneSettingH2Prioritization, error) +- client.Zones.Settings.H2Prioritization.Edit(ctx context.Context, params zones.SettingH2PrioritizationEditParams) (zones.H2Prioritization, error) +- client.Zones.Settings.H2Prioritization.Get(ctx context.Context, query zones.SettingH2PrioritizationGetParams) (zones.H2Prioritization, error) ### HotlinkProtection Response Types: -- zones.ZoneSettingHotlinkProtection +- zones.HotlinkProtection Methods: -- client.Zones.Settings.HotlinkProtection.Edit(ctx context.Context, params zones.SettingHotlinkProtectionEditParams) (zones.ZoneSettingHotlinkProtection, error) -- client.Zones.Settings.HotlinkProtection.Get(ctx context.Context, query zones.SettingHotlinkProtectionGetParams) (zones.ZoneSettingHotlinkProtection, error) +- client.Zones.Settings.HotlinkProtection.Edit(ctx context.Context, params zones.SettingHotlinkProtectionEditParams) (zones.HotlinkProtection, error) +- client.Zones.Settings.HotlinkProtection.Get(ctx context.Context, query zones.SettingHotlinkProtectionGetParams) (zones.HotlinkProtection, error) ### HTTP2 Response Types: -- zones.ZoneSettingHTTP2 +- zones.HTTP2 Methods: -- client.Zones.Settings.HTTP2.Edit(ctx context.Context, params zones.SettingHTTP2EditParams) (zones.ZoneSettingHTTP2, error) -- client.Zones.Settings.HTTP2.Get(ctx context.Context, query zones.SettingHTTP2GetParams) (zones.ZoneSettingHTTP2, error) +- client.Zones.Settings.HTTP2.Edit(ctx context.Context, params zones.SettingHTTP2EditParams) (zones.HTTP2, error) +- client.Zones.Settings.HTTP2.Get(ctx context.Context, query zones.SettingHTTP2GetParams) (zones.HTTP2, error) ### HTTP3 Response Types: -- zones.ZoneSettingHTTP3 +- zones.HTTP3 Methods: -- client.Zones.Settings.HTTP3.Edit(ctx context.Context, params zones.SettingHTTP3EditParams) (zones.ZoneSettingHTTP3, error) -- client.Zones.Settings.HTTP3.Get(ctx context.Context, query zones.SettingHTTP3GetParams) (zones.ZoneSettingHTTP3, error) +- client.Zones.Settings.HTTP3.Edit(ctx context.Context, params zones.SettingHTTP3EditParams) (zones.HTTP3, error) +- client.Zones.Settings.HTTP3.Get(ctx context.Context, query zones.SettingHTTP3GetParams) (zones.HTTP3, error) ### ImageResizing Params Types: -- zones.ZoneSettingImageResizingParam +- zones.ImageResizingParam Response Types: -- zones.ZoneSettingImageResizing +- zones.ImageResizing Methods: -- client.Zones.Settings.ImageResizing.Edit(ctx context.Context, params zones.SettingImageResizingEditParams) (zones.ZoneSettingImageResizing, error) -- client.Zones.Settings.ImageResizing.Get(ctx context.Context, query zones.SettingImageResizingGetParams) (zones.ZoneSettingImageResizing, error) +- client.Zones.Settings.ImageResizing.Edit(ctx context.Context, params zones.SettingImageResizingEditParams) (zones.ImageResizing, error) +- client.Zones.Settings.ImageResizing.Get(ctx context.Context, query zones.SettingImageResizingGetParams) (zones.ImageResizing, error) ### IPGeolocation Response Types: -- zones.ZoneSettingIPGeolocation +- zones.IPGeolocation Methods: -- client.Zones.Settings.IPGeolocation.Edit(ctx context.Context, params zones.SettingIPGeolocationEditParams) (zones.ZoneSettingIPGeolocation, error) -- client.Zones.Settings.IPGeolocation.Get(ctx context.Context, query zones.SettingIPGeolocationGetParams) (zones.ZoneSettingIPGeolocation, error) +- client.Zones.Settings.IPGeolocation.Edit(ctx context.Context, params zones.SettingIPGeolocationEditParams) (zones.IPGeolocation, error) +- client.Zones.Settings.IPGeolocation.Get(ctx context.Context, query zones.SettingIPGeolocationGetParams) (zones.IPGeolocation, error) ### IPV6 Response Types: -- zones.ZoneSettingIPV6 +- zones.IPV6 Methods: -- client.Zones.Settings.IPV6.Edit(ctx context.Context, params zones.SettingIPV6EditParams) (zones.ZoneSettingIPV6, error) -- client.Zones.Settings.IPV6.Get(ctx context.Context, query zones.SettingIPV6GetParams) (zones.ZoneSettingIPV6, error) +- client.Zones.Settings.IPV6.Edit(ctx context.Context, params zones.SettingIPV6EditParams) (zones.IPV6, error) +- client.Zones.Settings.IPV6.Get(ctx context.Context, query zones.SettingIPV6GetParams) (zones.IPV6, error) ### MinTLSVersion Response Types: -- zones.ZoneSettingMinTLSVersion +- zones.MinTLSVersion Methods: -- client.Zones.Settings.MinTLSVersion.Edit(ctx context.Context, params zones.SettingMinTLSVersionEditParams) (zones.ZoneSettingMinTLSVersion, error) -- client.Zones.Settings.MinTLSVersion.Get(ctx context.Context, query zones.SettingMinTLSVersionGetParams) (zones.ZoneSettingMinTLSVersion, error) +- client.Zones.Settings.MinTLSVersion.Edit(ctx context.Context, params zones.SettingMinTLSVersionEditParams) (zones.MinTLSVersion, error) +- client.Zones.Settings.MinTLSVersion.Get(ctx context.Context, query zones.SettingMinTLSVersionGetParams) (zones.MinTLSVersion, error) ### Minify Response Types: -- zones.ZoneSettingMinify +- zones.Minify Methods: -- client.Zones.Settings.Minify.Edit(ctx context.Context, params zones.SettingMinifyEditParams) (zones.ZoneSettingMinify, error) -- client.Zones.Settings.Minify.Get(ctx context.Context, query zones.SettingMinifyGetParams) (zones.ZoneSettingMinify, error) +- client.Zones.Settings.Minify.Edit(ctx context.Context, params zones.SettingMinifyEditParams) (zones.Minify, error) +- client.Zones.Settings.Minify.Get(ctx context.Context, query zones.SettingMinifyGetParams) (zones.Minify, error) ### Mirage Response Types: -- zones.ZoneSettingMirage +- zones.Mirage Methods: -- client.Zones.Settings.Mirage.Edit(ctx context.Context, params zones.SettingMirageEditParams) (zones.ZoneSettingMirage, error) -- client.Zones.Settings.Mirage.Get(ctx context.Context, query zones.SettingMirageGetParams) (zones.ZoneSettingMirage, error) +- client.Zones.Settings.Mirage.Edit(ctx context.Context, params zones.SettingMirageEditParams) (zones.Mirage, error) +- client.Zones.Settings.Mirage.Get(ctx context.Context, query zones.SettingMirageGetParams) (zones.Mirage, error) ### MobileRedirect Response Types: -- zones.ZoneSettingMobileRedirect +- zones.MobileRedirect Methods: -- client.Zones.Settings.MobileRedirect.Edit(ctx context.Context, params zones.SettingMobileRedirectEditParams) (zones.ZoneSettingMobileRedirect, error) -- client.Zones.Settings.MobileRedirect.Get(ctx context.Context, query zones.SettingMobileRedirectGetParams) (zones.ZoneSettingMobileRedirect, error) +- client.Zones.Settings.MobileRedirect.Edit(ctx context.Context, params zones.SettingMobileRedirectEditParams) (zones.MobileRedirect, error) +- client.Zones.Settings.MobileRedirect.Get(ctx context.Context, query zones.SettingMobileRedirectGetParams) (zones.MobileRedirect, error) ### NEL Params Types: -- zones.ZoneSettingNELParam +- zones.NELParam Response Types: -- zones.ZoneSettingNEL +- zones.NEL Methods: -- client.Zones.Settings.NEL.Edit(ctx context.Context, params zones.SettingNELEditParams) (zones.ZoneSettingNEL, error) -- client.Zones.Settings.NEL.Get(ctx context.Context, query zones.SettingNELGetParams) (zones.ZoneSettingNEL, error) +- client.Zones.Settings.NEL.Edit(ctx context.Context, params zones.SettingNELEditParams) (zones.NEL, error) +- client.Zones.Settings.NEL.Get(ctx context.Context, query zones.SettingNELGetParams) (zones.NEL, error) ### OpportunisticEncryption Response Types: -- zones.ZoneSettingOpportunisticEncryption +- zones.OpportunisticEncryption Methods: -- client.Zones.Settings.OpportunisticEncryption.Edit(ctx context.Context, params zones.SettingOpportunisticEncryptionEditParams) (zones.ZoneSettingOpportunisticEncryption, error) -- client.Zones.Settings.OpportunisticEncryption.Get(ctx context.Context, query zones.SettingOpportunisticEncryptionGetParams) (zones.ZoneSettingOpportunisticEncryption, error) +- client.Zones.Settings.OpportunisticEncryption.Edit(ctx context.Context, params zones.SettingOpportunisticEncryptionEditParams) (zones.OpportunisticEncryption, error) +- client.Zones.Settings.OpportunisticEncryption.Get(ctx context.Context, query zones.SettingOpportunisticEncryptionGetParams) (zones.OpportunisticEncryption, error) ### OpportunisticOnion Response Types: -- zones.ZoneSettingOpportunisticOnion +- zones.OpportunisticOnion Methods: -- client.Zones.Settings.OpportunisticOnion.Edit(ctx context.Context, params zones.SettingOpportunisticOnionEditParams) (zones.ZoneSettingOpportunisticOnion, error) -- client.Zones.Settings.OpportunisticOnion.Get(ctx context.Context, query zones.SettingOpportunisticOnionGetParams) (zones.ZoneSettingOpportunisticOnion, error) +- client.Zones.Settings.OpportunisticOnion.Edit(ctx context.Context, params zones.SettingOpportunisticOnionEditParams) (zones.OpportunisticOnion, error) +- client.Zones.Settings.OpportunisticOnion.Get(ctx context.Context, query zones.SettingOpportunisticOnionGetParams) (zones.OpportunisticOnion, error) ### OrangeToOrange Params Types: -- zones.ZoneSettingOrangeToOrangeParam +- zones.OrangeToOrangeParam Response Types: -- zones.ZoneSettingOrangeToOrange +- zones.OrangeToOrange Methods: -- client.Zones.Settings.OrangeToOrange.Edit(ctx context.Context, params zones.SettingOrangeToOrangeEditParams) (zones.ZoneSettingOrangeToOrange, error) -- client.Zones.Settings.OrangeToOrange.Get(ctx context.Context, query zones.SettingOrangeToOrangeGetParams) (zones.ZoneSettingOrangeToOrange, error) +- client.Zones.Settings.OrangeToOrange.Edit(ctx context.Context, params zones.SettingOrangeToOrangeEditParams) (zones.OrangeToOrange, error) +- client.Zones.Settings.OrangeToOrange.Get(ctx context.Context, query zones.SettingOrangeToOrangeGetParams) (zones.OrangeToOrange, error) ### OriginErrorPagePassThru Response Types: -- zones.ZoneSettingOriginErrorPagePassThru +- zones.OriginErrorPagePassThru Methods: -- client.Zones.Settings.OriginErrorPagePassThru.Edit(ctx context.Context, params zones.SettingOriginErrorPagePassThruEditParams) (zones.ZoneSettingOriginErrorPagePassThru, error) -- client.Zones.Settings.OriginErrorPagePassThru.Get(ctx context.Context, query zones.SettingOriginErrorPagePassThruGetParams) (zones.ZoneSettingOriginErrorPagePassThru, error) +- client.Zones.Settings.OriginErrorPagePassThru.Edit(ctx context.Context, params zones.SettingOriginErrorPagePassThruEditParams) (zones.OriginErrorPagePassThru, error) +- client.Zones.Settings.OriginErrorPagePassThru.Get(ctx context.Context, query zones.SettingOriginErrorPagePassThruGetParams) (zones.OriginErrorPagePassThru, error) ### OriginMaxHTTPVersion @@ -722,226 +722,226 @@ Methods: Params Types: -- zones.ZoneSettingPolishParam +- zones.PolishParam Response Types: -- zones.ZoneSettingPolish +- zones.Polish Methods: -- client.Zones.Settings.Polish.Edit(ctx context.Context, params zones.SettingPolishEditParams) (zones.ZoneSettingPolish, error) -- client.Zones.Settings.Polish.Get(ctx context.Context, query zones.SettingPolishGetParams) (zones.ZoneSettingPolish, error) +- client.Zones.Settings.Polish.Edit(ctx context.Context, params zones.SettingPolishEditParams) (zones.Polish, error) +- client.Zones.Settings.Polish.Get(ctx context.Context, query zones.SettingPolishGetParams) (zones.Polish, error) ### PrefetchPreload Response Types: -- zones.ZoneSettingPrefetchPreload +- zones.PrefetchPreload Methods: -- client.Zones.Settings.PrefetchPreload.Edit(ctx context.Context, params zones.SettingPrefetchPreloadEditParams) (zones.ZoneSettingPrefetchPreload, error) -- client.Zones.Settings.PrefetchPreload.Get(ctx context.Context, query zones.SettingPrefetchPreloadGetParams) (zones.ZoneSettingPrefetchPreload, error) +- client.Zones.Settings.PrefetchPreload.Edit(ctx context.Context, params zones.SettingPrefetchPreloadEditParams) (zones.PrefetchPreload, error) +- client.Zones.Settings.PrefetchPreload.Get(ctx context.Context, query zones.SettingPrefetchPreloadGetParams) (zones.PrefetchPreload, error) ### ProxyReadTimeout Params Types: -- zones.ZoneSettingProxyReadTimeoutParam +- zones.ProxyReadTimeoutParam Response Types: -- zones.ZoneSettingProxyReadTimeout +- zones.ProxyReadTimeout Methods: -- client.Zones.Settings.ProxyReadTimeout.Edit(ctx context.Context, params zones.SettingProxyReadTimeoutEditParams) (zones.ZoneSettingProxyReadTimeout, error) -- client.Zones.Settings.ProxyReadTimeout.Get(ctx context.Context, query zones.SettingProxyReadTimeoutGetParams) (zones.ZoneSettingProxyReadTimeout, error) +- client.Zones.Settings.ProxyReadTimeout.Edit(ctx context.Context, params zones.SettingProxyReadTimeoutEditParams) (zones.ProxyReadTimeout, error) +- client.Zones.Settings.ProxyReadTimeout.Get(ctx context.Context, query zones.SettingProxyReadTimeoutGetParams) (zones.ProxyReadTimeout, error) ### PseudoIPV4 Response Types: -- zones.ZoneSettingPseudoIPV4 +- zones.PseudoIPV4 Methods: -- client.Zones.Settings.PseudoIPV4.Edit(ctx context.Context, params zones.SettingPseudoIPV4EditParams) (zones.ZoneSettingPseudoIPV4, error) -- client.Zones.Settings.PseudoIPV4.Get(ctx context.Context, query zones.SettingPseudoIPV4GetParams) (zones.ZoneSettingPseudoIPV4, error) +- client.Zones.Settings.PseudoIPV4.Edit(ctx context.Context, params zones.SettingPseudoIPV4EditParams) (zones.PseudoIPV4, error) +- client.Zones.Settings.PseudoIPV4.Get(ctx context.Context, query zones.SettingPseudoIPV4GetParams) (zones.PseudoIPV4, error) ### ResponseBuffering Response Types: -- zones.ZoneSettingBuffering +- zones.ResponseBuffering Methods: -- client.Zones.Settings.ResponseBuffering.Edit(ctx context.Context, params zones.SettingResponseBufferingEditParams) (zones.ZoneSettingBuffering, error) -- client.Zones.Settings.ResponseBuffering.Get(ctx context.Context, query zones.SettingResponseBufferingGetParams) (zones.ZoneSettingBuffering, error) +- client.Zones.Settings.ResponseBuffering.Edit(ctx context.Context, params zones.SettingResponseBufferingEditParams) (zones.ResponseBuffering, error) +- client.Zones.Settings.ResponseBuffering.Get(ctx context.Context, query zones.SettingResponseBufferingGetParams) (zones.ResponseBuffering, error) ### RocketLoader Params Types: -- zones.ZoneSettingRocketLoaderParam +- zones.RocketLoaderParam Response Types: -- zones.ZoneSettingRocketLoader +- zones.RocketLoader Methods: -- client.Zones.Settings.RocketLoader.Edit(ctx context.Context, params zones.SettingRocketLoaderEditParams) (zones.ZoneSettingRocketLoader, error) -- client.Zones.Settings.RocketLoader.Get(ctx context.Context, query zones.SettingRocketLoaderGetParams) (zones.ZoneSettingRocketLoader, error) +- client.Zones.Settings.RocketLoader.Edit(ctx context.Context, params zones.SettingRocketLoaderEditParams) (zones.RocketLoader, error) +- client.Zones.Settings.RocketLoader.Get(ctx context.Context, query zones.SettingRocketLoaderGetParams) (zones.RocketLoader, error) ### SecurityHeaders Response Types: -- zones.ZoneSettingSecurityHeader +- zones.SecurityHeaders Methods: -- client.Zones.Settings.SecurityHeaders.Edit(ctx context.Context, params zones.SettingSecurityHeaderEditParams) (zones.ZoneSettingSecurityHeader, error) -- client.Zones.Settings.SecurityHeaders.Get(ctx context.Context, query zones.SettingSecurityHeaderGetParams) (zones.ZoneSettingSecurityHeader, error) +- client.Zones.Settings.SecurityHeaders.Edit(ctx context.Context, params zones.SettingSecurityHeaderEditParams) (zones.SecurityHeaders, error) +- client.Zones.Settings.SecurityHeaders.Get(ctx context.Context, query zones.SettingSecurityHeaderGetParams) (zones.SecurityHeaders, error) ### SecurityLevel Response Types: -- zones.ZoneSettingSecurityLevel +- zones.SecurityLevel Methods: -- client.Zones.Settings.SecurityLevel.Edit(ctx context.Context, params zones.SettingSecurityLevelEditParams) (zones.ZoneSettingSecurityLevel, error) -- client.Zones.Settings.SecurityLevel.Get(ctx context.Context, query zones.SettingSecurityLevelGetParams) (zones.ZoneSettingSecurityLevel, error) +- client.Zones.Settings.SecurityLevel.Edit(ctx context.Context, params zones.SettingSecurityLevelEditParams) (zones.SecurityLevel, error) +- client.Zones.Settings.SecurityLevel.Get(ctx context.Context, query zones.SettingSecurityLevelGetParams) (zones.SecurityLevel, error) ### ServerSideExcludes Response Types: -- zones.ZoneSettingServerSideExclude +- zones.ServerSideExcludes Methods: -- client.Zones.Settings.ServerSideExcludes.Edit(ctx context.Context, params zones.SettingServerSideExcludeEditParams) (zones.ZoneSettingServerSideExclude, error) -- client.Zones.Settings.ServerSideExcludes.Get(ctx context.Context, query zones.SettingServerSideExcludeGetParams) (zones.ZoneSettingServerSideExclude, error) +- client.Zones.Settings.ServerSideExcludes.Edit(ctx context.Context, params zones.SettingServerSideExcludeEditParams) (zones.ServerSideExcludes, error) +- client.Zones.Settings.ServerSideExcludes.Get(ctx context.Context, query zones.SettingServerSideExcludeGetParams) (zones.ServerSideExcludes, error) ### SortQueryStringForCache Response Types: -- zones.ZoneSettingSortQueryStringForCache +- zones.SortQueryStringForCache Methods: -- client.Zones.Settings.SortQueryStringForCache.Edit(ctx context.Context, params zones.SettingSortQueryStringForCacheEditParams) (zones.ZoneSettingSortQueryStringForCache, error) -- client.Zones.Settings.SortQueryStringForCache.Get(ctx context.Context, query zones.SettingSortQueryStringForCacheGetParams) (zones.ZoneSettingSortQueryStringForCache, error) +- client.Zones.Settings.SortQueryStringForCache.Edit(ctx context.Context, params zones.SettingSortQueryStringForCacheEditParams) (zones.SortQueryStringForCache, error) +- client.Zones.Settings.SortQueryStringForCache.Get(ctx context.Context, query zones.SettingSortQueryStringForCacheGetParams) (zones.SortQueryStringForCache, error) ### SSL Response Types: -- zones.ZoneSettingSSL +- zones.SSL Methods: -- client.Zones.Settings.SSL.Edit(ctx context.Context, params zones.SettingSSLEditParams) (zones.ZoneSettingSSL, error) -- client.Zones.Settings.SSL.Get(ctx context.Context, query zones.SettingSSLGetParams) (zones.ZoneSettingSSL, error) +- client.Zones.Settings.SSL.Edit(ctx context.Context, params zones.SettingSSLEditParams) (zones.SSL, error) +- client.Zones.Settings.SSL.Get(ctx context.Context, query zones.SettingSSLGetParams) (zones.SSL, error) ### SSLRecommender Params Types: -- zones.ZoneSettingSSLRecommenderParam +- zones.SSLRecommenderParam Response Types: -- zones.ZoneSettingSSLRecommender +- zones.SSLRecommender Methods: -- client.Zones.Settings.SSLRecommender.Edit(ctx context.Context, params zones.SettingSSLRecommenderEditParams) (zones.ZoneSettingSSLRecommender, error) -- client.Zones.Settings.SSLRecommender.Get(ctx context.Context, query zones.SettingSSLRecommenderGetParams) (zones.ZoneSettingSSLRecommender, error) +- client.Zones.Settings.SSLRecommender.Edit(ctx context.Context, params zones.SettingSSLRecommenderEditParams) (zones.SSLRecommender, error) +- client.Zones.Settings.SSLRecommender.Get(ctx context.Context, query zones.SettingSSLRecommenderGetParams) (zones.SSLRecommender, error) ### TLS1_3 Response Types: -- zones.ZoneSettingTLS1_3 +- zones.TLS1_3 Methods: -- client.Zones.Settings.TLS1_3.Edit(ctx context.Context, params zones.SettingTLS1_3EditParams) (zones.ZoneSettingTLS1_3, error) -- client.Zones.Settings.TLS1_3.Get(ctx context.Context, query zones.SettingTLS1_3GetParams) (zones.ZoneSettingTLS1_3, error) +- client.Zones.Settings.TLS1_3.Edit(ctx context.Context, params zones.SettingTLS1_3EditParams) (zones.TLS1_3, error) +- client.Zones.Settings.TLS1_3.Get(ctx context.Context, query zones.SettingTLS1_3GetParams) (zones.TLS1_3, error) ### TLSClientAuth Response Types: -- zones.ZoneSettingTLSClientAuth +- zones.TLSClientAuth Methods: -- client.Zones.Settings.TLSClientAuth.Edit(ctx context.Context, params zones.SettingTLSClientAuthEditParams) (zones.ZoneSettingTLSClientAuth, error) -- client.Zones.Settings.TLSClientAuth.Get(ctx context.Context, query zones.SettingTLSClientAuthGetParams) (zones.ZoneSettingTLSClientAuth, error) +- client.Zones.Settings.TLSClientAuth.Edit(ctx context.Context, params zones.SettingTLSClientAuthEditParams) (zones.TLSClientAuth, error) +- client.Zones.Settings.TLSClientAuth.Get(ctx context.Context, query zones.SettingTLSClientAuthGetParams) (zones.TLSClientAuth, error) ### TrueClientIPHeader Response Types: -- zones.ZoneSettingTrueClientIPHeader +- zones.TrueClientIPHeader Methods: -- client.Zones.Settings.TrueClientIPHeader.Edit(ctx context.Context, params zones.SettingTrueClientIPHeaderEditParams) (zones.ZoneSettingTrueClientIPHeader, error) -- client.Zones.Settings.TrueClientIPHeader.Get(ctx context.Context, query zones.SettingTrueClientIPHeaderGetParams) (zones.ZoneSettingTrueClientIPHeader, error) +- client.Zones.Settings.TrueClientIPHeader.Edit(ctx context.Context, params zones.SettingTrueClientIPHeaderEditParams) (zones.TrueClientIPHeader, error) +- client.Zones.Settings.TrueClientIPHeader.Get(ctx context.Context, query zones.SettingTrueClientIPHeaderGetParams) (zones.TrueClientIPHeader, error) ### WAF Response Types: -- zones.ZoneSettingWAF +- zones.WAF Methods: -- client.Zones.Settings.WAF.Edit(ctx context.Context, params zones.SettingWAFEditParams) (zones.ZoneSettingWAF, error) -- client.Zones.Settings.WAF.Get(ctx context.Context, query zones.SettingWAFGetParams) (zones.ZoneSettingWAF, error) +- client.Zones.Settings.WAF.Edit(ctx context.Context, params zones.SettingWAFEditParams) (zones.WAF, error) +- client.Zones.Settings.WAF.Get(ctx context.Context, query zones.SettingWAFGetParams) (zones.WAF, error) ### WebP Response Types: -- zones.ZoneSettingWebP +- zones.WebP Methods: -- client.Zones.Settings.WebP.Edit(ctx context.Context, params zones.SettingWebPEditParams) (zones.ZoneSettingWebP, error) -- client.Zones.Settings.WebP.Get(ctx context.Context, query zones.SettingWebPGetParams) (zones.ZoneSettingWebP, error) +- client.Zones.Settings.WebP.Edit(ctx context.Context, params zones.SettingWebPEditParams) (zones.WebP, error) +- client.Zones.Settings.WebP.Get(ctx context.Context, query zones.SettingWebPGetParams) (zones.WebP, error) ### Websocket Response Types: -- zones.ZoneSettingWebsockets +- zones.Websocket Methods: -- client.Zones.Settings.Websocket.Edit(ctx context.Context, params zones.SettingWebsocketEditParams) (zones.ZoneSettingWebsockets, error) -- client.Zones.Settings.Websocket.Get(ctx context.Context, query zones.SettingWebsocketGetParams) (zones.ZoneSettingWebsockets, error) +- client.Zones.Settings.Websocket.Edit(ctx context.Context, params zones.SettingWebsocketEditParams) (zones.Websocket, error) +- client.Zones.Settings.Websocket.Get(ctx context.Context, query zones.SettingWebsocketGetParams) (zones.Websocket, error) ### FontSettings Response Types: -- zones.ZoneSettingFonts +- zones.FontSettings Methods: -- client.Zones.Settings.FontSettings.Edit(ctx context.Context, params zones.SettingFontSettingEditParams) (zones.ZoneSettingFonts, error) -- client.Zones.Settings.FontSettings.Get(ctx context.Context, query zones.SettingFontSettingGetParams) (zones.ZoneSettingFonts, error) +- client.Zones.Settings.FontSettings.Edit(ctx context.Context, params zones.SettingFontSettingEditParams) (zones.FontSettings, error) +- client.Zones.Settings.FontSettings.Get(ctx context.Context, query zones.SettingFontSettingGetParams) (zones.FontSettings, error) ## CustomNameservers diff --git a/zones/settingadvancedddos.go b/zones/settingadvancedddos.go index 627ab511441..5ed658b2e79 100644 --- a/zones/settingadvancedddos.go +++ b/zones/settingadvancedddos.go @@ -36,7 +36,7 @@ func NewSettingAdvancedDDoSService(opts ...option.RequestOption) (r *SettingAdva // Advanced protection from Distributed Denial of Service (DDoS) attacks on your // website. This is an uneditable value that is 'on' in the case of Business and // Enterprise zones. -func (r *SettingAdvancedDDoSService) Get(ctx context.Context, query SettingAdvancedDDoSGetParams, opts ...option.RequestOption) (res *ZoneSettingAdvancedDDoS, err error) { +func (r *SettingAdvancedDDoSService) Get(ctx context.Context, query SettingAdvancedDDoSGetParams, opts ...option.RequestOption) (res *AdvancedDDoS, err error) { opts = append(r.Options[:], opts...) var env SettingAdvancedDDoSGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/advanced_ddos", query.ZoneID) @@ -51,22 +51,21 @@ func (r *SettingAdvancedDDoSService) Get(ctx context.Context, query SettingAdvan // Advanced protection from Distributed Denial of Service (DDoS) attacks on your // website. This is an uneditable value that is 'on' in the case of Business and // Enterprise zones. -type ZoneSettingAdvancedDDoS struct { +type AdvancedDDoS struct { // ID of the zone setting. - ID ZoneSettingAdvancedDDoSID `json:"id,required"` + ID AdvancedDDoSID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingAdvancedDDoSValue `json:"value,required"` + Value AdvancedDDoSValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingAdvancedDDoSEditable `json:"editable"` + Editable AdvancedDDoSEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingAdvancedDDoSJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON advancedDDoSJSON `json:"-"` } -// zoneSettingAdvancedDDoSJSON contains the JSON metadata for the struct -// [ZoneSettingAdvancedDDoS] -type zoneSettingAdvancedDDoSJSON struct { +// advancedDDoSJSON contains the JSON metadata for the struct [AdvancedDDoS] +type advancedDDoSJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -75,40 +74,40 @@ type zoneSettingAdvancedDDoSJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingAdvancedDDoS) UnmarshalJSON(data []byte) (err error) { +func (r *AdvancedDDoS) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingAdvancedDDoSJSON) RawJSON() string { +func (r advancedDDoSJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingAdvancedDDoSID string +type AdvancedDDoSID string const ( - ZoneSettingAdvancedDDoSIDAdvancedDDoS ZoneSettingAdvancedDDoSID = "advanced_ddos" + AdvancedDDoSIDAdvancedDDoS AdvancedDDoSID = "advanced_ddos" ) -func (r ZoneSettingAdvancedDDoSID) IsKnown() bool { +func (r AdvancedDDoSID) IsKnown() bool { switch r { - case ZoneSettingAdvancedDDoSIDAdvancedDDoS: + case AdvancedDDoSIDAdvancedDDoS: return true } return false } // Current value of the zone setting. -type ZoneSettingAdvancedDDoSValue string +type AdvancedDDoSValue string const ( - ZoneSettingAdvancedDDoSValueOn ZoneSettingAdvancedDDoSValue = "on" - ZoneSettingAdvancedDDoSValueOff ZoneSettingAdvancedDDoSValue = "off" + AdvancedDDoSValueOn AdvancedDDoSValue = "on" + AdvancedDDoSValueOff AdvancedDDoSValue = "off" ) -func (r ZoneSettingAdvancedDDoSValue) IsKnown() bool { +func (r AdvancedDDoSValue) IsKnown() bool { switch r { - case ZoneSettingAdvancedDDoSValueOn, ZoneSettingAdvancedDDoSValueOff: + case AdvancedDDoSValueOn, AdvancedDDoSValueOff: return true } return false @@ -116,16 +115,16 @@ func (r ZoneSettingAdvancedDDoSValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingAdvancedDDoSEditable bool +type AdvancedDDoSEditable bool const ( - ZoneSettingAdvancedDDoSEditableTrue ZoneSettingAdvancedDDoSEditable = true - ZoneSettingAdvancedDDoSEditableFalse ZoneSettingAdvancedDDoSEditable = false + AdvancedDDoSEditableTrue AdvancedDDoSEditable = true + AdvancedDDoSEditableFalse AdvancedDDoSEditable = false ) -func (r ZoneSettingAdvancedDDoSEditable) IsKnown() bool { +func (r AdvancedDDoSEditable) IsKnown() bool { switch r { - case ZoneSettingAdvancedDDoSEditableTrue, ZoneSettingAdvancedDDoSEditableFalse: + case AdvancedDDoSEditableTrue, AdvancedDDoSEditableFalse: return true } return false @@ -144,7 +143,7 @@ type SettingAdvancedDDoSGetResponseEnvelope struct { // Advanced protection from Distributed Denial of Service (DDoS) attacks on your // website. This is an uneditable value that is 'on' in the case of Business and // Enterprise zones. - Result ZoneSettingAdvancedDDoS `json:"result"` + Result AdvancedDDoS `json:"result"` JSON settingAdvancedDDoSGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingalwaysonline.go b/zones/settingalwaysonline.go index 3d7e5e539c7..c141d346bea 100644 --- a/zones/settingalwaysonline.go +++ b/zones/settingalwaysonline.go @@ -38,7 +38,7 @@ func NewSettingAlwaysOnlineService(opts ...option.RequestOption) (r *SettingAlwa // offline. Refer to // [Always Online](https://developers.cloudflare.com/cache/about/always-online) for // more information. -func (r *SettingAlwaysOnlineService) Edit(ctx context.Context, params SettingAlwaysOnlineEditParams, opts ...option.RequestOption) (res *ZoneSettingAlwaysOnline, err error) { +func (r *SettingAlwaysOnlineService) Edit(ctx context.Context, params SettingAlwaysOnlineEditParams, opts ...option.RequestOption) (res *AlwaysOnline, err error) { opts = append(r.Options[:], opts...) var env SettingAlwaysOnlineEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/always_online", params.ZoneID) @@ -55,7 +55,7 @@ func (r *SettingAlwaysOnlineService) Edit(ctx context.Context, params SettingAlw // offline. Refer to // [Always Online](https://developers.cloudflare.com/cache/about/always-online) for // more information. -func (r *SettingAlwaysOnlineService) Get(ctx context.Context, query SettingAlwaysOnlineGetParams, opts ...option.RequestOption) (res *ZoneSettingAlwaysOnline, err error) { +func (r *SettingAlwaysOnlineService) Get(ctx context.Context, query SettingAlwaysOnlineGetParams, opts ...option.RequestOption) (res *AlwaysOnline, err error) { opts = append(r.Options[:], opts...) var env SettingAlwaysOnlineGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/always_online", query.ZoneID) @@ -72,22 +72,21 @@ func (r *SettingAlwaysOnlineService) Get(ctx context.Context, query SettingAlway // offline. Refer to // [Always Online](https://developers.cloudflare.com/cache/about/always-online) for // more information. -type ZoneSettingAlwaysOnline struct { +type AlwaysOnline struct { // ID of the zone setting. - ID ZoneSettingAlwaysOnlineID `json:"id,required"` + ID AlwaysOnlineID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingAlwaysOnlineValue `json:"value,required"` + Value AlwaysOnlineValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingAlwaysOnlineEditable `json:"editable"` + Editable AlwaysOnlineEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingAlwaysOnlineJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON alwaysOnlineJSON `json:"-"` } -// zoneSettingAlwaysOnlineJSON contains the JSON metadata for the struct -// [ZoneSettingAlwaysOnline] -type zoneSettingAlwaysOnlineJSON struct { +// alwaysOnlineJSON contains the JSON metadata for the struct [AlwaysOnline] +type alwaysOnlineJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -96,40 +95,40 @@ type zoneSettingAlwaysOnlineJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingAlwaysOnline) UnmarshalJSON(data []byte) (err error) { +func (r *AlwaysOnline) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingAlwaysOnlineJSON) RawJSON() string { +func (r alwaysOnlineJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingAlwaysOnlineID string +type AlwaysOnlineID string const ( - ZoneSettingAlwaysOnlineIDAlwaysOnline ZoneSettingAlwaysOnlineID = "always_online" + AlwaysOnlineIDAlwaysOnline AlwaysOnlineID = "always_online" ) -func (r ZoneSettingAlwaysOnlineID) IsKnown() bool { +func (r AlwaysOnlineID) IsKnown() bool { switch r { - case ZoneSettingAlwaysOnlineIDAlwaysOnline: + case AlwaysOnlineIDAlwaysOnline: return true } return false } // Current value of the zone setting. -type ZoneSettingAlwaysOnlineValue string +type AlwaysOnlineValue string const ( - ZoneSettingAlwaysOnlineValueOn ZoneSettingAlwaysOnlineValue = "on" - ZoneSettingAlwaysOnlineValueOff ZoneSettingAlwaysOnlineValue = "off" + AlwaysOnlineValueOn AlwaysOnlineValue = "on" + AlwaysOnlineValueOff AlwaysOnlineValue = "off" ) -func (r ZoneSettingAlwaysOnlineValue) IsKnown() bool { +func (r AlwaysOnlineValue) IsKnown() bool { switch r { - case ZoneSettingAlwaysOnlineValueOn, ZoneSettingAlwaysOnlineValueOff: + case AlwaysOnlineValueOn, AlwaysOnlineValueOff: return true } return false @@ -137,16 +136,16 @@ func (r ZoneSettingAlwaysOnlineValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingAlwaysOnlineEditable bool +type AlwaysOnlineEditable bool const ( - ZoneSettingAlwaysOnlineEditableTrue ZoneSettingAlwaysOnlineEditable = true - ZoneSettingAlwaysOnlineEditableFalse ZoneSettingAlwaysOnlineEditable = false + AlwaysOnlineEditableTrue AlwaysOnlineEditable = true + AlwaysOnlineEditableFalse AlwaysOnlineEditable = false ) -func (r ZoneSettingAlwaysOnlineEditable) IsKnown() bool { +func (r AlwaysOnlineEditable) IsKnown() bool { switch r { - case ZoneSettingAlwaysOnlineEditableTrue, ZoneSettingAlwaysOnlineEditableFalse: + case AlwaysOnlineEditableTrue, AlwaysOnlineEditableFalse: return true } return false @@ -189,7 +188,7 @@ type SettingAlwaysOnlineEditResponseEnvelope struct { // offline. Refer to // [Always Online](https://developers.cloudflare.com/cache/about/always-online) for // more information. - Result ZoneSettingAlwaysOnline `json:"result"` + Result AlwaysOnline `json:"result"` JSON settingAlwaysOnlineEditResponseEnvelopeJSON `json:"-"` } @@ -227,7 +226,7 @@ type SettingAlwaysOnlineGetResponseEnvelope struct { // offline. Refer to // [Always Online](https://developers.cloudflare.com/cache/about/always-online) for // more information. - Result ZoneSettingAlwaysOnline `json:"result"` + Result AlwaysOnline `json:"result"` JSON settingAlwaysOnlineGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingalwaysusehttps.go b/zones/settingalwaysusehttps.go index 3682b6c507f..53324a4c65f 100644 --- a/zones/settingalwaysusehttps.go +++ b/zones/settingalwaysusehttps.go @@ -36,7 +36,7 @@ func NewSettingAlwaysUseHTTPSService(opts ...option.RequestOption) (r *SettingAl // Reply to all requests for URLs that use "http" with a 301 redirect to the // equivalent "https" URL. If you only want to redirect for a subset of requests, // consider creating an "Always use HTTPS" page rule. -func (r *SettingAlwaysUseHTTPSService) Edit(ctx context.Context, params SettingAlwaysUseHTTPSEditParams, opts ...option.RequestOption) (res *ZoneSettingAlwaysUseHTTPS, err error) { +func (r *SettingAlwaysUseHTTPSService) Edit(ctx context.Context, params SettingAlwaysUseHTTPSEditParams, opts ...option.RequestOption) (res *AlwaysUseHTTPS, err error) { opts = append(r.Options[:], opts...) var env SettingAlwaysUseHTTPSEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/always_use_https", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingAlwaysUseHTTPSService) Edit(ctx context.Context, params SettingA // Reply to all requests for URLs that use "http" with a 301 redirect to the // equivalent "https" URL. If you only want to redirect for a subset of requests, // consider creating an "Always use HTTPS" page rule. -func (r *SettingAlwaysUseHTTPSService) Get(ctx context.Context, query SettingAlwaysUseHTTPSGetParams, opts ...option.RequestOption) (res *ZoneSettingAlwaysUseHTTPS, err error) { +func (r *SettingAlwaysUseHTTPSService) Get(ctx context.Context, query SettingAlwaysUseHTTPSGetParams, opts ...option.RequestOption) (res *AlwaysUseHTTPS, err error) { opts = append(r.Options[:], opts...) var env SettingAlwaysUseHTTPSGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/always_use_https", query.ZoneID) @@ -66,22 +66,21 @@ func (r *SettingAlwaysUseHTTPSService) Get(ctx context.Context, query SettingAlw // Reply to all requests for URLs that use "http" with a 301 redirect to the // equivalent "https" URL. If you only want to redirect for a subset of requests, // consider creating an "Always use HTTPS" page rule. -type ZoneSettingAlwaysUseHTTPS struct { +type AlwaysUseHTTPS struct { // ID of the zone setting. - ID ZoneSettingAlwaysUseHTTPSID `json:"id,required"` + ID AlwaysUseHTTPSID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingAlwaysUseHTTPSValue `json:"value,required"` + Value AlwaysUseHTTPSValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingAlwaysUseHTTPSEditable `json:"editable"` + Editable AlwaysUseHTTPSEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingAlwaysUseHTTPSJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON alwaysUseHTTPSJSON `json:"-"` } -// zoneSettingAlwaysUseHTTPSJSON contains the JSON metadata for the struct -// [ZoneSettingAlwaysUseHTTPS] -type zoneSettingAlwaysUseHTTPSJSON struct { +// alwaysUseHTTPSJSON contains the JSON metadata for the struct [AlwaysUseHTTPS] +type alwaysUseHTTPSJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -90,40 +89,40 @@ type zoneSettingAlwaysUseHTTPSJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingAlwaysUseHTTPS) UnmarshalJSON(data []byte) (err error) { +func (r *AlwaysUseHTTPS) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingAlwaysUseHTTPSJSON) RawJSON() string { +func (r alwaysUseHTTPSJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingAlwaysUseHTTPSID string +type AlwaysUseHTTPSID string const ( - ZoneSettingAlwaysUseHTTPSIDAlwaysUseHTTPS ZoneSettingAlwaysUseHTTPSID = "always_use_https" + AlwaysUseHTTPSIDAlwaysUseHTTPS AlwaysUseHTTPSID = "always_use_https" ) -func (r ZoneSettingAlwaysUseHTTPSID) IsKnown() bool { +func (r AlwaysUseHTTPSID) IsKnown() bool { switch r { - case ZoneSettingAlwaysUseHTTPSIDAlwaysUseHTTPS: + case AlwaysUseHTTPSIDAlwaysUseHTTPS: return true } return false } // Current value of the zone setting. -type ZoneSettingAlwaysUseHTTPSValue string +type AlwaysUseHTTPSValue string const ( - ZoneSettingAlwaysUseHTTPSValueOn ZoneSettingAlwaysUseHTTPSValue = "on" - ZoneSettingAlwaysUseHTTPSValueOff ZoneSettingAlwaysUseHTTPSValue = "off" + AlwaysUseHTTPSValueOn AlwaysUseHTTPSValue = "on" + AlwaysUseHTTPSValueOff AlwaysUseHTTPSValue = "off" ) -func (r ZoneSettingAlwaysUseHTTPSValue) IsKnown() bool { +func (r AlwaysUseHTTPSValue) IsKnown() bool { switch r { - case ZoneSettingAlwaysUseHTTPSValueOn, ZoneSettingAlwaysUseHTTPSValueOff: + case AlwaysUseHTTPSValueOn, AlwaysUseHTTPSValueOff: return true } return false @@ -131,16 +130,16 @@ func (r ZoneSettingAlwaysUseHTTPSValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingAlwaysUseHTTPSEditable bool +type AlwaysUseHTTPSEditable bool const ( - ZoneSettingAlwaysUseHTTPSEditableTrue ZoneSettingAlwaysUseHTTPSEditable = true - ZoneSettingAlwaysUseHTTPSEditableFalse ZoneSettingAlwaysUseHTTPSEditable = false + AlwaysUseHTTPSEditableTrue AlwaysUseHTTPSEditable = true + AlwaysUseHTTPSEditableFalse AlwaysUseHTTPSEditable = false ) -func (r ZoneSettingAlwaysUseHTTPSEditable) IsKnown() bool { +func (r AlwaysUseHTTPSEditable) IsKnown() bool { switch r { - case ZoneSettingAlwaysUseHTTPSEditableTrue, ZoneSettingAlwaysUseHTTPSEditableFalse: + case AlwaysUseHTTPSEditableTrue, AlwaysUseHTTPSEditableFalse: return true } return false @@ -181,7 +180,7 @@ type SettingAlwaysUseHTTPSEditResponseEnvelope struct { // Reply to all requests for URLs that use "http" with a 301 redirect to the // equivalent "https" URL. If you only want to redirect for a subset of requests, // consider creating an "Always use HTTPS" page rule. - Result ZoneSettingAlwaysUseHTTPS `json:"result"` + Result AlwaysUseHTTPS `json:"result"` JSON settingAlwaysUseHTTPSEditResponseEnvelopeJSON `json:"-"` } @@ -217,7 +216,7 @@ type SettingAlwaysUseHTTPSGetResponseEnvelope struct { // Reply to all requests for URLs that use "http" with a 301 redirect to the // equivalent "https" URL. If you only want to redirect for a subset of requests, // consider creating an "Always use HTTPS" page rule. - Result ZoneSettingAlwaysUseHTTPS `json:"result"` + Result AlwaysUseHTTPS `json:"result"` JSON settingAlwaysUseHTTPSGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingautomatichttpsrewrite.go b/zones/settingautomatichttpsrewrite.go index 0f443b81bfb..b336a1851af 100644 --- a/zones/settingautomatichttpsrewrite.go +++ b/zones/settingautomatichttpsrewrite.go @@ -34,7 +34,7 @@ func NewSettingAutomaticHTTPSRewriteService(opts ...option.RequestOption) (r *Se } // Enable the Automatic HTTPS Rewrites feature for this zone. -func (r *SettingAutomaticHTTPSRewriteService) Edit(ctx context.Context, params SettingAutomaticHTTPSRewriteEditParams, opts ...option.RequestOption) (res *ZoneSettingAutomaticHTTPSRewrites, err error) { +func (r *SettingAutomaticHTTPSRewriteService) Edit(ctx context.Context, params SettingAutomaticHTTPSRewriteEditParams, opts ...option.RequestOption) (res *AutomaticHTTPSRewrites, err error) { opts = append(r.Options[:], opts...) var env SettingAutomaticHTTPSRewriteEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/automatic_https_rewrites", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingAutomaticHTTPSRewriteService) Edit(ctx context.Context, params S } // Enable the Automatic HTTPS Rewrites feature for this zone. -func (r *SettingAutomaticHTTPSRewriteService) Get(ctx context.Context, query SettingAutomaticHTTPSRewriteGetParams, opts ...option.RequestOption) (res *ZoneSettingAutomaticHTTPSRewrites, err error) { +func (r *SettingAutomaticHTTPSRewriteService) Get(ctx context.Context, query SettingAutomaticHTTPSRewriteGetParams, opts ...option.RequestOption) (res *AutomaticHTTPSRewrites, err error) { opts = append(r.Options[:], opts...) var env SettingAutomaticHTTPSRewriteGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/automatic_https_rewrites", query.ZoneID) @@ -60,22 +60,22 @@ func (r *SettingAutomaticHTTPSRewriteService) Get(ctx context.Context, query Set } // Enable the Automatic HTTPS Rewrites feature for this zone. -type ZoneSettingAutomaticHTTPSRewrites struct { +type AutomaticHTTPSRewrites struct { // ID of the zone setting. - ID ZoneSettingAutomaticHTTPSRewritesID `json:"id,required"` + ID AutomaticHTTPSRewritesID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingAutomaticHTTPSRewritesValue `json:"value,required"` + Value AutomaticHTTPSRewritesValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingAutomaticHTTPSRewritesEditable `json:"editable"` + Editable AutomaticHTTPSRewritesEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingAutomaticHTTPSRewritesJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON automaticHTTPSRewritesJSON `json:"-"` } -// zoneSettingAutomaticHTTPSRewritesJSON contains the JSON metadata for the struct -// [ZoneSettingAutomaticHTTPSRewrites] -type zoneSettingAutomaticHTTPSRewritesJSON struct { +// automaticHTTPSRewritesJSON contains the JSON metadata for the struct +// [AutomaticHTTPSRewrites] +type automaticHTTPSRewritesJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,40 +84,40 @@ type zoneSettingAutomaticHTTPSRewritesJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingAutomaticHTTPSRewrites) UnmarshalJSON(data []byte) (err error) { +func (r *AutomaticHTTPSRewrites) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingAutomaticHTTPSRewritesJSON) RawJSON() string { +func (r automaticHTTPSRewritesJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingAutomaticHTTPSRewritesID string +type AutomaticHTTPSRewritesID string const ( - ZoneSettingAutomaticHTTPSRewritesIDAutomaticHTTPSRewrites ZoneSettingAutomaticHTTPSRewritesID = "automatic_https_rewrites" + AutomaticHTTPSRewritesIDAutomaticHTTPSRewrites AutomaticHTTPSRewritesID = "automatic_https_rewrites" ) -func (r ZoneSettingAutomaticHTTPSRewritesID) IsKnown() bool { +func (r AutomaticHTTPSRewritesID) IsKnown() bool { switch r { - case ZoneSettingAutomaticHTTPSRewritesIDAutomaticHTTPSRewrites: + case AutomaticHTTPSRewritesIDAutomaticHTTPSRewrites: return true } return false } // Current value of the zone setting. -type ZoneSettingAutomaticHTTPSRewritesValue string +type AutomaticHTTPSRewritesValue string const ( - ZoneSettingAutomaticHTTPSRewritesValueOn ZoneSettingAutomaticHTTPSRewritesValue = "on" - ZoneSettingAutomaticHTTPSRewritesValueOff ZoneSettingAutomaticHTTPSRewritesValue = "off" + AutomaticHTTPSRewritesValueOn AutomaticHTTPSRewritesValue = "on" + AutomaticHTTPSRewritesValueOff AutomaticHTTPSRewritesValue = "off" ) -func (r ZoneSettingAutomaticHTTPSRewritesValue) IsKnown() bool { +func (r AutomaticHTTPSRewritesValue) IsKnown() bool { switch r { - case ZoneSettingAutomaticHTTPSRewritesValueOn, ZoneSettingAutomaticHTTPSRewritesValueOff: + case AutomaticHTTPSRewritesValueOn, AutomaticHTTPSRewritesValueOff: return true } return false @@ -125,16 +125,16 @@ func (r ZoneSettingAutomaticHTTPSRewritesValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingAutomaticHTTPSRewritesEditable bool +type AutomaticHTTPSRewritesEditable bool const ( - ZoneSettingAutomaticHTTPSRewritesEditableTrue ZoneSettingAutomaticHTTPSRewritesEditable = true - ZoneSettingAutomaticHTTPSRewritesEditableFalse ZoneSettingAutomaticHTTPSRewritesEditable = false + AutomaticHTTPSRewritesEditableTrue AutomaticHTTPSRewritesEditable = true + AutomaticHTTPSRewritesEditableFalse AutomaticHTTPSRewritesEditable = false ) -func (r ZoneSettingAutomaticHTTPSRewritesEditable) IsKnown() bool { +func (r AutomaticHTTPSRewritesEditable) IsKnown() bool { switch r { - case ZoneSettingAutomaticHTTPSRewritesEditableTrue, ZoneSettingAutomaticHTTPSRewritesEditableFalse: + case AutomaticHTTPSRewritesEditableTrue, AutomaticHTTPSRewritesEditableFalse: return true } return false @@ -175,7 +175,7 @@ type SettingAutomaticHTTPSRewriteEditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enable the Automatic HTTPS Rewrites feature for this zone. - Result ZoneSettingAutomaticHTTPSRewrites `json:"result"` + Result AutomaticHTTPSRewrites `json:"result"` JSON settingAutomaticHTTPSRewriteEditResponseEnvelopeJSON `json:"-"` } @@ -209,7 +209,7 @@ type SettingAutomaticHTTPSRewriteGetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enable the Automatic HTTPS Rewrites feature for this zone. - Result ZoneSettingAutomaticHTTPSRewrites `json:"result"` + Result AutomaticHTTPSRewrites `json:"result"` JSON settingAutomaticHTTPSRewriteGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingautomaticplatformoptimization.go b/zones/settingautomaticplatformoptimization.go index f20f752f0ed..6df3d92049c 100644 --- a/zones/settingautomaticplatformoptimization.go +++ b/zones/settingautomaticplatformoptimization.go @@ -36,7 +36,7 @@ func NewSettingAutomaticPlatformOptimizationService(opts ...option.RequestOption // [Automatic Platform Optimization for WordPress](https://developers.cloudflare.com/automatic-platform-optimization/) // serves your WordPress site from Cloudflare's edge network and caches third-party // fonts. -func (r *SettingAutomaticPlatformOptimizationService) Edit(ctx context.Context, params SettingAutomaticPlatformOptimizationEditParams, opts ...option.RequestOption) (res *ZoneSettingAutomaticPlatformOptimization, err error) { +func (r *SettingAutomaticPlatformOptimizationService) Edit(ctx context.Context, params SettingAutomaticPlatformOptimizationEditParams, opts ...option.RequestOption) (res *AutomaticPlatformOptimization, err error) { opts = append(r.Options[:], opts...) var env SettingAutomaticPlatformOptimizationEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/automatic_platform_optimization", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingAutomaticPlatformOptimizationService) Edit(ctx context.Context, // [Automatic Platform Optimization for WordPress](https://developers.cloudflare.com/automatic-platform-optimization/) // serves your WordPress site from Cloudflare's edge network and caches third-party // fonts. -func (r *SettingAutomaticPlatformOptimizationService) Get(ctx context.Context, query SettingAutomaticPlatformOptimizationGetParams, opts ...option.RequestOption) (res *ZoneSettingAutomaticPlatformOptimization, err error) { +func (r *SettingAutomaticPlatformOptimizationService) Get(ctx context.Context, query SettingAutomaticPlatformOptimizationGetParams, opts ...option.RequestOption) (res *AutomaticPlatformOptimization, err error) { opts = append(r.Options[:], opts...) var env SettingAutomaticPlatformOptimizationGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/automatic_platform_optimization", query.ZoneID) @@ -63,7 +63,7 @@ func (r *SettingAutomaticPlatformOptimizationService) Get(ctx context.Context, q return } -type ZoneSettingAutomaticPlatformOptimization struct { +type AutomaticPlatformOptimization struct { // Indicates whether or not // [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) // is enabled. @@ -80,13 +80,13 @@ type ZoneSettingAutomaticPlatformOptimization struct { // Indicates whether or not // [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is // installed. - WpPlugin bool `json:"wp_plugin,required"` - JSON zoneSettingAutomaticPlatformOptimizationJSON `json:"-"` + WpPlugin bool `json:"wp_plugin,required"` + JSON automaticPlatformOptimizationJSON `json:"-"` } -// zoneSettingAutomaticPlatformOptimizationJSON contains the JSON metadata for the -// struct [ZoneSettingAutomaticPlatformOptimization] -type zoneSettingAutomaticPlatformOptimizationJSON struct { +// automaticPlatformOptimizationJSON contains the JSON metadata for the struct +// [AutomaticPlatformOptimization] +type automaticPlatformOptimizationJSON struct { CacheByDeviceType apijson.Field Cf apijson.Field Enabled apijson.Field @@ -97,15 +97,15 @@ type zoneSettingAutomaticPlatformOptimizationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingAutomaticPlatformOptimization) UnmarshalJSON(data []byte) (err error) { +func (r *AutomaticPlatformOptimization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingAutomaticPlatformOptimizationJSON) RawJSON() string { +func (r automaticPlatformOptimizationJSON) RawJSON() string { return r.raw } -type ZoneSettingAutomaticPlatformOptimizationParam struct { +type AutomaticPlatformOptimizationParam struct { // Indicates whether or not // [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) // is enabled. @@ -125,14 +125,14 @@ type ZoneSettingAutomaticPlatformOptimizationParam struct { WpPlugin param.Field[bool] `json:"wp_plugin,required"` } -func (r ZoneSettingAutomaticPlatformOptimizationParam) MarshalJSON() (data []byte, err error) { +func (r AutomaticPlatformOptimizationParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } type SettingAutomaticPlatformOptimizationEditParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` - Value param.Field[ZoneSettingAutomaticPlatformOptimizationParam] `json:"value,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Value param.Field[AutomaticPlatformOptimizationParam] `json:"value,required"` } func (r SettingAutomaticPlatformOptimizationEditParams) MarshalJSON() (data []byte, err error) { @@ -144,7 +144,7 @@ type SettingAutomaticPlatformOptimizationEditResponseEnvelope struct { Messages []shared.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72 `json:"messages,required"` // Whether the API call was successful Success bool `json:"success,required"` - Result ZoneSettingAutomaticPlatformOptimization `json:"result"` + Result AutomaticPlatformOptimization `json:"result"` JSON settingAutomaticPlatformOptimizationEditResponseEnvelopeJSON `json:"-"` } @@ -178,7 +178,7 @@ type SettingAutomaticPlatformOptimizationGetResponseEnvelope struct { Messages []shared.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72 `json:"messages,required"` // Whether the API call was successful Success bool `json:"success,required"` - Result ZoneSettingAutomaticPlatformOptimization `json:"result"` + Result AutomaticPlatformOptimization `json:"result"` JSON settingAutomaticPlatformOptimizationGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingautomaticplatformoptimization_test.go b/zones/settingautomaticplatformoptimization_test.go index adfed42c435..5613e836463 100644 --- a/zones/settingautomaticplatformoptimization_test.go +++ b/zones/settingautomaticplatformoptimization_test.go @@ -30,7 +30,7 @@ func TestSettingAutomaticPlatformOptimizationEdit(t *testing.T) { ) _, err := client.Zones.Settings.AutomaticPlatformOptimization.Edit(context.TODO(), zones.SettingAutomaticPlatformOptimizationEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingAutomaticPlatformOptimizationParam{ + Value: cloudflare.F(zones.AutomaticPlatformOptimizationParam{ CacheByDeviceType: cloudflare.F(false), Cf: cloudflare.F(true), Enabled: cloudflare.F(true), diff --git a/zones/settingbrotli.go b/zones/settingbrotli.go index 0208e518ff4..b424ff2e184 100644 --- a/zones/settingbrotli.go +++ b/zones/settingbrotli.go @@ -35,7 +35,7 @@ func NewSettingBrotliService(opts ...option.RequestOption) (r *SettingBrotliServ // When the client requesting an asset supports the Brotli compression algorithm, // Cloudflare will serve a Brotli compressed version of the asset. -func (r *SettingBrotliService) Edit(ctx context.Context, params SettingBrotliEditParams, opts ...option.RequestOption) (res *ZoneSettingBrotli, err error) { +func (r *SettingBrotliService) Edit(ctx context.Context, params SettingBrotliEditParams, opts ...option.RequestOption) (res *Brotli, err error) { opts = append(r.Options[:], opts...) var env SettingBrotliEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/brotli", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingBrotliService) Edit(ctx context.Context, params SettingBrotliEdi // When the client requesting an asset supports the Brotli compression algorithm, // Cloudflare will serve a Brotli compressed version of the asset. -func (r *SettingBrotliService) Get(ctx context.Context, query SettingBrotliGetParams, opts ...option.RequestOption) (res *ZoneSettingBrotli, err error) { +func (r *SettingBrotliService) Get(ctx context.Context, query SettingBrotliGetParams, opts ...option.RequestOption) (res *Brotli, err error) { opts = append(r.Options[:], opts...) var env SettingBrotliGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/brotli", query.ZoneID) @@ -63,22 +63,21 @@ func (r *SettingBrotliService) Get(ctx context.Context, query SettingBrotliGetPa // When the client requesting an asset supports the Brotli compression algorithm, // Cloudflare will serve a Brotli compressed version of the asset. -type ZoneSettingBrotli struct { +type Brotli struct { // ID of the zone setting. - ID ZoneSettingBrotliID `json:"id,required"` + ID BrotliID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingBrotliValue `json:"value,required"` + Value BrotliValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingBrotliEditable `json:"editable"` + Editable BrotliEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingBrotliJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON brotliJSON `json:"-"` } -// zoneSettingBrotliJSON contains the JSON metadata for the struct -// [ZoneSettingBrotli] -type zoneSettingBrotliJSON struct { +// brotliJSON contains the JSON metadata for the struct [Brotli] +type brotliJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +86,40 @@ type zoneSettingBrotliJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingBrotli) UnmarshalJSON(data []byte) (err error) { +func (r *Brotli) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingBrotliJSON) RawJSON() string { +func (r brotliJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingBrotliID string +type BrotliID string const ( - ZoneSettingBrotliIDBrotli ZoneSettingBrotliID = "brotli" + BrotliIDBrotli BrotliID = "brotli" ) -func (r ZoneSettingBrotliID) IsKnown() bool { +func (r BrotliID) IsKnown() bool { switch r { - case ZoneSettingBrotliIDBrotli: + case BrotliIDBrotli: return true } return false } // Current value of the zone setting. -type ZoneSettingBrotliValue string +type BrotliValue string const ( - ZoneSettingBrotliValueOff ZoneSettingBrotliValue = "off" - ZoneSettingBrotliValueOn ZoneSettingBrotliValue = "on" + BrotliValueOff BrotliValue = "off" + BrotliValueOn BrotliValue = "on" ) -func (r ZoneSettingBrotliValue) IsKnown() bool { +func (r BrotliValue) IsKnown() bool { switch r { - case ZoneSettingBrotliValueOff, ZoneSettingBrotliValueOn: + case BrotliValueOff, BrotliValueOn: return true } return false @@ -128,16 +127,16 @@ func (r ZoneSettingBrotliValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingBrotliEditable bool +type BrotliEditable bool const ( - ZoneSettingBrotliEditableTrue ZoneSettingBrotliEditable = true - ZoneSettingBrotliEditableFalse ZoneSettingBrotliEditable = false + BrotliEditableTrue BrotliEditable = true + BrotliEditableFalse BrotliEditable = false ) -func (r ZoneSettingBrotliEditable) IsKnown() bool { +func (r BrotliEditable) IsKnown() bool { switch r { - case ZoneSettingBrotliEditableTrue, ZoneSettingBrotliEditableFalse: + case BrotliEditableTrue, BrotliEditableFalse: return true } return false @@ -177,7 +176,7 @@ type SettingBrotliEditResponseEnvelope struct { Success bool `json:"success,required"` // When the client requesting an asset supports the Brotli compression algorithm, // Cloudflare will serve a Brotli compressed version of the asset. - Result ZoneSettingBrotli `json:"result"` + Result Brotli `json:"result"` JSON settingBrotliEditResponseEnvelopeJSON `json:"-"` } @@ -212,7 +211,7 @@ type SettingBrotliGetResponseEnvelope struct { Success bool `json:"success,required"` // When the client requesting an asset supports the Brotli compression algorithm, // Cloudflare will serve a Brotli compressed version of the asset. - Result ZoneSettingBrotli `json:"result"` + Result Brotli `json:"result"` JSON settingBrotliGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingbrowsercachettl.go b/zones/settingbrowsercachettl.go index 99e18a6d0fd..3149ccbd5f2 100644 --- a/zones/settingbrowsercachettl.go +++ b/zones/settingbrowsercachettl.go @@ -37,7 +37,7 @@ func NewSettingBrowserCacheTTLService(opts ...option.RequestOption) (r *SettingB // will remain on your visitors' computers. Cloudflare will honor any larger times // specified by your server. // (https://support.cloudflare.com/hc/en-us/articles/200168276). -func (r *SettingBrowserCacheTTLService) Edit(ctx context.Context, params SettingBrowserCacheTTLEditParams, opts ...option.RequestOption) (res *ZoneSettingBrowserCacheTTL, err error) { +func (r *SettingBrowserCacheTTLService) Edit(ctx context.Context, params SettingBrowserCacheTTLEditParams, opts ...option.RequestOption) (res *BrowserCacheTTL, err error) { opts = append(r.Options[:], opts...) var env SettingBrowserCacheTTLEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/browser_cache_ttl", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingBrowserCacheTTLService) Edit(ctx context.Context, params Setting // will remain on your visitors' computers. Cloudflare will honor any larger times // specified by your server. // (https://support.cloudflare.com/hc/en-us/articles/200168276). -func (r *SettingBrowserCacheTTLService) Get(ctx context.Context, query SettingBrowserCacheTTLGetParams, opts ...option.RequestOption) (res *ZoneSettingBrowserCacheTTL, err error) { +func (r *SettingBrowserCacheTTLService) Get(ctx context.Context, query SettingBrowserCacheTTLGetParams, opts ...option.RequestOption) (res *BrowserCacheTTL, err error) { opts = append(r.Options[:], opts...) var env SettingBrowserCacheTTLGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/browser_cache_ttl", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingBrowserCacheTTLService) Get(ctx context.Context, query SettingBr // will remain on your visitors' computers. Cloudflare will honor any larger times // specified by your server. // (https://support.cloudflare.com/hc/en-us/articles/200168276). -type ZoneSettingBrowserCacheTTL struct { +type BrowserCacheTTL struct { // ID of the zone setting. - ID ZoneSettingBrowserCacheTTLID `json:"id,required"` + ID BrowserCacheTTLID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingBrowserCacheTTLValue `json:"value,required"` + Value BrowserCacheTTLValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingBrowserCacheTTLEditable `json:"editable"` + Editable BrowserCacheTTLEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingBrowserCacheTTLJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON browserCacheTTLJSON `json:"-"` } -// zoneSettingBrowserCacheTTLJSON contains the JSON metadata for the struct -// [ZoneSettingBrowserCacheTTL] -type zoneSettingBrowserCacheTTLJSON struct { +// browserCacheTTLJSON contains the JSON metadata for the struct [BrowserCacheTTL] +type browserCacheTTLJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,66 +92,66 @@ type zoneSettingBrowserCacheTTLJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingBrowserCacheTTL) UnmarshalJSON(data []byte) (err error) { +func (r *BrowserCacheTTL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingBrowserCacheTTLJSON) RawJSON() string { +func (r browserCacheTTLJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingBrowserCacheTTLID string +type BrowserCacheTTLID string const ( - ZoneSettingBrowserCacheTTLIDBrowserCacheTTL ZoneSettingBrowserCacheTTLID = "browser_cache_ttl" + BrowserCacheTTLIDBrowserCacheTTL BrowserCacheTTLID = "browser_cache_ttl" ) -func (r ZoneSettingBrowserCacheTTLID) IsKnown() bool { +func (r BrowserCacheTTLID) IsKnown() bool { switch r { - case ZoneSettingBrowserCacheTTLIDBrowserCacheTTL: + case BrowserCacheTTLIDBrowserCacheTTL: return true } return false } // Current value of the zone setting. -type ZoneSettingBrowserCacheTTLValue float64 +type BrowserCacheTTLValue float64 const ( - ZoneSettingBrowserCacheTTLValue0 ZoneSettingBrowserCacheTTLValue = 0 - ZoneSettingBrowserCacheTTLValue30 ZoneSettingBrowserCacheTTLValue = 30 - ZoneSettingBrowserCacheTTLValue60 ZoneSettingBrowserCacheTTLValue = 60 - ZoneSettingBrowserCacheTTLValue120 ZoneSettingBrowserCacheTTLValue = 120 - ZoneSettingBrowserCacheTTLValue300 ZoneSettingBrowserCacheTTLValue = 300 - ZoneSettingBrowserCacheTTLValue1200 ZoneSettingBrowserCacheTTLValue = 1200 - ZoneSettingBrowserCacheTTLValue1800 ZoneSettingBrowserCacheTTLValue = 1800 - ZoneSettingBrowserCacheTTLValue3600 ZoneSettingBrowserCacheTTLValue = 3600 - ZoneSettingBrowserCacheTTLValue7200 ZoneSettingBrowserCacheTTLValue = 7200 - ZoneSettingBrowserCacheTTLValue10800 ZoneSettingBrowserCacheTTLValue = 10800 - ZoneSettingBrowserCacheTTLValue14400 ZoneSettingBrowserCacheTTLValue = 14400 - ZoneSettingBrowserCacheTTLValue18000 ZoneSettingBrowserCacheTTLValue = 18000 - ZoneSettingBrowserCacheTTLValue28800 ZoneSettingBrowserCacheTTLValue = 28800 - ZoneSettingBrowserCacheTTLValue43200 ZoneSettingBrowserCacheTTLValue = 43200 - ZoneSettingBrowserCacheTTLValue57600 ZoneSettingBrowserCacheTTLValue = 57600 - ZoneSettingBrowserCacheTTLValue72000 ZoneSettingBrowserCacheTTLValue = 72000 - ZoneSettingBrowserCacheTTLValue86400 ZoneSettingBrowserCacheTTLValue = 86400 - ZoneSettingBrowserCacheTTLValue172800 ZoneSettingBrowserCacheTTLValue = 172800 - ZoneSettingBrowserCacheTTLValue259200 ZoneSettingBrowserCacheTTLValue = 259200 - ZoneSettingBrowserCacheTTLValue345600 ZoneSettingBrowserCacheTTLValue = 345600 - ZoneSettingBrowserCacheTTLValue432000 ZoneSettingBrowserCacheTTLValue = 432000 - ZoneSettingBrowserCacheTTLValue691200 ZoneSettingBrowserCacheTTLValue = 691200 - ZoneSettingBrowserCacheTTLValue1382400 ZoneSettingBrowserCacheTTLValue = 1382400 - ZoneSettingBrowserCacheTTLValue2073600 ZoneSettingBrowserCacheTTLValue = 2073600 - ZoneSettingBrowserCacheTTLValue2678400 ZoneSettingBrowserCacheTTLValue = 2678400 - ZoneSettingBrowserCacheTTLValue5356800 ZoneSettingBrowserCacheTTLValue = 5356800 - ZoneSettingBrowserCacheTTLValue16070400 ZoneSettingBrowserCacheTTLValue = 16070400 - ZoneSettingBrowserCacheTTLValue31536000 ZoneSettingBrowserCacheTTLValue = 31536000 + BrowserCacheTTLValue0 BrowserCacheTTLValue = 0 + BrowserCacheTTLValue30 BrowserCacheTTLValue = 30 + BrowserCacheTTLValue60 BrowserCacheTTLValue = 60 + BrowserCacheTTLValue120 BrowserCacheTTLValue = 120 + BrowserCacheTTLValue300 BrowserCacheTTLValue = 300 + BrowserCacheTTLValue1200 BrowserCacheTTLValue = 1200 + BrowserCacheTTLValue1800 BrowserCacheTTLValue = 1800 + BrowserCacheTTLValue3600 BrowserCacheTTLValue = 3600 + BrowserCacheTTLValue7200 BrowserCacheTTLValue = 7200 + BrowserCacheTTLValue10800 BrowserCacheTTLValue = 10800 + BrowserCacheTTLValue14400 BrowserCacheTTLValue = 14400 + BrowserCacheTTLValue18000 BrowserCacheTTLValue = 18000 + BrowserCacheTTLValue28800 BrowserCacheTTLValue = 28800 + BrowserCacheTTLValue43200 BrowserCacheTTLValue = 43200 + BrowserCacheTTLValue57600 BrowserCacheTTLValue = 57600 + BrowserCacheTTLValue72000 BrowserCacheTTLValue = 72000 + BrowserCacheTTLValue86400 BrowserCacheTTLValue = 86400 + BrowserCacheTTLValue172800 BrowserCacheTTLValue = 172800 + BrowserCacheTTLValue259200 BrowserCacheTTLValue = 259200 + BrowserCacheTTLValue345600 BrowserCacheTTLValue = 345600 + BrowserCacheTTLValue432000 BrowserCacheTTLValue = 432000 + BrowserCacheTTLValue691200 BrowserCacheTTLValue = 691200 + BrowserCacheTTLValue1382400 BrowserCacheTTLValue = 1382400 + BrowserCacheTTLValue2073600 BrowserCacheTTLValue = 2073600 + BrowserCacheTTLValue2678400 BrowserCacheTTLValue = 2678400 + BrowserCacheTTLValue5356800 BrowserCacheTTLValue = 5356800 + BrowserCacheTTLValue16070400 BrowserCacheTTLValue = 16070400 + BrowserCacheTTLValue31536000 BrowserCacheTTLValue = 31536000 ) -func (r ZoneSettingBrowserCacheTTLValue) IsKnown() bool { +func (r BrowserCacheTTLValue) IsKnown() bool { switch r { - case ZoneSettingBrowserCacheTTLValue0, ZoneSettingBrowserCacheTTLValue30, ZoneSettingBrowserCacheTTLValue60, ZoneSettingBrowserCacheTTLValue120, ZoneSettingBrowserCacheTTLValue300, ZoneSettingBrowserCacheTTLValue1200, ZoneSettingBrowserCacheTTLValue1800, ZoneSettingBrowserCacheTTLValue3600, ZoneSettingBrowserCacheTTLValue7200, ZoneSettingBrowserCacheTTLValue10800, ZoneSettingBrowserCacheTTLValue14400, ZoneSettingBrowserCacheTTLValue18000, ZoneSettingBrowserCacheTTLValue28800, ZoneSettingBrowserCacheTTLValue43200, ZoneSettingBrowserCacheTTLValue57600, ZoneSettingBrowserCacheTTLValue72000, ZoneSettingBrowserCacheTTLValue86400, ZoneSettingBrowserCacheTTLValue172800, ZoneSettingBrowserCacheTTLValue259200, ZoneSettingBrowserCacheTTLValue345600, ZoneSettingBrowserCacheTTLValue432000, ZoneSettingBrowserCacheTTLValue691200, ZoneSettingBrowserCacheTTLValue1382400, ZoneSettingBrowserCacheTTLValue2073600, ZoneSettingBrowserCacheTTLValue2678400, ZoneSettingBrowserCacheTTLValue5356800, ZoneSettingBrowserCacheTTLValue16070400, ZoneSettingBrowserCacheTTLValue31536000: + case BrowserCacheTTLValue0, BrowserCacheTTLValue30, BrowserCacheTTLValue60, BrowserCacheTTLValue120, BrowserCacheTTLValue300, BrowserCacheTTLValue1200, BrowserCacheTTLValue1800, BrowserCacheTTLValue3600, BrowserCacheTTLValue7200, BrowserCacheTTLValue10800, BrowserCacheTTLValue14400, BrowserCacheTTLValue18000, BrowserCacheTTLValue28800, BrowserCacheTTLValue43200, BrowserCacheTTLValue57600, BrowserCacheTTLValue72000, BrowserCacheTTLValue86400, BrowserCacheTTLValue172800, BrowserCacheTTLValue259200, BrowserCacheTTLValue345600, BrowserCacheTTLValue432000, BrowserCacheTTLValue691200, BrowserCacheTTLValue1382400, BrowserCacheTTLValue2073600, BrowserCacheTTLValue2678400, BrowserCacheTTLValue5356800, BrowserCacheTTLValue16070400, BrowserCacheTTLValue31536000: return true } return false @@ -160,16 +159,16 @@ func (r ZoneSettingBrowserCacheTTLValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingBrowserCacheTTLEditable bool +type BrowserCacheTTLEditable bool const ( - ZoneSettingBrowserCacheTTLEditableTrue ZoneSettingBrowserCacheTTLEditable = true - ZoneSettingBrowserCacheTTLEditableFalse ZoneSettingBrowserCacheTTLEditable = false + BrowserCacheTTLEditableTrue BrowserCacheTTLEditable = true + BrowserCacheTTLEditableFalse BrowserCacheTTLEditable = false ) -func (r ZoneSettingBrowserCacheTTLEditable) IsKnown() bool { +func (r BrowserCacheTTLEditable) IsKnown() bool { switch r { - case ZoneSettingBrowserCacheTTLEditableTrue, ZoneSettingBrowserCacheTTLEditableFalse: + case BrowserCacheTTLEditableTrue, BrowserCacheTTLEditableFalse: return true } return false @@ -239,7 +238,7 @@ type SettingBrowserCacheTTLEditResponseEnvelope struct { // will remain on your visitors' computers. Cloudflare will honor any larger times // specified by your server. // (https://support.cloudflare.com/hc/en-us/articles/200168276). - Result ZoneSettingBrowserCacheTTL `json:"result"` + Result BrowserCacheTTL `json:"result"` JSON settingBrowserCacheTTLEditResponseEnvelopeJSON `json:"-"` } @@ -276,7 +275,7 @@ type SettingBrowserCacheTTLGetResponseEnvelope struct { // will remain on your visitors' computers. Cloudflare will honor any larger times // specified by your server. // (https://support.cloudflare.com/hc/en-us/articles/200168276). - Result ZoneSettingBrowserCacheTTL `json:"result"` + Result BrowserCacheTTL `json:"result"` JSON settingBrowserCacheTTLGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingbrowsercheck.go b/zones/settingbrowsercheck.go index 58c195616f0..a2d3195994a 100644 --- a/zones/settingbrowsercheck.go +++ b/zones/settingbrowsercheck.go @@ -38,7 +38,7 @@ func NewSettingBrowserCheckService(opts ...option.RequestOption) (r *SettingBrow // also challenge visitors that do not have a user agent or a non standard user // agent (also commonly used by abuse bots, crawlers or visitors). // (https://support.cloudflare.com/hc/en-us/articles/200170086). -func (r *SettingBrowserCheckService) Edit(ctx context.Context, params SettingBrowserCheckEditParams, opts ...option.RequestOption) (res *ZoneSettingBrowserCheck, err error) { +func (r *SettingBrowserCheckService) Edit(ctx context.Context, params SettingBrowserCheckEditParams, opts ...option.RequestOption) (res *BrowserCheck, err error) { opts = append(r.Options[:], opts...) var env SettingBrowserCheckEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/browser_check", params.ZoneID) @@ -55,7 +55,7 @@ func (r *SettingBrowserCheckService) Edit(ctx context.Context, params SettingBro // also challenge visitors that do not have a user agent or a non standard user // agent (also commonly used by abuse bots, crawlers or visitors). // (https://support.cloudflare.com/hc/en-us/articles/200170086). -func (r *SettingBrowserCheckService) Get(ctx context.Context, query SettingBrowserCheckGetParams, opts ...option.RequestOption) (res *ZoneSettingBrowserCheck, err error) { +func (r *SettingBrowserCheckService) Get(ctx context.Context, query SettingBrowserCheckGetParams, opts ...option.RequestOption) (res *BrowserCheck, err error) { opts = append(r.Options[:], opts...) var env SettingBrowserCheckGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/browser_check", query.ZoneID) @@ -72,22 +72,21 @@ func (r *SettingBrowserCheckService) Get(ctx context.Context, query SettingBrows // also challenge visitors that do not have a user agent or a non standard user // agent (also commonly used by abuse bots, crawlers or visitors). // (https://support.cloudflare.com/hc/en-us/articles/200170086). -type ZoneSettingBrowserCheck struct { +type BrowserCheck struct { // ID of the zone setting. - ID ZoneSettingBrowserCheckID `json:"id,required"` + ID BrowserCheckID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingBrowserCheckValue `json:"value,required"` + Value BrowserCheckValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingBrowserCheckEditable `json:"editable"` + Editable BrowserCheckEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingBrowserCheckJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON browserCheckJSON `json:"-"` } -// zoneSettingBrowserCheckJSON contains the JSON metadata for the struct -// [ZoneSettingBrowserCheck] -type zoneSettingBrowserCheckJSON struct { +// browserCheckJSON contains the JSON metadata for the struct [BrowserCheck] +type browserCheckJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -96,40 +95,40 @@ type zoneSettingBrowserCheckJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingBrowserCheck) UnmarshalJSON(data []byte) (err error) { +func (r *BrowserCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingBrowserCheckJSON) RawJSON() string { +func (r browserCheckJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingBrowserCheckID string +type BrowserCheckID string const ( - ZoneSettingBrowserCheckIDBrowserCheck ZoneSettingBrowserCheckID = "browser_check" + BrowserCheckIDBrowserCheck BrowserCheckID = "browser_check" ) -func (r ZoneSettingBrowserCheckID) IsKnown() bool { +func (r BrowserCheckID) IsKnown() bool { switch r { - case ZoneSettingBrowserCheckIDBrowserCheck: + case BrowserCheckIDBrowserCheck: return true } return false } // Current value of the zone setting. -type ZoneSettingBrowserCheckValue string +type BrowserCheckValue string const ( - ZoneSettingBrowserCheckValueOn ZoneSettingBrowserCheckValue = "on" - ZoneSettingBrowserCheckValueOff ZoneSettingBrowserCheckValue = "off" + BrowserCheckValueOn BrowserCheckValue = "on" + BrowserCheckValueOff BrowserCheckValue = "off" ) -func (r ZoneSettingBrowserCheckValue) IsKnown() bool { +func (r BrowserCheckValue) IsKnown() bool { switch r { - case ZoneSettingBrowserCheckValueOn, ZoneSettingBrowserCheckValueOff: + case BrowserCheckValueOn, BrowserCheckValueOff: return true } return false @@ -137,16 +136,16 @@ func (r ZoneSettingBrowserCheckValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingBrowserCheckEditable bool +type BrowserCheckEditable bool const ( - ZoneSettingBrowserCheckEditableTrue ZoneSettingBrowserCheckEditable = true - ZoneSettingBrowserCheckEditableFalse ZoneSettingBrowserCheckEditable = false + BrowserCheckEditableTrue BrowserCheckEditable = true + BrowserCheckEditableFalse BrowserCheckEditable = false ) -func (r ZoneSettingBrowserCheckEditable) IsKnown() bool { +func (r BrowserCheckEditable) IsKnown() bool { switch r { - case ZoneSettingBrowserCheckEditableTrue, ZoneSettingBrowserCheckEditableFalse: + case BrowserCheckEditableTrue, BrowserCheckEditableFalse: return true } return false @@ -189,7 +188,7 @@ type SettingBrowserCheckEditResponseEnvelope struct { // also challenge visitors that do not have a user agent or a non standard user // agent (also commonly used by abuse bots, crawlers or visitors). // (https://support.cloudflare.com/hc/en-us/articles/200170086). - Result ZoneSettingBrowserCheck `json:"result"` + Result BrowserCheck `json:"result"` JSON settingBrowserCheckEditResponseEnvelopeJSON `json:"-"` } @@ -227,7 +226,7 @@ type SettingBrowserCheckGetResponseEnvelope struct { // also challenge visitors that do not have a user agent or a non standard user // agent (also commonly used by abuse bots, crawlers or visitors). // (https://support.cloudflare.com/hc/en-us/articles/200170086). - Result ZoneSettingBrowserCheck `json:"result"` + Result BrowserCheck `json:"result"` JSON settingBrowserCheckGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingcachelevel.go b/zones/settingcachelevel.go index f0dd9072e0b..8ccfc475c05 100644 --- a/zones/settingcachelevel.go +++ b/zones/settingcachelevel.go @@ -38,7 +38,7 @@ func NewSettingCacheLevelService(opts ...option.RequestOption) (r *SettingCacheL // setting will ignore the query string when delivering a cached resource. The // aggressive setting will cache all static resources, including ones with a query // string. (https://support.cloudflare.com/hc/en-us/articles/200168256). -func (r *SettingCacheLevelService) Edit(ctx context.Context, params SettingCacheLevelEditParams, opts ...option.RequestOption) (res *ZoneSettingCacheLevel, err error) { +func (r *SettingCacheLevelService) Edit(ctx context.Context, params SettingCacheLevelEditParams, opts ...option.RequestOption) (res *CacheLevel, err error) { opts = append(r.Options[:], opts...) var env SettingCacheLevelEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/cache_level", params.ZoneID) @@ -55,7 +55,7 @@ func (r *SettingCacheLevelService) Edit(ctx context.Context, params SettingCache // setting will ignore the query string when delivering a cached resource. The // aggressive setting will cache all static resources, including ones with a query // string. (https://support.cloudflare.com/hc/en-us/articles/200168256). -func (r *SettingCacheLevelService) Get(ctx context.Context, query SettingCacheLevelGetParams, opts ...option.RequestOption) (res *ZoneSettingCacheLevel, err error) { +func (r *SettingCacheLevelService) Get(ctx context.Context, query SettingCacheLevelGetParams, opts ...option.RequestOption) (res *CacheLevel, err error) { opts = append(r.Options[:], opts...) var env SettingCacheLevelGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/cache_level", query.ZoneID) @@ -72,22 +72,21 @@ func (r *SettingCacheLevelService) Get(ctx context.Context, query SettingCacheLe // setting will ignore the query string when delivering a cached resource. The // aggressive setting will cache all static resources, including ones with a query // string. (https://support.cloudflare.com/hc/en-us/articles/200168256). -type ZoneSettingCacheLevel struct { +type CacheLevel struct { // ID of the zone setting. - ID ZoneSettingCacheLevelID `json:"id,required"` + ID CacheLevelID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingCacheLevelValue `json:"value,required"` + Value CacheLevelValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingCacheLevelEditable `json:"editable"` + Editable CacheLevelEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingCacheLevelJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON cacheLevelJSON `json:"-"` } -// zoneSettingCacheLevelJSON contains the JSON metadata for the struct -// [ZoneSettingCacheLevel] -type zoneSettingCacheLevelJSON struct { +// cacheLevelJSON contains the JSON metadata for the struct [CacheLevel] +type cacheLevelJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -96,41 +95,41 @@ type zoneSettingCacheLevelJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingCacheLevel) UnmarshalJSON(data []byte) (err error) { +func (r *CacheLevel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingCacheLevelJSON) RawJSON() string { +func (r cacheLevelJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingCacheLevelID string +type CacheLevelID string const ( - ZoneSettingCacheLevelIDCacheLevel ZoneSettingCacheLevelID = "cache_level" + CacheLevelIDCacheLevel CacheLevelID = "cache_level" ) -func (r ZoneSettingCacheLevelID) IsKnown() bool { +func (r CacheLevelID) IsKnown() bool { switch r { - case ZoneSettingCacheLevelIDCacheLevel: + case CacheLevelIDCacheLevel: return true } return false } // Current value of the zone setting. -type ZoneSettingCacheLevelValue string +type CacheLevelValue string const ( - ZoneSettingCacheLevelValueAggressive ZoneSettingCacheLevelValue = "aggressive" - ZoneSettingCacheLevelValueBasic ZoneSettingCacheLevelValue = "basic" - ZoneSettingCacheLevelValueSimplified ZoneSettingCacheLevelValue = "simplified" + CacheLevelValueAggressive CacheLevelValue = "aggressive" + CacheLevelValueBasic CacheLevelValue = "basic" + CacheLevelValueSimplified CacheLevelValue = "simplified" ) -func (r ZoneSettingCacheLevelValue) IsKnown() bool { +func (r CacheLevelValue) IsKnown() bool { switch r { - case ZoneSettingCacheLevelValueAggressive, ZoneSettingCacheLevelValueBasic, ZoneSettingCacheLevelValueSimplified: + case CacheLevelValueAggressive, CacheLevelValueBasic, CacheLevelValueSimplified: return true } return false @@ -138,16 +137,16 @@ func (r ZoneSettingCacheLevelValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingCacheLevelEditable bool +type CacheLevelEditable bool const ( - ZoneSettingCacheLevelEditableTrue ZoneSettingCacheLevelEditable = true - ZoneSettingCacheLevelEditableFalse ZoneSettingCacheLevelEditable = false + CacheLevelEditableTrue CacheLevelEditable = true + CacheLevelEditableFalse CacheLevelEditable = false ) -func (r ZoneSettingCacheLevelEditable) IsKnown() bool { +func (r CacheLevelEditable) IsKnown() bool { switch r { - case ZoneSettingCacheLevelEditableTrue, ZoneSettingCacheLevelEditableFalse: + case CacheLevelEditableTrue, CacheLevelEditableFalse: return true } return false @@ -191,7 +190,7 @@ type SettingCacheLevelEditResponseEnvelope struct { // setting will ignore the query string when delivering a cached resource. The // aggressive setting will cache all static resources, including ones with a query // string. (https://support.cloudflare.com/hc/en-us/articles/200168256). - Result ZoneSettingCacheLevel `json:"result"` + Result CacheLevel `json:"result"` JSON settingCacheLevelEditResponseEnvelopeJSON `json:"-"` } @@ -229,7 +228,7 @@ type SettingCacheLevelGetResponseEnvelope struct { // setting will ignore the query string when delivering a cached resource. The // aggressive setting will cache all static resources, including ones with a query // string. (https://support.cloudflare.com/hc/en-us/articles/200168256). - Result ZoneSettingCacheLevel `json:"result"` + Result CacheLevel `json:"result"` JSON settingCacheLevelGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingchallengettl.go b/zones/settingchallengettl.go index 12a72346725..2f19d9d1be9 100644 --- a/zones/settingchallengettl.go +++ b/zones/settingchallengettl.go @@ -38,7 +38,7 @@ func NewSettingChallengeTTLService(opts ...option.RequestOption) (r *SettingChal // visitor will have to complete a new challenge. We recommend a 15 - 45 minute // setting and will attempt to honor any setting above 45 minutes. // (https://support.cloudflare.com/hc/en-us/articles/200170136). -func (r *SettingChallengeTTLService) Edit(ctx context.Context, params SettingChallengeTTLEditParams, opts ...option.RequestOption) (res *ZoneSettingChallengeTTL, err error) { +func (r *SettingChallengeTTLService) Edit(ctx context.Context, params SettingChallengeTTLEditParams, opts ...option.RequestOption) (res *ChallengeTTL, err error) { opts = append(r.Options[:], opts...) var env SettingChallengeTTLEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/challenge_ttl", params.ZoneID) @@ -55,7 +55,7 @@ func (r *SettingChallengeTTLService) Edit(ctx context.Context, params SettingCha // visitor will have to complete a new challenge. We recommend a 15 - 45 minute // setting and will attempt to honor any setting above 45 minutes. // (https://support.cloudflare.com/hc/en-us/articles/200170136). -func (r *SettingChallengeTTLService) Get(ctx context.Context, query SettingChallengeTTLGetParams, opts ...option.RequestOption) (res *ZoneSettingChallengeTTL, err error) { +func (r *SettingChallengeTTLService) Get(ctx context.Context, query SettingChallengeTTLGetParams, opts ...option.RequestOption) (res *ChallengeTTL, err error) { opts = append(r.Options[:], opts...) var env SettingChallengeTTLGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/challenge_ttl", query.ZoneID) @@ -72,22 +72,21 @@ func (r *SettingChallengeTTLService) Get(ctx context.Context, query SettingChall // visitor will have to complete a new challenge. We recommend a 15 - 45 minute // setting and will attempt to honor any setting above 45 minutes. // (https://support.cloudflare.com/hc/en-us/articles/200170136). -type ZoneSettingChallengeTTL struct { +type ChallengeTTL struct { // ID of the zone setting. - ID ZoneSettingChallengeTTLID `json:"id,required"` + ID ChallengeTTLID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingChallengeTTLValue `json:"value,required"` + Value ChallengeTTLValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingChallengeTTLEditable `json:"editable"` + Editable ChallengeTTLEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingChallengeTTLJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON challengeTTLJSON `json:"-"` } -// zoneSettingChallengeTTLJSON contains the JSON metadata for the struct -// [ZoneSettingChallengeTTL] -type zoneSettingChallengeTTLJSON struct { +// challengeTTLJSON contains the JSON metadata for the struct [ChallengeTTL] +type challengeTTLJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -96,52 +95,52 @@ type zoneSettingChallengeTTLJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingChallengeTTL) UnmarshalJSON(data []byte) (err error) { +func (r *ChallengeTTL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingChallengeTTLJSON) RawJSON() string { +func (r challengeTTLJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingChallengeTTLID string +type ChallengeTTLID string const ( - ZoneSettingChallengeTTLIDChallengeTTL ZoneSettingChallengeTTLID = "challenge_ttl" + ChallengeTTLIDChallengeTTL ChallengeTTLID = "challenge_ttl" ) -func (r ZoneSettingChallengeTTLID) IsKnown() bool { +func (r ChallengeTTLID) IsKnown() bool { switch r { - case ZoneSettingChallengeTTLIDChallengeTTL: + case ChallengeTTLIDChallengeTTL: return true } return false } // Current value of the zone setting. -type ZoneSettingChallengeTTLValue float64 +type ChallengeTTLValue float64 const ( - ZoneSettingChallengeTTLValue300 ZoneSettingChallengeTTLValue = 300 - ZoneSettingChallengeTTLValue900 ZoneSettingChallengeTTLValue = 900 - ZoneSettingChallengeTTLValue1800 ZoneSettingChallengeTTLValue = 1800 - ZoneSettingChallengeTTLValue2700 ZoneSettingChallengeTTLValue = 2700 - ZoneSettingChallengeTTLValue3600 ZoneSettingChallengeTTLValue = 3600 - ZoneSettingChallengeTTLValue7200 ZoneSettingChallengeTTLValue = 7200 - ZoneSettingChallengeTTLValue10800 ZoneSettingChallengeTTLValue = 10800 - ZoneSettingChallengeTTLValue14400 ZoneSettingChallengeTTLValue = 14400 - ZoneSettingChallengeTTLValue28800 ZoneSettingChallengeTTLValue = 28800 - ZoneSettingChallengeTTLValue57600 ZoneSettingChallengeTTLValue = 57600 - ZoneSettingChallengeTTLValue86400 ZoneSettingChallengeTTLValue = 86400 - ZoneSettingChallengeTTLValue604800 ZoneSettingChallengeTTLValue = 604800 - ZoneSettingChallengeTTLValue2592000 ZoneSettingChallengeTTLValue = 2592000 - ZoneSettingChallengeTTLValue31536000 ZoneSettingChallengeTTLValue = 31536000 + ChallengeTTLValue300 ChallengeTTLValue = 300 + ChallengeTTLValue900 ChallengeTTLValue = 900 + ChallengeTTLValue1800 ChallengeTTLValue = 1800 + ChallengeTTLValue2700 ChallengeTTLValue = 2700 + ChallengeTTLValue3600 ChallengeTTLValue = 3600 + ChallengeTTLValue7200 ChallengeTTLValue = 7200 + ChallengeTTLValue10800 ChallengeTTLValue = 10800 + ChallengeTTLValue14400 ChallengeTTLValue = 14400 + ChallengeTTLValue28800 ChallengeTTLValue = 28800 + ChallengeTTLValue57600 ChallengeTTLValue = 57600 + ChallengeTTLValue86400 ChallengeTTLValue = 86400 + ChallengeTTLValue604800 ChallengeTTLValue = 604800 + ChallengeTTLValue2592000 ChallengeTTLValue = 2592000 + ChallengeTTLValue31536000 ChallengeTTLValue = 31536000 ) -func (r ZoneSettingChallengeTTLValue) IsKnown() bool { +func (r ChallengeTTLValue) IsKnown() bool { switch r { - case ZoneSettingChallengeTTLValue300, ZoneSettingChallengeTTLValue900, ZoneSettingChallengeTTLValue1800, ZoneSettingChallengeTTLValue2700, ZoneSettingChallengeTTLValue3600, ZoneSettingChallengeTTLValue7200, ZoneSettingChallengeTTLValue10800, ZoneSettingChallengeTTLValue14400, ZoneSettingChallengeTTLValue28800, ZoneSettingChallengeTTLValue57600, ZoneSettingChallengeTTLValue86400, ZoneSettingChallengeTTLValue604800, ZoneSettingChallengeTTLValue2592000, ZoneSettingChallengeTTLValue31536000: + case ChallengeTTLValue300, ChallengeTTLValue900, ChallengeTTLValue1800, ChallengeTTLValue2700, ChallengeTTLValue3600, ChallengeTTLValue7200, ChallengeTTLValue10800, ChallengeTTLValue14400, ChallengeTTLValue28800, ChallengeTTLValue57600, ChallengeTTLValue86400, ChallengeTTLValue604800, ChallengeTTLValue2592000, ChallengeTTLValue31536000: return true } return false @@ -149,16 +148,16 @@ func (r ZoneSettingChallengeTTLValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingChallengeTTLEditable bool +type ChallengeTTLEditable bool const ( - ZoneSettingChallengeTTLEditableTrue ZoneSettingChallengeTTLEditable = true - ZoneSettingChallengeTTLEditableFalse ZoneSettingChallengeTTLEditable = false + ChallengeTTLEditableTrue ChallengeTTLEditable = true + ChallengeTTLEditableFalse ChallengeTTLEditable = false ) -func (r ZoneSettingChallengeTTLEditable) IsKnown() bool { +func (r ChallengeTTLEditable) IsKnown() bool { switch r { - case ZoneSettingChallengeTTLEditableTrue, ZoneSettingChallengeTTLEditableFalse: + case ChallengeTTLEditableTrue, ChallengeTTLEditableFalse: return true } return false @@ -213,7 +212,7 @@ type SettingChallengeTTLEditResponseEnvelope struct { // visitor will have to complete a new challenge. We recommend a 15 - 45 minute // setting and will attempt to honor any setting above 45 minutes. // (https://support.cloudflare.com/hc/en-us/articles/200170136). - Result ZoneSettingChallengeTTL `json:"result"` + Result ChallengeTTL `json:"result"` JSON settingChallengeTTLEditResponseEnvelopeJSON `json:"-"` } @@ -251,7 +250,7 @@ type SettingChallengeTTLGetResponseEnvelope struct { // visitor will have to complete a new challenge. We recommend a 15 - 45 minute // setting and will attempt to honor any setting above 45 minutes. // (https://support.cloudflare.com/hc/en-us/articles/200170136). - Result ZoneSettingChallengeTTL `json:"result"` + Result ChallengeTTL `json:"result"` JSON settingChallengeTTLGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingcipher.go b/zones/settingcipher.go index e524d99d97a..70c8817bd95 100644 --- a/zones/settingcipher.go +++ b/zones/settingcipher.go @@ -34,7 +34,7 @@ func NewSettingCipherService(opts ...option.RequestOption) (r *SettingCipherServ } // Changes ciphers setting. -func (r *SettingCipherService) Edit(ctx context.Context, params SettingCipherEditParams, opts ...option.RequestOption) (res *ZoneSettingCiphers, err error) { +func (r *SettingCipherService) Edit(ctx context.Context, params SettingCipherEditParams, opts ...option.RequestOption) (res *Ciphers, err error) { opts = append(r.Options[:], opts...) var env SettingCipherEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ciphers", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingCipherService) Edit(ctx context.Context, params SettingCipherEdi } // Gets ciphers setting. -func (r *SettingCipherService) Get(ctx context.Context, query SettingCipherGetParams, opts ...option.RequestOption) (res *ZoneSettingCiphers, err error) { +func (r *SettingCipherService) Get(ctx context.Context, query SettingCipherGetParams, opts ...option.RequestOption) (res *Ciphers, err error) { opts = append(r.Options[:], opts...) var env SettingCipherGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ciphers", query.ZoneID) @@ -61,22 +61,21 @@ func (r *SettingCipherService) Get(ctx context.Context, query SettingCipherGetPa // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. -type ZoneSettingCiphers struct { +type Ciphers struct { // ID of the zone setting. - ID ZoneSettingCiphersID `json:"id,required"` + ID CiphersID `json:"id,required"` // Current value of the zone setting. Value []string `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingCiphersEditable `json:"editable"` + Editable CiphersEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingCiphersJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON ciphersJSON `json:"-"` } -// zoneSettingCiphersJSON contains the JSON metadata for the struct -// [ZoneSettingCiphers] -type zoneSettingCiphersJSON struct { +// ciphersJSON contains the JSON metadata for the struct [Ciphers] +type ciphersJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -85,24 +84,24 @@ type zoneSettingCiphersJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingCiphers) UnmarshalJSON(data []byte) (err error) { +func (r *Ciphers) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingCiphersJSON) RawJSON() string { +func (r ciphersJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingCiphersID string +type CiphersID string const ( - ZoneSettingCiphersIDCiphers ZoneSettingCiphersID = "ciphers" + CiphersIDCiphers CiphersID = "ciphers" ) -func (r ZoneSettingCiphersID) IsKnown() bool { +func (r CiphersID) IsKnown() bool { switch r { - case ZoneSettingCiphersIDCiphers: + case CiphersIDCiphers: return true } return false @@ -110,16 +109,16 @@ func (r ZoneSettingCiphersID) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingCiphersEditable bool +type CiphersEditable bool const ( - ZoneSettingCiphersEditableTrue ZoneSettingCiphersEditable = true - ZoneSettingCiphersEditableFalse ZoneSettingCiphersEditable = false + CiphersEditableTrue CiphersEditable = true + CiphersEditableFalse CiphersEditable = false ) -func (r ZoneSettingCiphersEditable) IsKnown() bool { +func (r CiphersEditable) IsKnown() bool { switch r { - case ZoneSettingCiphersEditableTrue, ZoneSettingCiphersEditableFalse: + case CiphersEditableTrue, CiphersEditableFalse: return true } return false @@ -143,7 +142,7 @@ type SettingCipherEditResponseEnvelope struct { Success bool `json:"success,required"` // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. - Result ZoneSettingCiphers `json:"result"` + Result Ciphers `json:"result"` JSON settingCipherEditResponseEnvelopeJSON `json:"-"` } @@ -178,7 +177,7 @@ type SettingCipherGetResponseEnvelope struct { Success bool `json:"success,required"` // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. - Result ZoneSettingCiphers `json:"result"` + Result Ciphers `json:"result"` JSON settingCipherGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingdevelopmentmode.go b/zones/settingdevelopmentmode.go index 811c542be48..e8e0a4453e7 100644 --- a/zones/settingdevelopmentmode.go +++ b/zones/settingdevelopmentmode.go @@ -39,7 +39,7 @@ func NewSettingDevelopmentModeService(opts ...option.RequestOption) (r *SettingD // changes to cacheable content (like images, css, or JavaScript) and would like to // see those changes right away. Once entered, development mode will last for 3 // hours and then automatically toggle off. -func (r *SettingDevelopmentModeService) Edit(ctx context.Context, params SettingDevelopmentModeEditParams, opts ...option.RequestOption) (res *ZoneSettingDevelopmentMode, err error) { +func (r *SettingDevelopmentModeService) Edit(ctx context.Context, params SettingDevelopmentModeEditParams, opts ...option.RequestOption) (res *DevelopmentMode, err error) { opts = append(r.Options[:], opts...) var env SettingDevelopmentModeEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/development_mode", params.ZoneID) @@ -57,7 +57,7 @@ func (r *SettingDevelopmentModeService) Edit(ctx context.Context, params Setting // changes to cacheable content (like images, css, or JavaScript) and would like to // see those changes right away. Once entered, development mode will last for 3 // hours and then automatically toggle off. -func (r *SettingDevelopmentModeService) Get(ctx context.Context, query SettingDevelopmentModeGetParams, opts ...option.RequestOption) (res *ZoneSettingDevelopmentMode, err error) { +func (r *SettingDevelopmentModeService) Get(ctx context.Context, query SettingDevelopmentModeGetParams, opts ...option.RequestOption) (res *DevelopmentMode, err error) { opts = append(r.Options[:], opts...) var env SettingDevelopmentModeGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/development_mode", query.ZoneID) @@ -75,26 +75,25 @@ func (r *SettingDevelopmentModeService) Get(ctx context.Context, query SettingDe // changes to cacheable content (like images, css, or JavaScript) and would like to // see those changes right away. Once entered, development mode will last for 3 // hours and then automatically toggle off. -type ZoneSettingDevelopmentMode struct { +type DevelopmentMode struct { // ID of the zone setting. - ID ZoneSettingDevelopmentModeID `json:"id,required"` + ID DevelopmentModeID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingDevelopmentModeValue `json:"value,required"` + Value DevelopmentModeValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingDevelopmentModeEditable `json:"editable"` + Editable DevelopmentModeEditable `json:"editable"` // last time this setting was modified. ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` // Value of the zone setting. Notes: The interval (in seconds) from when // development mode expires (positive integer) or last expired (negative integer) // for the domain. If development mode has never been enabled, this value is false. - TimeRemaining float64 `json:"time_remaining"` - JSON zoneSettingDevelopmentModeJSON `json:"-"` + TimeRemaining float64 `json:"time_remaining"` + JSON developmentModeJSON `json:"-"` } -// zoneSettingDevelopmentModeJSON contains the JSON metadata for the struct -// [ZoneSettingDevelopmentMode] -type zoneSettingDevelopmentModeJSON struct { +// developmentModeJSON contains the JSON metadata for the struct [DevelopmentMode] +type developmentModeJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -104,40 +103,40 @@ type zoneSettingDevelopmentModeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingDevelopmentMode) UnmarshalJSON(data []byte) (err error) { +func (r *DevelopmentMode) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingDevelopmentModeJSON) RawJSON() string { +func (r developmentModeJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingDevelopmentModeID string +type DevelopmentModeID string const ( - ZoneSettingDevelopmentModeIDDevelopmentMode ZoneSettingDevelopmentModeID = "development_mode" + DevelopmentModeIDDevelopmentMode DevelopmentModeID = "development_mode" ) -func (r ZoneSettingDevelopmentModeID) IsKnown() bool { +func (r DevelopmentModeID) IsKnown() bool { switch r { - case ZoneSettingDevelopmentModeIDDevelopmentMode: + case DevelopmentModeIDDevelopmentMode: return true } return false } // Current value of the zone setting. -type ZoneSettingDevelopmentModeValue string +type DevelopmentModeValue string const ( - ZoneSettingDevelopmentModeValueOn ZoneSettingDevelopmentModeValue = "on" - ZoneSettingDevelopmentModeValueOff ZoneSettingDevelopmentModeValue = "off" + DevelopmentModeValueOn DevelopmentModeValue = "on" + DevelopmentModeValueOff DevelopmentModeValue = "off" ) -func (r ZoneSettingDevelopmentModeValue) IsKnown() bool { +func (r DevelopmentModeValue) IsKnown() bool { switch r { - case ZoneSettingDevelopmentModeValueOn, ZoneSettingDevelopmentModeValueOff: + case DevelopmentModeValueOn, DevelopmentModeValueOff: return true } return false @@ -145,16 +144,16 @@ func (r ZoneSettingDevelopmentModeValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingDevelopmentModeEditable bool +type DevelopmentModeEditable bool const ( - ZoneSettingDevelopmentModeEditableTrue ZoneSettingDevelopmentModeEditable = true - ZoneSettingDevelopmentModeEditableFalse ZoneSettingDevelopmentModeEditable = false + DevelopmentModeEditableTrue DevelopmentModeEditable = true + DevelopmentModeEditableFalse DevelopmentModeEditable = false ) -func (r ZoneSettingDevelopmentModeEditable) IsKnown() bool { +func (r DevelopmentModeEditable) IsKnown() bool { switch r { - case ZoneSettingDevelopmentModeEditableTrue, ZoneSettingDevelopmentModeEditableFalse: + case DevelopmentModeEditableTrue, DevelopmentModeEditableFalse: return true } return false @@ -198,7 +197,7 @@ type SettingDevelopmentModeEditResponseEnvelope struct { // changes to cacheable content (like images, css, or JavaScript) and would like to // see those changes right away. Once entered, development mode will last for 3 // hours and then automatically toggle off. - Result ZoneSettingDevelopmentMode `json:"result"` + Result DevelopmentMode `json:"result"` JSON settingDevelopmentModeEditResponseEnvelopeJSON `json:"-"` } @@ -237,7 +236,7 @@ type SettingDevelopmentModeGetResponseEnvelope struct { // changes to cacheable content (like images, css, or JavaScript) and would like to // see those changes right away. Once entered, development mode will last for 3 // hours and then automatically toggle off. - Result ZoneSettingDevelopmentMode `json:"result"` + Result DevelopmentMode `json:"result"` JSON settingDevelopmentModeGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingearlyhint.go b/zones/settingearlyhint.go index ca496099b9a..816359ab92d 100644 --- a/zones/settingearlyhint.go +++ b/zones/settingearlyhint.go @@ -37,7 +37,7 @@ func NewSettingEarlyHintService(opts ...option.RequestOption) (r *SettingEarlyHi // `103` responses with `Link` headers from the final response. Refer to // [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for // more information. -func (r *SettingEarlyHintService) Edit(ctx context.Context, params SettingEarlyHintEditParams, opts ...option.RequestOption) (res *ZoneSettingEarlyHints, err error) { +func (r *SettingEarlyHintService) Edit(ctx context.Context, params SettingEarlyHintEditParams, opts ...option.RequestOption) (res *EarlyHints, err error) { opts = append(r.Options[:], opts...) var env SettingEarlyHintEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/early_hints", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingEarlyHintService) Edit(ctx context.Context, params SettingEarlyH // `103` responses with `Link` headers from the final response. Refer to // [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for // more information. -func (r *SettingEarlyHintService) Get(ctx context.Context, query SettingEarlyHintGetParams, opts ...option.RequestOption) (res *ZoneSettingEarlyHints, err error) { +func (r *SettingEarlyHintService) Get(ctx context.Context, query SettingEarlyHintGetParams, opts ...option.RequestOption) (res *EarlyHints, err error) { opts = append(r.Options[:], opts...) var env SettingEarlyHintGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/early_hints", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingEarlyHintService) Get(ctx context.Context, query SettingEarlyHin // `103` responses with `Link` headers from the final response. Refer to // [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for // more information. -type ZoneSettingEarlyHints struct { +type EarlyHints struct { // ID of the zone setting. - ID ZoneSettingEarlyHintsID `json:"id,required"` + ID EarlyHintsID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingEarlyHintsValue `json:"value,required"` + Value EarlyHintsValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingEarlyHintsEditable `json:"editable"` + Editable EarlyHintsEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingEarlyHintsJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON earlyHintsJSON `json:"-"` } -// zoneSettingEarlyHintsJSON contains the JSON metadata for the struct -// [ZoneSettingEarlyHints] -type zoneSettingEarlyHintsJSON struct { +// earlyHintsJSON contains the JSON metadata for the struct [EarlyHints] +type earlyHintsJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,40 +92,40 @@ type zoneSettingEarlyHintsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingEarlyHints) UnmarshalJSON(data []byte) (err error) { +func (r *EarlyHints) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingEarlyHintsJSON) RawJSON() string { +func (r earlyHintsJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingEarlyHintsID string +type EarlyHintsID string const ( - ZoneSettingEarlyHintsIDEarlyHints ZoneSettingEarlyHintsID = "early_hints" + EarlyHintsIDEarlyHints EarlyHintsID = "early_hints" ) -func (r ZoneSettingEarlyHintsID) IsKnown() bool { +func (r EarlyHintsID) IsKnown() bool { switch r { - case ZoneSettingEarlyHintsIDEarlyHints: + case EarlyHintsIDEarlyHints: return true } return false } // Current value of the zone setting. -type ZoneSettingEarlyHintsValue string +type EarlyHintsValue string const ( - ZoneSettingEarlyHintsValueOn ZoneSettingEarlyHintsValue = "on" - ZoneSettingEarlyHintsValueOff ZoneSettingEarlyHintsValue = "off" + EarlyHintsValueOn EarlyHintsValue = "on" + EarlyHintsValueOff EarlyHintsValue = "off" ) -func (r ZoneSettingEarlyHintsValue) IsKnown() bool { +func (r EarlyHintsValue) IsKnown() bool { switch r { - case ZoneSettingEarlyHintsValueOn, ZoneSettingEarlyHintsValueOff: + case EarlyHintsValueOn, EarlyHintsValueOff: return true } return false @@ -134,16 +133,16 @@ func (r ZoneSettingEarlyHintsValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingEarlyHintsEditable bool +type EarlyHintsEditable bool const ( - ZoneSettingEarlyHintsEditableTrue ZoneSettingEarlyHintsEditable = true - ZoneSettingEarlyHintsEditableFalse ZoneSettingEarlyHintsEditable = false + EarlyHintsEditableTrue EarlyHintsEditable = true + EarlyHintsEditableFalse EarlyHintsEditable = false ) -func (r ZoneSettingEarlyHintsEditable) IsKnown() bool { +func (r EarlyHintsEditable) IsKnown() bool { switch r { - case ZoneSettingEarlyHintsEditableTrue, ZoneSettingEarlyHintsEditableFalse: + case EarlyHintsEditableTrue, EarlyHintsEditableFalse: return true } return false @@ -185,7 +184,7 @@ type SettingEarlyHintEditResponseEnvelope struct { // `103` responses with `Link` headers from the final response. Refer to // [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for // more information. - Result ZoneSettingEarlyHints `json:"result"` + Result EarlyHints `json:"result"` JSON settingEarlyHintEditResponseEnvelopeJSON `json:"-"` } @@ -222,7 +221,7 @@ type SettingEarlyHintGetResponseEnvelope struct { // `103` responses with `Link` headers from the final response. Refer to // [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for // more information. - Result ZoneSettingEarlyHints `json:"result"` + Result EarlyHints `json:"result"` JSON settingEarlyHintGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingemailobfuscation.go b/zones/settingemailobfuscation.go index d1f77e427ac..4aac1774f56 100644 --- a/zones/settingemailobfuscation.go +++ b/zones/settingemailobfuscation.go @@ -35,7 +35,7 @@ func NewSettingEmailObfuscationService(opts ...option.RequestOption) (r *Setting // Encrypt email adresses on your web page from bots, while keeping them visible to // humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). -func (r *SettingEmailObfuscationService) Edit(ctx context.Context, params SettingEmailObfuscationEditParams, opts ...option.RequestOption) (res *ZoneSettingEmailObfuscation, err error) { +func (r *SettingEmailObfuscationService) Edit(ctx context.Context, params SettingEmailObfuscationEditParams, opts ...option.RequestOption) (res *EmailObfuscation, err error) { opts = append(r.Options[:], opts...) var env SettingEmailObfuscationEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/email_obfuscation", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingEmailObfuscationService) Edit(ctx context.Context, params Settin // Encrypt email adresses on your web page from bots, while keeping them visible to // humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). -func (r *SettingEmailObfuscationService) Get(ctx context.Context, query SettingEmailObfuscationGetParams, opts ...option.RequestOption) (res *ZoneSettingEmailObfuscation, err error) { +func (r *SettingEmailObfuscationService) Get(ctx context.Context, query SettingEmailObfuscationGetParams, opts ...option.RequestOption) (res *EmailObfuscation, err error) { opts = append(r.Options[:], opts...) var env SettingEmailObfuscationGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/email_obfuscation", query.ZoneID) @@ -63,22 +63,22 @@ func (r *SettingEmailObfuscationService) Get(ctx context.Context, query SettingE // Encrypt email adresses on your web page from bots, while keeping them visible to // humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). -type ZoneSettingEmailObfuscation struct { +type EmailObfuscation struct { // ID of the zone setting. - ID ZoneSettingEmailObfuscationID `json:"id,required"` + ID EmailObfuscationID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingEmailObfuscationValue `json:"value,required"` + Value EmailObfuscationValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingEmailObfuscationEditable `json:"editable"` + Editable EmailObfuscationEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingEmailObfuscationJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON emailObfuscationJSON `json:"-"` } -// zoneSettingEmailObfuscationJSON contains the JSON metadata for the struct -// [ZoneSettingEmailObfuscation] -type zoneSettingEmailObfuscationJSON struct { +// emailObfuscationJSON contains the JSON metadata for the struct +// [EmailObfuscation] +type emailObfuscationJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +87,40 @@ type zoneSettingEmailObfuscationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingEmailObfuscation) UnmarshalJSON(data []byte) (err error) { +func (r *EmailObfuscation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingEmailObfuscationJSON) RawJSON() string { +func (r emailObfuscationJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingEmailObfuscationID string +type EmailObfuscationID string const ( - ZoneSettingEmailObfuscationIDEmailObfuscation ZoneSettingEmailObfuscationID = "email_obfuscation" + EmailObfuscationIDEmailObfuscation EmailObfuscationID = "email_obfuscation" ) -func (r ZoneSettingEmailObfuscationID) IsKnown() bool { +func (r EmailObfuscationID) IsKnown() bool { switch r { - case ZoneSettingEmailObfuscationIDEmailObfuscation: + case EmailObfuscationIDEmailObfuscation: return true } return false } // Current value of the zone setting. -type ZoneSettingEmailObfuscationValue string +type EmailObfuscationValue string const ( - ZoneSettingEmailObfuscationValueOn ZoneSettingEmailObfuscationValue = "on" - ZoneSettingEmailObfuscationValueOff ZoneSettingEmailObfuscationValue = "off" + EmailObfuscationValueOn EmailObfuscationValue = "on" + EmailObfuscationValueOff EmailObfuscationValue = "off" ) -func (r ZoneSettingEmailObfuscationValue) IsKnown() bool { +func (r EmailObfuscationValue) IsKnown() bool { switch r { - case ZoneSettingEmailObfuscationValueOn, ZoneSettingEmailObfuscationValueOff: + case EmailObfuscationValueOn, EmailObfuscationValueOff: return true } return false @@ -128,16 +128,16 @@ func (r ZoneSettingEmailObfuscationValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingEmailObfuscationEditable bool +type EmailObfuscationEditable bool const ( - ZoneSettingEmailObfuscationEditableTrue ZoneSettingEmailObfuscationEditable = true - ZoneSettingEmailObfuscationEditableFalse ZoneSettingEmailObfuscationEditable = false + EmailObfuscationEditableTrue EmailObfuscationEditable = true + EmailObfuscationEditableFalse EmailObfuscationEditable = false ) -func (r ZoneSettingEmailObfuscationEditable) IsKnown() bool { +func (r EmailObfuscationEditable) IsKnown() bool { switch r { - case ZoneSettingEmailObfuscationEditableTrue, ZoneSettingEmailObfuscationEditableFalse: + case EmailObfuscationEditableTrue, EmailObfuscationEditableFalse: return true } return false @@ -177,7 +177,7 @@ type SettingEmailObfuscationEditResponseEnvelope struct { Success bool `json:"success,required"` // Encrypt email adresses on your web page from bots, while keeping them visible to // humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). - Result ZoneSettingEmailObfuscation `json:"result"` + Result EmailObfuscation `json:"result"` JSON settingEmailObfuscationEditResponseEnvelopeJSON `json:"-"` } @@ -212,7 +212,7 @@ type SettingEmailObfuscationGetResponseEnvelope struct { Success bool `json:"success,required"` // Encrypt email adresses on your web page from bots, while keeping them visible to // humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). - Result ZoneSettingEmailObfuscation `json:"result"` + Result EmailObfuscation `json:"result"` JSON settingEmailObfuscationGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingfontsetting.go b/zones/settingfontsetting.go index ca9b6e320b6..d20a7046817 100644 --- a/zones/settingfontsetting.go +++ b/zones/settingfontsetting.go @@ -36,7 +36,7 @@ func NewSettingFontSettingService(opts ...option.RequestOption) (r *SettingFontS // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google // Hosted fonts from your own domain, boost performance, and enhance user privacy. // Refer to the Cloudflare Fonts documentation for more information. -func (r *SettingFontSettingService) Edit(ctx context.Context, params SettingFontSettingEditParams, opts ...option.RequestOption) (res *ZoneSettingFonts, err error) { +func (r *SettingFontSettingService) Edit(ctx context.Context, params SettingFontSettingEditParams, opts ...option.RequestOption) (res *FontSettings, err error) { opts = append(r.Options[:], opts...) var env SettingFontSettingEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/fonts", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingFontSettingService) Edit(ctx context.Context, params SettingFont // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google // Hosted fonts from your own domain, boost performance, and enhance user privacy. // Refer to the Cloudflare Fonts documentation for more information. -func (r *SettingFontSettingService) Get(ctx context.Context, query SettingFontSettingGetParams, opts ...option.RequestOption) (res *ZoneSettingFonts, err error) { +func (r *SettingFontSettingService) Get(ctx context.Context, query SettingFontSettingGetParams, opts ...option.RequestOption) (res *FontSettings, err error) { opts = append(r.Options[:], opts...) var env SettingFontSettingGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/fonts", query.ZoneID) @@ -66,22 +66,21 @@ func (r *SettingFontSettingService) Get(ctx context.Context, query SettingFontSe // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google // Hosted fonts from your own domain, boost performance, and enhance user privacy. // Refer to the Cloudflare Fonts documentation for more information. -type ZoneSettingFonts struct { +type FontSettings struct { // ID of the zone setting. - ID ZoneSettingFontsID `json:"id,required"` + ID FontSettingsID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingFontsValue `json:"value,required"` + Value FontSettingsValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingFontsEditable `json:"editable"` + Editable FontSettingsEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingFontsJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON fontSettingsJSON `json:"-"` } -// zoneSettingFontsJSON contains the JSON metadata for the struct -// [ZoneSettingFonts] -type zoneSettingFontsJSON struct { +// fontSettingsJSON contains the JSON metadata for the struct [FontSettings] +type fontSettingsJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -90,40 +89,40 @@ type zoneSettingFontsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingFonts) UnmarshalJSON(data []byte) (err error) { +func (r *FontSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingFontsJSON) RawJSON() string { +func (r fontSettingsJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingFontsID string +type FontSettingsID string const ( - ZoneSettingFontsIDFonts ZoneSettingFontsID = "fonts" + FontSettingsIDFonts FontSettingsID = "fonts" ) -func (r ZoneSettingFontsID) IsKnown() bool { +func (r FontSettingsID) IsKnown() bool { switch r { - case ZoneSettingFontsIDFonts: + case FontSettingsIDFonts: return true } return false } // Current value of the zone setting. -type ZoneSettingFontsValue string +type FontSettingsValue string const ( - ZoneSettingFontsValueOn ZoneSettingFontsValue = "on" - ZoneSettingFontsValueOff ZoneSettingFontsValue = "off" + FontSettingsValueOn FontSettingsValue = "on" + FontSettingsValueOff FontSettingsValue = "off" ) -func (r ZoneSettingFontsValue) IsKnown() bool { +func (r FontSettingsValue) IsKnown() bool { switch r { - case ZoneSettingFontsValueOn, ZoneSettingFontsValueOff: + case FontSettingsValueOn, FontSettingsValueOff: return true } return false @@ -131,16 +130,16 @@ func (r ZoneSettingFontsValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingFontsEditable bool +type FontSettingsEditable bool const ( - ZoneSettingFontsEditableTrue ZoneSettingFontsEditable = true - ZoneSettingFontsEditableFalse ZoneSettingFontsEditable = false + FontSettingsEditableTrue FontSettingsEditable = true + FontSettingsEditableFalse FontSettingsEditable = false ) -func (r ZoneSettingFontsEditable) IsKnown() bool { +func (r FontSettingsEditable) IsKnown() bool { switch r { - case ZoneSettingFontsEditableTrue, ZoneSettingFontsEditableFalse: + case FontSettingsEditableTrue, FontSettingsEditableFalse: return true } return false @@ -181,7 +180,7 @@ type SettingFontSettingEditResponseEnvelope struct { // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google // Hosted fonts from your own domain, boost performance, and enhance user privacy. // Refer to the Cloudflare Fonts documentation for more information. - Result ZoneSettingFonts `json:"result"` + Result FontSettings `json:"result"` JSON settingFontSettingEditResponseEnvelopeJSON `json:"-"` } @@ -217,7 +216,7 @@ type SettingFontSettingGetResponseEnvelope struct { // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google // Hosted fonts from your own domain, boost performance, and enhance user privacy. // Refer to the Cloudflare Fonts documentation for more information. - Result ZoneSettingFonts `json:"result"` + Result FontSettings `json:"result"` JSON settingFontSettingGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingh2prioritization.go b/zones/settingh2prioritization.go index ae8d6fb4db0..ce5cfb470f4 100644 --- a/zones/settingh2prioritization.go +++ b/zones/settingh2prioritization.go @@ -34,7 +34,7 @@ func NewSettingH2PrioritizationService(opts ...option.RequestOption) (r *Setting } // Gets HTTP/2 Edge Prioritization setting. -func (r *SettingH2PrioritizationService) Edit(ctx context.Context, params SettingH2PrioritizationEditParams, opts ...option.RequestOption) (res *ZoneSettingH2Prioritization, err error) { +func (r *SettingH2PrioritizationService) Edit(ctx context.Context, params SettingH2PrioritizationEditParams, opts ...option.RequestOption) (res *H2Prioritization, err error) { opts = append(r.Options[:], opts...) var env SettingH2PrioritizationEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/h2_prioritization", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingH2PrioritizationService) Edit(ctx context.Context, params Settin } // Gets HTTP/2 Edge Prioritization setting. -func (r *SettingH2PrioritizationService) Get(ctx context.Context, query SettingH2PrioritizationGetParams, opts ...option.RequestOption) (res *ZoneSettingH2Prioritization, err error) { +func (r *SettingH2PrioritizationService) Get(ctx context.Context, query SettingH2PrioritizationGetParams, opts ...option.RequestOption) (res *H2Prioritization, err error) { opts = append(r.Options[:], opts...) var env SettingH2PrioritizationGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/h2_prioritization", query.ZoneID) @@ -62,22 +62,22 @@ func (r *SettingH2PrioritizationService) Get(ctx context.Context, query SettingH // HTTP/2 Edge Prioritization optimises the delivery of resources served through // HTTP/2 to improve page load performance. It also supports fine control of // content delivery when used in conjunction with Workers. -type ZoneSettingH2Prioritization struct { +type H2Prioritization struct { // ID of the zone setting. - ID ZoneSettingH2PrioritizationID `json:"id,required"` + ID H2PrioritizationID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingH2PrioritizationValue `json:"value,required"` + Value H2PrioritizationValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingH2PrioritizationEditable `json:"editable"` + Editable H2PrioritizationEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingH2PrioritizationJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON h2PrioritizationJSON `json:"-"` } -// zoneSettingH2PrioritizationJSON contains the JSON metadata for the struct -// [ZoneSettingH2Prioritization] -type zoneSettingH2PrioritizationJSON struct { +// h2PrioritizationJSON contains the JSON metadata for the struct +// [H2Prioritization] +type h2PrioritizationJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -86,41 +86,41 @@ type zoneSettingH2PrioritizationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingH2Prioritization) UnmarshalJSON(data []byte) (err error) { +func (r *H2Prioritization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingH2PrioritizationJSON) RawJSON() string { +func (r h2PrioritizationJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingH2PrioritizationID string +type H2PrioritizationID string const ( - ZoneSettingH2PrioritizationIDH2Prioritization ZoneSettingH2PrioritizationID = "h2_prioritization" + H2PrioritizationIDH2Prioritization H2PrioritizationID = "h2_prioritization" ) -func (r ZoneSettingH2PrioritizationID) IsKnown() bool { +func (r H2PrioritizationID) IsKnown() bool { switch r { - case ZoneSettingH2PrioritizationIDH2Prioritization: + case H2PrioritizationIDH2Prioritization: return true } return false } // Current value of the zone setting. -type ZoneSettingH2PrioritizationValue string +type H2PrioritizationValue string const ( - ZoneSettingH2PrioritizationValueOn ZoneSettingH2PrioritizationValue = "on" - ZoneSettingH2PrioritizationValueOff ZoneSettingH2PrioritizationValue = "off" - ZoneSettingH2PrioritizationValueCustom ZoneSettingH2PrioritizationValue = "custom" + H2PrioritizationValueOn H2PrioritizationValue = "on" + H2PrioritizationValueOff H2PrioritizationValue = "off" + H2PrioritizationValueCustom H2PrioritizationValue = "custom" ) -func (r ZoneSettingH2PrioritizationValue) IsKnown() bool { +func (r H2PrioritizationValue) IsKnown() bool { switch r { - case ZoneSettingH2PrioritizationValueOn, ZoneSettingH2PrioritizationValueOff, ZoneSettingH2PrioritizationValueCustom: + case H2PrioritizationValueOn, H2PrioritizationValueOff, H2PrioritizationValueCustom: return true } return false @@ -128,16 +128,16 @@ func (r ZoneSettingH2PrioritizationValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingH2PrioritizationEditable bool +type H2PrioritizationEditable bool const ( - ZoneSettingH2PrioritizationEditableTrue ZoneSettingH2PrioritizationEditable = true - ZoneSettingH2PrioritizationEditableFalse ZoneSettingH2PrioritizationEditable = false + H2PrioritizationEditableTrue H2PrioritizationEditable = true + H2PrioritizationEditableFalse H2PrioritizationEditable = false ) -func (r ZoneSettingH2PrioritizationEditable) IsKnown() bool { +func (r H2PrioritizationEditable) IsKnown() bool { switch r { - case ZoneSettingH2PrioritizationEditableTrue, ZoneSettingH2PrioritizationEditableFalse: + case H2PrioritizationEditableTrue, H2PrioritizationEditableFalse: return true } return false @@ -146,14 +146,14 @@ func (r ZoneSettingH2PrioritizationEditable) IsKnown() bool { // HTTP/2 Edge Prioritization optimises the delivery of resources served through // HTTP/2 to improve page load performance. It also supports fine control of // content delivery when used in conjunction with Workers. -type ZoneSettingH2PrioritizationParam struct { +type H2PrioritizationParam struct { // ID of the zone setting. - ID param.Field[ZoneSettingH2PrioritizationID] `json:"id,required"` + ID param.Field[H2PrioritizationID] `json:"id,required"` // Current value of the zone setting. - Value param.Field[ZoneSettingH2PrioritizationValue] `json:"value,required"` + Value param.Field[H2PrioritizationValue] `json:"value,required"` } -func (r ZoneSettingH2PrioritizationParam) MarshalJSON() (data []byte, err error) { +func (r H2PrioritizationParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -163,7 +163,7 @@ type SettingH2PrioritizationEditParams struct { // HTTP/2 Edge Prioritization optimises the delivery of resources served through // HTTP/2 to improve page load performance. It also supports fine control of // content delivery when used in conjunction with Workers. - Value param.Field[ZoneSettingH2PrioritizationParam] `json:"value,required"` + Value param.Field[H2PrioritizationParam] `json:"value,required"` } func (r SettingH2PrioritizationEditParams) MarshalJSON() (data []byte, err error) { @@ -178,7 +178,7 @@ type SettingH2PrioritizationEditResponseEnvelope struct { // HTTP/2 Edge Prioritization optimises the delivery of resources served through // HTTP/2 to improve page load performance. It also supports fine control of // content delivery when used in conjunction with Workers. - Result ZoneSettingH2Prioritization `json:"result"` + Result H2Prioritization `json:"result"` JSON settingH2PrioritizationEditResponseEnvelopeJSON `json:"-"` } @@ -214,7 +214,7 @@ type SettingH2PrioritizationGetResponseEnvelope struct { // HTTP/2 Edge Prioritization optimises the delivery of resources served through // HTTP/2 to improve page load performance. It also supports fine control of // content delivery when used in conjunction with Workers. - Result ZoneSettingH2Prioritization `json:"result"` + Result H2Prioritization `json:"result"` JSON settingH2PrioritizationGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingh2prioritization_test.go b/zones/settingh2prioritization_test.go index ad06bee6d8d..4f31fcf190c 100644 --- a/zones/settingh2prioritization_test.go +++ b/zones/settingh2prioritization_test.go @@ -30,9 +30,9 @@ func TestSettingH2PrioritizationEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.H2Prioritization.Edit(context.TODO(), zones.SettingH2PrioritizationEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingH2PrioritizationParam{ - ID: cloudflare.F(zones.ZoneSettingH2PrioritizationIDH2Prioritization), - Value: cloudflare.F(zones.ZoneSettingH2PrioritizationValueOn), + Value: cloudflare.F(zones.H2PrioritizationParam{ + ID: cloudflare.F(zones.H2PrioritizationIDH2Prioritization), + Value: cloudflare.F(zones.H2PrioritizationValueOn), }), }) if err != nil { diff --git a/zones/settinghotlinkprotection.go b/zones/settinghotlinkprotection.go index 3e3d312523d..09b74488f83 100644 --- a/zones/settinghotlinkprotection.go +++ b/zones/settinghotlinkprotection.go @@ -40,7 +40,7 @@ func NewSettingHotlinkProtectionService(opts ...option.RequestOption) (r *Settin // view images from your page, but other sites won't be able to steal them for use // on their own pages. // (https://support.cloudflare.com/hc/en-us/articles/200170026). -func (r *SettingHotlinkProtectionService) Edit(ctx context.Context, params SettingHotlinkProtectionEditParams, opts ...option.RequestOption) (res *ZoneSettingHotlinkProtection, err error) { +func (r *SettingHotlinkProtectionService) Edit(ctx context.Context, params SettingHotlinkProtectionEditParams, opts ...option.RequestOption) (res *HotlinkProtection, err error) { opts = append(r.Options[:], opts...) var env SettingHotlinkProtectionEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/hotlink_protection", params.ZoneID) @@ -59,7 +59,7 @@ func (r *SettingHotlinkProtectionService) Edit(ctx context.Context, params Setti // view images from your page, but other sites won't be able to steal them for use // on their own pages. // (https://support.cloudflare.com/hc/en-us/articles/200170026). -func (r *SettingHotlinkProtectionService) Get(ctx context.Context, query SettingHotlinkProtectionGetParams, opts ...option.RequestOption) (res *ZoneSettingHotlinkProtection, err error) { +func (r *SettingHotlinkProtectionService) Get(ctx context.Context, query SettingHotlinkProtectionGetParams, opts ...option.RequestOption) (res *HotlinkProtection, err error) { opts = append(r.Options[:], opts...) var env SettingHotlinkProtectionGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/hotlink_protection", query.ZoneID) @@ -78,22 +78,22 @@ func (r *SettingHotlinkProtectionService) Get(ctx context.Context, query Setting // view images from your page, but other sites won't be able to steal them for use // on their own pages. // (https://support.cloudflare.com/hc/en-us/articles/200170026). -type ZoneSettingHotlinkProtection struct { +type HotlinkProtection struct { // ID of the zone setting. - ID ZoneSettingHotlinkProtectionID `json:"id,required"` + ID HotlinkProtectionID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingHotlinkProtectionValue `json:"value,required"` + Value HotlinkProtectionValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingHotlinkProtectionEditable `json:"editable"` + Editable HotlinkProtectionEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingHotlinkProtectionJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON hotlinkProtectionJSON `json:"-"` } -// zoneSettingHotlinkProtectionJSON contains the JSON metadata for the struct -// [ZoneSettingHotlinkProtection] -type zoneSettingHotlinkProtectionJSON struct { +// hotlinkProtectionJSON contains the JSON metadata for the struct +// [HotlinkProtection] +type hotlinkProtectionJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -102,40 +102,40 @@ type zoneSettingHotlinkProtectionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingHotlinkProtection) UnmarshalJSON(data []byte) (err error) { +func (r *HotlinkProtection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingHotlinkProtectionJSON) RawJSON() string { +func (r hotlinkProtectionJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingHotlinkProtectionID string +type HotlinkProtectionID string const ( - ZoneSettingHotlinkProtectionIDHotlinkProtection ZoneSettingHotlinkProtectionID = "hotlink_protection" + HotlinkProtectionIDHotlinkProtection HotlinkProtectionID = "hotlink_protection" ) -func (r ZoneSettingHotlinkProtectionID) IsKnown() bool { +func (r HotlinkProtectionID) IsKnown() bool { switch r { - case ZoneSettingHotlinkProtectionIDHotlinkProtection: + case HotlinkProtectionIDHotlinkProtection: return true } return false } // Current value of the zone setting. -type ZoneSettingHotlinkProtectionValue string +type HotlinkProtectionValue string const ( - ZoneSettingHotlinkProtectionValueOn ZoneSettingHotlinkProtectionValue = "on" - ZoneSettingHotlinkProtectionValueOff ZoneSettingHotlinkProtectionValue = "off" + HotlinkProtectionValueOn HotlinkProtectionValue = "on" + HotlinkProtectionValueOff HotlinkProtectionValue = "off" ) -func (r ZoneSettingHotlinkProtectionValue) IsKnown() bool { +func (r HotlinkProtectionValue) IsKnown() bool { switch r { - case ZoneSettingHotlinkProtectionValueOn, ZoneSettingHotlinkProtectionValueOff: + case HotlinkProtectionValueOn, HotlinkProtectionValueOff: return true } return false @@ -143,16 +143,16 @@ func (r ZoneSettingHotlinkProtectionValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingHotlinkProtectionEditable bool +type HotlinkProtectionEditable bool const ( - ZoneSettingHotlinkProtectionEditableTrue ZoneSettingHotlinkProtectionEditable = true - ZoneSettingHotlinkProtectionEditableFalse ZoneSettingHotlinkProtectionEditable = false + HotlinkProtectionEditableTrue HotlinkProtectionEditable = true + HotlinkProtectionEditableFalse HotlinkProtectionEditable = false ) -func (r ZoneSettingHotlinkProtectionEditable) IsKnown() bool { +func (r HotlinkProtectionEditable) IsKnown() bool { switch r { - case ZoneSettingHotlinkProtectionEditableTrue, ZoneSettingHotlinkProtectionEditableFalse: + case HotlinkProtectionEditableTrue, HotlinkProtectionEditableFalse: return true } return false @@ -197,7 +197,7 @@ type SettingHotlinkProtectionEditResponseEnvelope struct { // view images from your page, but other sites won't be able to steal them for use // on their own pages. // (https://support.cloudflare.com/hc/en-us/articles/200170026). - Result ZoneSettingHotlinkProtection `json:"result"` + Result HotlinkProtection `json:"result"` JSON settingHotlinkProtectionEditResponseEnvelopeJSON `json:"-"` } @@ -237,7 +237,7 @@ type SettingHotlinkProtectionGetResponseEnvelope struct { // view images from your page, but other sites won't be able to steal them for use // on their own pages. // (https://support.cloudflare.com/hc/en-us/articles/200170026). - Result ZoneSettingHotlinkProtection `json:"result"` + Result HotlinkProtection `json:"result"` JSON settingHotlinkProtectionGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settinghttp2.go b/zones/settinghttp2.go index a67e2b55a8f..171c5399f5c 100644 --- a/zones/settinghttp2.go +++ b/zones/settinghttp2.go @@ -34,7 +34,7 @@ func NewSettingHTTP2Service(opts ...option.RequestOption) (r *SettingHTTP2Servic } // Value of the HTTP2 setting. -func (r *SettingHTTP2Service) Edit(ctx context.Context, params SettingHTTP2EditParams, opts ...option.RequestOption) (res *ZoneSettingHTTP2, err error) { +func (r *SettingHTTP2Service) Edit(ctx context.Context, params SettingHTTP2EditParams, opts ...option.RequestOption) (res *HTTP2, err error) { opts = append(r.Options[:], opts...) var env SettingHTTP2EditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/http2", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingHTTP2Service) Edit(ctx context.Context, params SettingHTTP2EditP } // Value of the HTTP2 setting. -func (r *SettingHTTP2Service) Get(ctx context.Context, query SettingHTTP2GetParams, opts ...option.RequestOption) (res *ZoneSettingHTTP2, err error) { +func (r *SettingHTTP2Service) Get(ctx context.Context, query SettingHTTP2GetParams, opts ...option.RequestOption) (res *HTTP2, err error) { opts = append(r.Options[:], opts...) var env SettingHTTP2GetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/http2", query.ZoneID) @@ -60,22 +60,21 @@ func (r *SettingHTTP2Service) Get(ctx context.Context, query SettingHTTP2GetPara } // HTTP2 enabled for this zone. -type ZoneSettingHTTP2 struct { +type HTTP2 struct { // ID of the zone setting. - ID ZoneSettingHTTP2ID `json:"id,required"` + ID HTTP2ID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingHTTP2Value `json:"value,required"` + Value HTTP2Value `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingHTTP2Editable `json:"editable"` + Editable HTTP2Editable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingHTTP2JSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON http2JSON `json:"-"` } -// zoneSettingHTTP2JSON contains the JSON metadata for the struct -// [ZoneSettingHTTP2] -type zoneSettingHTTP2JSON struct { +// http2JSON contains the JSON metadata for the struct [HTTP2] +type http2JSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,40 +83,40 @@ type zoneSettingHTTP2JSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingHTTP2) UnmarshalJSON(data []byte) (err error) { +func (r *HTTP2) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingHTTP2JSON) RawJSON() string { +func (r http2JSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingHTTP2ID string +type HTTP2ID string const ( - ZoneSettingHTTP2IDHTTP2 ZoneSettingHTTP2ID = "http2" + HTTP2IDHTTP2 HTTP2ID = "http2" ) -func (r ZoneSettingHTTP2ID) IsKnown() bool { +func (r HTTP2ID) IsKnown() bool { switch r { - case ZoneSettingHTTP2IDHTTP2: + case HTTP2IDHTTP2: return true } return false } // Current value of the zone setting. -type ZoneSettingHTTP2Value string +type HTTP2Value string const ( - ZoneSettingHTTP2ValueOn ZoneSettingHTTP2Value = "on" - ZoneSettingHTTP2ValueOff ZoneSettingHTTP2Value = "off" + HTTP2ValueOn HTTP2Value = "on" + HTTP2ValueOff HTTP2Value = "off" ) -func (r ZoneSettingHTTP2Value) IsKnown() bool { +func (r HTTP2Value) IsKnown() bool { switch r { - case ZoneSettingHTTP2ValueOn, ZoneSettingHTTP2ValueOff: + case HTTP2ValueOn, HTTP2ValueOff: return true } return false @@ -125,16 +124,16 @@ func (r ZoneSettingHTTP2Value) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingHTTP2Editable bool +type HTTP2Editable bool const ( - ZoneSettingHTTP2EditableTrue ZoneSettingHTTP2Editable = true - ZoneSettingHTTP2EditableFalse ZoneSettingHTTP2Editable = false + HTTP2EditableTrue HTTP2Editable = true + HTTP2EditableFalse HTTP2Editable = false ) -func (r ZoneSettingHTTP2Editable) IsKnown() bool { +func (r HTTP2Editable) IsKnown() bool { switch r { - case ZoneSettingHTTP2EditableTrue, ZoneSettingHTTP2EditableFalse: + case HTTP2EditableTrue, HTTP2EditableFalse: return true } return false @@ -173,7 +172,7 @@ type SettingHTTP2EditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // HTTP2 enabled for this zone. - Result ZoneSettingHTTP2 `json:"result"` + Result HTTP2 `json:"result"` JSON settingHTTP2EditResponseEnvelopeJSON `json:"-"` } @@ -207,7 +206,7 @@ type SettingHTTP2GetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // HTTP2 enabled for this zone. - Result ZoneSettingHTTP2 `json:"result"` + Result HTTP2 `json:"result"` JSON settingHTTP2GetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settinghttp3.go b/zones/settinghttp3.go index 058ec840904..9ef807a58c9 100644 --- a/zones/settinghttp3.go +++ b/zones/settinghttp3.go @@ -34,7 +34,7 @@ func NewSettingHTTP3Service(opts ...option.RequestOption) (r *SettingHTTP3Servic } // Value of the HTTP3 setting. -func (r *SettingHTTP3Service) Edit(ctx context.Context, params SettingHTTP3EditParams, opts ...option.RequestOption) (res *ZoneSettingHTTP3, err error) { +func (r *SettingHTTP3Service) Edit(ctx context.Context, params SettingHTTP3EditParams, opts ...option.RequestOption) (res *HTTP3, err error) { opts = append(r.Options[:], opts...) var env SettingHTTP3EditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/http3", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingHTTP3Service) Edit(ctx context.Context, params SettingHTTP3EditP } // Value of the HTTP3 setting. -func (r *SettingHTTP3Service) Get(ctx context.Context, query SettingHTTP3GetParams, opts ...option.RequestOption) (res *ZoneSettingHTTP3, err error) { +func (r *SettingHTTP3Service) Get(ctx context.Context, query SettingHTTP3GetParams, opts ...option.RequestOption) (res *HTTP3, err error) { opts = append(r.Options[:], opts...) var env SettingHTTP3GetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/http3", query.ZoneID) @@ -60,22 +60,21 @@ func (r *SettingHTTP3Service) Get(ctx context.Context, query SettingHTTP3GetPara } // HTTP3 enabled for this zone. -type ZoneSettingHTTP3 struct { +type HTTP3 struct { // ID of the zone setting. - ID ZoneSettingHTTP3ID `json:"id,required"` + ID HTTP3ID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingHTTP3Value `json:"value,required"` + Value HTTP3Value `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingHTTP3Editable `json:"editable"` + Editable HTTP3Editable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingHTTP3JSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON http3JSON `json:"-"` } -// zoneSettingHTTP3JSON contains the JSON metadata for the struct -// [ZoneSettingHTTP3] -type zoneSettingHTTP3JSON struct { +// http3JSON contains the JSON metadata for the struct [HTTP3] +type http3JSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,40 +83,40 @@ type zoneSettingHTTP3JSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingHTTP3) UnmarshalJSON(data []byte) (err error) { +func (r *HTTP3) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingHTTP3JSON) RawJSON() string { +func (r http3JSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingHTTP3ID string +type HTTP3ID string const ( - ZoneSettingHTTP3IDHTTP3 ZoneSettingHTTP3ID = "http3" + HTTP3IDHTTP3 HTTP3ID = "http3" ) -func (r ZoneSettingHTTP3ID) IsKnown() bool { +func (r HTTP3ID) IsKnown() bool { switch r { - case ZoneSettingHTTP3IDHTTP3: + case HTTP3IDHTTP3: return true } return false } // Current value of the zone setting. -type ZoneSettingHTTP3Value string +type HTTP3Value string const ( - ZoneSettingHTTP3ValueOn ZoneSettingHTTP3Value = "on" - ZoneSettingHTTP3ValueOff ZoneSettingHTTP3Value = "off" + HTTP3ValueOn HTTP3Value = "on" + HTTP3ValueOff HTTP3Value = "off" ) -func (r ZoneSettingHTTP3Value) IsKnown() bool { +func (r HTTP3Value) IsKnown() bool { switch r { - case ZoneSettingHTTP3ValueOn, ZoneSettingHTTP3ValueOff: + case HTTP3ValueOn, HTTP3ValueOff: return true } return false @@ -125,16 +124,16 @@ func (r ZoneSettingHTTP3Value) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingHTTP3Editable bool +type HTTP3Editable bool const ( - ZoneSettingHTTP3EditableTrue ZoneSettingHTTP3Editable = true - ZoneSettingHTTP3EditableFalse ZoneSettingHTTP3Editable = false + HTTP3EditableTrue HTTP3Editable = true + HTTP3EditableFalse HTTP3Editable = false ) -func (r ZoneSettingHTTP3Editable) IsKnown() bool { +func (r HTTP3Editable) IsKnown() bool { switch r { - case ZoneSettingHTTP3EditableTrue, ZoneSettingHTTP3EditableFalse: + case HTTP3EditableTrue, HTTP3EditableFalse: return true } return false @@ -173,7 +172,7 @@ type SettingHTTP3EditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // HTTP3 enabled for this zone. - Result ZoneSettingHTTP3 `json:"result"` + Result HTTP3 `json:"result"` JSON settingHTTP3EditResponseEnvelopeJSON `json:"-"` } @@ -207,7 +206,7 @@ type SettingHTTP3GetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // HTTP3 enabled for this zone. - Result ZoneSettingHTTP3 `json:"result"` + Result HTTP3 `json:"result"` JSON settingHTTP3GetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingimageresizing.go b/zones/settingimageresizing.go index a5bec028b20..e875f30bfd3 100644 --- a/zones/settingimageresizing.go +++ b/zones/settingimageresizing.go @@ -37,7 +37,7 @@ func NewSettingImageResizingService(opts ...option.RequestOption) (r *SettingIma // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. -func (r *SettingImageResizingService) Edit(ctx context.Context, params SettingImageResizingEditParams, opts ...option.RequestOption) (res *ZoneSettingImageResizing, err error) { +func (r *SettingImageResizingService) Edit(ctx context.Context, params SettingImageResizingEditParams, opts ...option.RequestOption) (res *ImageResizing, err error) { opts = append(r.Options[:], opts...) var env SettingImageResizingEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/image_resizing", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingImageResizingService) Edit(ctx context.Context, params SettingIm // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. -func (r *SettingImageResizingService) Get(ctx context.Context, query SettingImageResizingGetParams, opts ...option.RequestOption) (res *ZoneSettingImageResizing, err error) { +func (r *SettingImageResizingService) Get(ctx context.Context, query SettingImageResizingGetParams, opts ...option.RequestOption) (res *ImageResizing, err error) { opts = append(r.Options[:], opts...) var env SettingImageResizingGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/image_resizing", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingImageResizingService) Get(ctx context.Context, query SettingImag // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. -type ZoneSettingImageResizing struct { +type ImageResizing struct { // ID of the zone setting. - ID ZoneSettingImageResizingID `json:"id,required"` + ID ImageResizingID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingImageResizingValue `json:"value,required"` + Value ImageResizingValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingImageResizingEditable `json:"editable"` + Editable ImageResizingEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingImageResizingJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON imageResizingJSON `json:"-"` } -// zoneSettingImageResizingJSON contains the JSON metadata for the struct -// [ZoneSettingImageResizing] -type zoneSettingImageResizingJSON struct { +// imageResizingJSON contains the JSON metadata for the struct [ImageResizing] +type imageResizingJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,41 +92,41 @@ type zoneSettingImageResizingJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingImageResizing) UnmarshalJSON(data []byte) (err error) { +func (r *ImageResizing) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingImageResizingJSON) RawJSON() string { +func (r imageResizingJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingImageResizingID string +type ImageResizingID string const ( - ZoneSettingImageResizingIDImageResizing ZoneSettingImageResizingID = "image_resizing" + ImageResizingIDImageResizing ImageResizingID = "image_resizing" ) -func (r ZoneSettingImageResizingID) IsKnown() bool { +func (r ImageResizingID) IsKnown() bool { switch r { - case ZoneSettingImageResizingIDImageResizing: + case ImageResizingIDImageResizing: return true } return false } // Current value of the zone setting. -type ZoneSettingImageResizingValue string +type ImageResizingValue string const ( - ZoneSettingImageResizingValueOn ZoneSettingImageResizingValue = "on" - ZoneSettingImageResizingValueOff ZoneSettingImageResizingValue = "off" - ZoneSettingImageResizingValueOpen ZoneSettingImageResizingValue = "open" + ImageResizingValueOn ImageResizingValue = "on" + ImageResizingValueOff ImageResizingValue = "off" + ImageResizingValueOpen ImageResizingValue = "open" ) -func (r ZoneSettingImageResizingValue) IsKnown() bool { +func (r ImageResizingValue) IsKnown() bool { switch r { - case ZoneSettingImageResizingValueOn, ZoneSettingImageResizingValueOff, ZoneSettingImageResizingValueOpen: + case ImageResizingValueOn, ImageResizingValueOff, ImageResizingValueOpen: return true } return false @@ -135,16 +134,16 @@ func (r ZoneSettingImageResizingValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingImageResizingEditable bool +type ImageResizingEditable bool const ( - ZoneSettingImageResizingEditableTrue ZoneSettingImageResizingEditable = true - ZoneSettingImageResizingEditableFalse ZoneSettingImageResizingEditable = false + ImageResizingEditableTrue ImageResizingEditable = true + ImageResizingEditableFalse ImageResizingEditable = false ) -func (r ZoneSettingImageResizingEditable) IsKnown() bool { +func (r ImageResizingEditable) IsKnown() bool { switch r { - case ZoneSettingImageResizingEditableTrue, ZoneSettingImageResizingEditableFalse: + case ImageResizingEditableTrue, ImageResizingEditableFalse: return true } return false @@ -154,14 +153,14 @@ func (r ZoneSettingImageResizingEditable) IsKnown() bool { // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. -type ZoneSettingImageResizingParam struct { +type ImageResizingParam struct { // ID of the zone setting. - ID param.Field[ZoneSettingImageResizingID] `json:"id,required"` + ID param.Field[ImageResizingID] `json:"id,required"` // Current value of the zone setting. - Value param.Field[ZoneSettingImageResizingValue] `json:"value,required"` + Value param.Field[ImageResizingValue] `json:"value,required"` } -func (r ZoneSettingImageResizingParam) MarshalJSON() (data []byte, err error) { +func (r ImageResizingParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -172,7 +171,7 @@ type SettingImageResizingEditParams struct { // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. - Value param.Field[ZoneSettingImageResizingParam] `json:"value,required"` + Value param.Field[ImageResizingParam] `json:"value,required"` } func (r SettingImageResizingEditParams) MarshalJSON() (data []byte, err error) { @@ -188,7 +187,7 @@ type SettingImageResizingEditResponseEnvelope struct { // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. - Result ZoneSettingImageResizing `json:"result"` + Result ImageResizing `json:"result"` JSON settingImageResizingEditResponseEnvelopeJSON `json:"-"` } @@ -225,7 +224,7 @@ type SettingImageResizingGetResponseEnvelope struct { // images served through Cloudflare's network. Refer to the // [Image Resizing documentation](https://developers.cloudflare.com/images/) for // more information. - Result ZoneSettingImageResizing `json:"result"` + Result ImageResizing `json:"result"` JSON settingImageResizingGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingimageresizing_test.go b/zones/settingimageresizing_test.go index 9a04ac0c72c..d3a8470bb9d 100644 --- a/zones/settingimageresizing_test.go +++ b/zones/settingimageresizing_test.go @@ -30,9 +30,9 @@ func TestSettingImageResizingEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.ImageResizing.Edit(context.TODO(), zones.SettingImageResizingEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingImageResizingParam{ - ID: cloudflare.F(zones.ZoneSettingImageResizingIDImageResizing), - Value: cloudflare.F(zones.ZoneSettingImageResizingValueOn), + Value: cloudflare.F(zones.ImageResizingParam{ + ID: cloudflare.F(zones.ImageResizingIDImageResizing), + Value: cloudflare.F(zones.ImageResizingValueOn), }), }) if err != nil { diff --git a/zones/settingipgeolocation.go b/zones/settingipgeolocation.go index 6c20a6f19de..f695b05bbdd 100644 --- a/zones/settingipgeolocation.go +++ b/zones/settingipgeolocation.go @@ -36,7 +36,7 @@ func NewSettingIPGeolocationService(opts ...option.RequestOption) (r *SettingIPG // Enable IP Geolocation to have Cloudflare geolocate visitors to your website and // pass the country code to you. // (https://support.cloudflare.com/hc/en-us/articles/200168236). -func (r *SettingIPGeolocationService) Edit(ctx context.Context, params SettingIPGeolocationEditParams, opts ...option.RequestOption) (res *ZoneSettingIPGeolocation, err error) { +func (r *SettingIPGeolocationService) Edit(ctx context.Context, params SettingIPGeolocationEditParams, opts ...option.RequestOption) (res *IPGeolocation, err error) { opts = append(r.Options[:], opts...) var env SettingIPGeolocationEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ip_geolocation", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingIPGeolocationService) Edit(ctx context.Context, params SettingIP // Enable IP Geolocation to have Cloudflare geolocate visitors to your website and // pass the country code to you. // (https://support.cloudflare.com/hc/en-us/articles/200168236). -func (r *SettingIPGeolocationService) Get(ctx context.Context, query SettingIPGeolocationGetParams, opts ...option.RequestOption) (res *ZoneSettingIPGeolocation, err error) { +func (r *SettingIPGeolocationService) Get(ctx context.Context, query SettingIPGeolocationGetParams, opts ...option.RequestOption) (res *IPGeolocation, err error) { opts = append(r.Options[:], opts...) var env SettingIPGeolocationGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ip_geolocation", query.ZoneID) @@ -66,22 +66,21 @@ func (r *SettingIPGeolocationService) Get(ctx context.Context, query SettingIPGe // Enable IP Geolocation to have Cloudflare geolocate visitors to your website and // pass the country code to you. // (https://support.cloudflare.com/hc/en-us/articles/200168236). -type ZoneSettingIPGeolocation struct { +type IPGeolocation struct { // ID of the zone setting. - ID ZoneSettingIPGeolocationID `json:"id,required"` + ID IPGeolocationID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingIPGeolocationValue `json:"value,required"` + Value IPGeolocationValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingIPGeolocationEditable `json:"editable"` + Editable IPGeolocationEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingIPGeolocationJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON ipGeolocationJSON `json:"-"` } -// zoneSettingIPGeolocationJSON contains the JSON metadata for the struct -// [ZoneSettingIPGeolocation] -type zoneSettingIPGeolocationJSON struct { +// ipGeolocationJSON contains the JSON metadata for the struct [IPGeolocation] +type ipGeolocationJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -90,40 +89,40 @@ type zoneSettingIPGeolocationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingIPGeolocation) UnmarshalJSON(data []byte) (err error) { +func (r *IPGeolocation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingIPGeolocationJSON) RawJSON() string { +func (r ipGeolocationJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingIPGeolocationID string +type IPGeolocationID string const ( - ZoneSettingIPGeolocationIDIPGeolocation ZoneSettingIPGeolocationID = "ip_geolocation" + IPGeolocationIDIPGeolocation IPGeolocationID = "ip_geolocation" ) -func (r ZoneSettingIPGeolocationID) IsKnown() bool { +func (r IPGeolocationID) IsKnown() bool { switch r { - case ZoneSettingIPGeolocationIDIPGeolocation: + case IPGeolocationIDIPGeolocation: return true } return false } // Current value of the zone setting. -type ZoneSettingIPGeolocationValue string +type IPGeolocationValue string const ( - ZoneSettingIPGeolocationValueOn ZoneSettingIPGeolocationValue = "on" - ZoneSettingIPGeolocationValueOff ZoneSettingIPGeolocationValue = "off" + IPGeolocationValueOn IPGeolocationValue = "on" + IPGeolocationValueOff IPGeolocationValue = "off" ) -func (r ZoneSettingIPGeolocationValue) IsKnown() bool { +func (r IPGeolocationValue) IsKnown() bool { switch r { - case ZoneSettingIPGeolocationValueOn, ZoneSettingIPGeolocationValueOff: + case IPGeolocationValueOn, IPGeolocationValueOff: return true } return false @@ -131,16 +130,16 @@ func (r ZoneSettingIPGeolocationValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingIPGeolocationEditable bool +type IPGeolocationEditable bool const ( - ZoneSettingIPGeolocationEditableTrue ZoneSettingIPGeolocationEditable = true - ZoneSettingIPGeolocationEditableFalse ZoneSettingIPGeolocationEditable = false + IPGeolocationEditableTrue IPGeolocationEditable = true + IPGeolocationEditableFalse IPGeolocationEditable = false ) -func (r ZoneSettingIPGeolocationEditable) IsKnown() bool { +func (r IPGeolocationEditable) IsKnown() bool { switch r { - case ZoneSettingIPGeolocationEditableTrue, ZoneSettingIPGeolocationEditableFalse: + case IPGeolocationEditableTrue, IPGeolocationEditableFalse: return true } return false @@ -181,7 +180,7 @@ type SettingIPGeolocationEditResponseEnvelope struct { // Enable IP Geolocation to have Cloudflare geolocate visitors to your website and // pass the country code to you. // (https://support.cloudflare.com/hc/en-us/articles/200168236). - Result ZoneSettingIPGeolocation `json:"result"` + Result IPGeolocation `json:"result"` JSON settingIPGeolocationEditResponseEnvelopeJSON `json:"-"` } @@ -217,7 +216,7 @@ type SettingIPGeolocationGetResponseEnvelope struct { // Enable IP Geolocation to have Cloudflare geolocate visitors to your website and // pass the country code to you. // (https://support.cloudflare.com/hc/en-us/articles/200168236). - Result ZoneSettingIPGeolocation `json:"result"` + Result IPGeolocation `json:"result"` JSON settingIPGeolocationGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingipv6.go b/zones/settingipv6.go index ec73183fedd..0904a7458ba 100644 --- a/zones/settingipv6.go +++ b/zones/settingipv6.go @@ -35,7 +35,7 @@ func NewSettingIPV6Service(opts ...option.RequestOption) (r *SettingIPV6Service) // Enable IPv6 on all subdomains that are Cloudflare enabled. // (https://support.cloudflare.com/hc/en-us/articles/200168586). -func (r *SettingIPV6Service) Edit(ctx context.Context, params SettingIPV6EditParams, opts ...option.RequestOption) (res *ZoneSettingIPV6, err error) { +func (r *SettingIPV6Service) Edit(ctx context.Context, params SettingIPV6EditParams, opts ...option.RequestOption) (res *IPV6, err error) { opts = append(r.Options[:], opts...) var env SettingIPV6EditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ipv6", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingIPV6Service) Edit(ctx context.Context, params SettingIPV6EditPar // Enable IPv6 on all subdomains that are Cloudflare enabled. // (https://support.cloudflare.com/hc/en-us/articles/200168586). -func (r *SettingIPV6Service) Get(ctx context.Context, query SettingIPV6GetParams, opts ...option.RequestOption) (res *ZoneSettingIPV6, err error) { +func (r *SettingIPV6Service) Get(ctx context.Context, query SettingIPV6GetParams, opts ...option.RequestOption) (res *IPV6, err error) { opts = append(r.Options[:], opts...) var env SettingIPV6GetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ipv6", query.ZoneID) @@ -63,21 +63,21 @@ func (r *SettingIPV6Service) Get(ctx context.Context, query SettingIPV6GetParams // Enable IPv6 on all subdomains that are Cloudflare enabled. // (https://support.cloudflare.com/hc/en-us/articles/200168586). -type ZoneSettingIPV6 struct { +type IPV6 struct { // ID of the zone setting. - ID ZoneSettingIPV6ID `json:"id,required"` + ID IPV6ID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingIPV6Value `json:"value,required"` + Value IPV6Value `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingIPV6Editable `json:"editable"` + Editable IPV6Editable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingIPV6JSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON ipv6JSON `json:"-"` } -// zoneSettingIPV6JSON contains the JSON metadata for the struct [ZoneSettingIPV6] -type zoneSettingIPV6JSON struct { +// ipv6JSON contains the JSON metadata for the struct [IPV6] +type ipv6JSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -86,40 +86,40 @@ type zoneSettingIPV6JSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingIPV6) UnmarshalJSON(data []byte) (err error) { +func (r *IPV6) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingIPV6JSON) RawJSON() string { +func (r ipv6JSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingIPV6ID string +type IPV6ID string const ( - ZoneSettingIPV6IDIPV6 ZoneSettingIPV6ID = "ipv6" + IPV6IDIPV6 IPV6ID = "ipv6" ) -func (r ZoneSettingIPV6ID) IsKnown() bool { +func (r IPV6ID) IsKnown() bool { switch r { - case ZoneSettingIPV6IDIPV6: + case IPV6IDIPV6: return true } return false } // Current value of the zone setting. -type ZoneSettingIPV6Value string +type IPV6Value string const ( - ZoneSettingIPV6ValueOff ZoneSettingIPV6Value = "off" - ZoneSettingIPV6ValueOn ZoneSettingIPV6Value = "on" + IPV6ValueOff IPV6Value = "off" + IPV6ValueOn IPV6Value = "on" ) -func (r ZoneSettingIPV6Value) IsKnown() bool { +func (r IPV6Value) IsKnown() bool { switch r { - case ZoneSettingIPV6ValueOff, ZoneSettingIPV6ValueOn: + case IPV6ValueOff, IPV6ValueOn: return true } return false @@ -127,16 +127,16 @@ func (r ZoneSettingIPV6Value) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingIPV6Editable bool +type IPV6Editable bool const ( - ZoneSettingIPV6EditableTrue ZoneSettingIPV6Editable = true - ZoneSettingIPV6EditableFalse ZoneSettingIPV6Editable = false + IPV6EditableTrue IPV6Editable = true + IPV6EditableFalse IPV6Editable = false ) -func (r ZoneSettingIPV6Editable) IsKnown() bool { +func (r IPV6Editable) IsKnown() bool { switch r { - case ZoneSettingIPV6EditableTrue, ZoneSettingIPV6EditableFalse: + case IPV6EditableTrue, IPV6EditableFalse: return true } return false @@ -176,7 +176,7 @@ type SettingIPV6EditResponseEnvelope struct { Success bool `json:"success,required"` // Enable IPv6 on all subdomains that are Cloudflare enabled. // (https://support.cloudflare.com/hc/en-us/articles/200168586). - Result ZoneSettingIPV6 `json:"result"` + Result IPV6 `json:"result"` JSON settingIPV6EditResponseEnvelopeJSON `json:"-"` } @@ -211,7 +211,7 @@ type SettingIPV6GetResponseEnvelope struct { Success bool `json:"success,required"` // Enable IPv6 on all subdomains that are Cloudflare enabled. // (https://support.cloudflare.com/hc/en-us/articles/200168586). - Result ZoneSettingIPV6 `json:"result"` + Result IPV6 `json:"result"` JSON settingIPV6GetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingminify.go b/zones/settingminify.go index bffe96f90b1..d1f4df228bc 100644 --- a/zones/settingminify.go +++ b/zones/settingminify.go @@ -36,7 +36,7 @@ func NewSettingMinifyService(opts ...option.RequestOption) (r *SettingMinifyServ // Automatically minify certain assets for your website. Refer to // [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) // for more information. -func (r *SettingMinifyService) Edit(ctx context.Context, params SettingMinifyEditParams, opts ...option.RequestOption) (res *ZoneSettingMinify, err error) { +func (r *SettingMinifyService) Edit(ctx context.Context, params SettingMinifyEditParams, opts ...option.RequestOption) (res *Minify, err error) { opts = append(r.Options[:], opts...) var env SettingMinifyEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/minify", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingMinifyService) Edit(ctx context.Context, params SettingMinifyEdi // Automatically minify certain assets for your website. Refer to // [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) // for more information. -func (r *SettingMinifyService) Get(ctx context.Context, query SettingMinifyGetParams, opts ...option.RequestOption) (res *ZoneSettingMinify, err error) { +func (r *SettingMinifyService) Get(ctx context.Context, query SettingMinifyGetParams, opts ...option.RequestOption) (res *Minify, err error) { opts = append(r.Options[:], opts...) var env SettingMinifyGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/minify", query.ZoneID) @@ -66,22 +66,21 @@ func (r *SettingMinifyService) Get(ctx context.Context, query SettingMinifyGetPa // Automatically minify certain assets for your website. Refer to // [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) // for more information. -type ZoneSettingMinify struct { +type Minify struct { // Zone setting identifier. - ID ZoneSettingMinifyID `json:"id,required"` + ID MinifyID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingMinifyValue `json:"value,required"` + Value MinifyValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingMinifyEditable `json:"editable"` + Editable MinifyEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingMinifyJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON minifyJSON `json:"-"` } -// zoneSettingMinifyJSON contains the JSON metadata for the struct -// [ZoneSettingMinify] -type zoneSettingMinifyJSON struct { +// minifyJSON contains the JSON metadata for the struct [Minify] +type minifyJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -90,43 +89,42 @@ type zoneSettingMinifyJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingMinify) UnmarshalJSON(data []byte) (err error) { +func (r *Minify) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingMinifyJSON) RawJSON() string { +func (r minifyJSON) RawJSON() string { return r.raw } // Zone setting identifier. -type ZoneSettingMinifyID string +type MinifyID string const ( - ZoneSettingMinifyIDMinify ZoneSettingMinifyID = "minify" + MinifyIDMinify MinifyID = "minify" ) -func (r ZoneSettingMinifyID) IsKnown() bool { +func (r MinifyID) IsKnown() bool { switch r { - case ZoneSettingMinifyIDMinify: + case MinifyIDMinify: return true } return false } // Current value of the zone setting. -type ZoneSettingMinifyValue struct { +type MinifyValue struct { // Automatically minify all CSS files for your website. - Css ZoneSettingMinifyValueCss `json:"css"` + Css MinifyValueCss `json:"css"` // Automatically minify all HTML files for your website. - HTML ZoneSettingMinifyValueHTML `json:"html"` + HTML MinifyValueHTML `json:"html"` // Automatically minify all JavaScript files for your website. - Js ZoneSettingMinifyValueJs `json:"js"` - JSON zoneSettingMinifyValueJSON `json:"-"` + Js MinifyValueJs `json:"js"` + JSON minifyValueJSON `json:"-"` } -// zoneSettingMinifyValueJSON contains the JSON metadata for the struct -// [ZoneSettingMinifyValue] -type zoneSettingMinifyValueJSON struct { +// minifyValueJSON contains the JSON metadata for the struct [MinifyValue] +type minifyValueJSON struct { Css apijson.Field HTML apijson.Field Js apijson.Field @@ -134,57 +132,57 @@ type zoneSettingMinifyValueJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingMinifyValue) UnmarshalJSON(data []byte) (err error) { +func (r *MinifyValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingMinifyValueJSON) RawJSON() string { +func (r minifyValueJSON) RawJSON() string { return r.raw } // Automatically minify all CSS files for your website. -type ZoneSettingMinifyValueCss string +type MinifyValueCss string const ( - ZoneSettingMinifyValueCssOn ZoneSettingMinifyValueCss = "on" - ZoneSettingMinifyValueCssOff ZoneSettingMinifyValueCss = "off" + MinifyValueCssOn MinifyValueCss = "on" + MinifyValueCssOff MinifyValueCss = "off" ) -func (r ZoneSettingMinifyValueCss) IsKnown() bool { +func (r MinifyValueCss) IsKnown() bool { switch r { - case ZoneSettingMinifyValueCssOn, ZoneSettingMinifyValueCssOff: + case MinifyValueCssOn, MinifyValueCssOff: return true } return false } // Automatically minify all HTML files for your website. -type ZoneSettingMinifyValueHTML string +type MinifyValueHTML string const ( - ZoneSettingMinifyValueHTMLOn ZoneSettingMinifyValueHTML = "on" - ZoneSettingMinifyValueHTMLOff ZoneSettingMinifyValueHTML = "off" + MinifyValueHTMLOn MinifyValueHTML = "on" + MinifyValueHTMLOff MinifyValueHTML = "off" ) -func (r ZoneSettingMinifyValueHTML) IsKnown() bool { +func (r MinifyValueHTML) IsKnown() bool { switch r { - case ZoneSettingMinifyValueHTMLOn, ZoneSettingMinifyValueHTMLOff: + case MinifyValueHTMLOn, MinifyValueHTMLOff: return true } return false } // Automatically minify all JavaScript files for your website. -type ZoneSettingMinifyValueJs string +type MinifyValueJs string const ( - ZoneSettingMinifyValueJsOn ZoneSettingMinifyValueJs = "on" - ZoneSettingMinifyValueJsOff ZoneSettingMinifyValueJs = "off" + MinifyValueJsOn MinifyValueJs = "on" + MinifyValueJsOff MinifyValueJs = "off" ) -func (r ZoneSettingMinifyValueJs) IsKnown() bool { +func (r MinifyValueJs) IsKnown() bool { switch r { - case ZoneSettingMinifyValueJsOn, ZoneSettingMinifyValueJsOff: + case MinifyValueJsOn, MinifyValueJsOff: return true } return false @@ -192,16 +190,16 @@ func (r ZoneSettingMinifyValueJs) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingMinifyEditable bool +type MinifyEditable bool const ( - ZoneSettingMinifyEditableTrue ZoneSettingMinifyEditable = true - ZoneSettingMinifyEditableFalse ZoneSettingMinifyEditable = false + MinifyEditableTrue MinifyEditable = true + MinifyEditableFalse MinifyEditable = false ) -func (r ZoneSettingMinifyEditable) IsKnown() bool { +func (r MinifyEditable) IsKnown() bool { switch r { - case ZoneSettingMinifyEditableTrue, ZoneSettingMinifyEditableFalse: + case MinifyEditableTrue, MinifyEditableFalse: return true } return false @@ -288,7 +286,7 @@ type SettingMinifyEditResponseEnvelope struct { // Automatically minify certain assets for your website. Refer to // [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) // for more information. - Result ZoneSettingMinify `json:"result"` + Result Minify `json:"result"` JSON settingMinifyEditResponseEnvelopeJSON `json:"-"` } @@ -324,7 +322,7 @@ type SettingMinifyGetResponseEnvelope struct { // Automatically minify certain assets for your website. Refer to // [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) // for more information. - Result ZoneSettingMinify `json:"result"` + Result Minify `json:"result"` JSON settingMinifyGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingmintlsversion.go b/zones/settingmintlsversion.go index a95c9548121..0d48ec9b7c2 100644 --- a/zones/settingmintlsversion.go +++ b/zones/settingmintlsversion.go @@ -34,7 +34,7 @@ func NewSettingMinTLSVersionService(opts ...option.RequestOption) (r *SettingMin } // Changes Minimum TLS Version setting. -func (r *SettingMinTLSVersionService) Edit(ctx context.Context, params SettingMinTLSVersionEditParams, opts ...option.RequestOption) (res *ZoneSettingMinTLSVersion, err error) { +func (r *SettingMinTLSVersionService) Edit(ctx context.Context, params SettingMinTLSVersionEditParams, opts ...option.RequestOption) (res *MinTLSVersion, err error) { opts = append(r.Options[:], opts...) var env SettingMinTLSVersionEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/min_tls_version", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingMinTLSVersionService) Edit(ctx context.Context, params SettingMi } // Gets Minimum TLS Version setting. -func (r *SettingMinTLSVersionService) Get(ctx context.Context, query SettingMinTLSVersionGetParams, opts ...option.RequestOption) (res *ZoneSettingMinTLSVersion, err error) { +func (r *SettingMinTLSVersionService) Get(ctx context.Context, query SettingMinTLSVersionGetParams, opts ...option.RequestOption) (res *MinTLSVersion, err error) { opts = append(r.Options[:], opts...) var env SettingMinTLSVersionGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/min_tls_version", query.ZoneID) @@ -62,22 +62,21 @@ func (r *SettingMinTLSVersionService) Get(ctx context.Context, query SettingMinT // Only accepts HTTPS requests that use at least the TLS protocol version // specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be // rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted. -type ZoneSettingMinTLSVersion struct { +type MinTLSVersion struct { // ID of the zone setting. - ID ZoneSettingMinTLSVersionID `json:"id,required"` + ID MinTLSVersionID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingMinTLSVersionValue `json:"value,required"` + Value MinTLSVersionValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingMinTLSVersionEditable `json:"editable"` + Editable MinTLSVersionEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingMinTLSVersionJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON minTLSVersionJSON `json:"-"` } -// zoneSettingMinTLSVersionJSON contains the JSON metadata for the struct -// [ZoneSettingMinTLSVersion] -type zoneSettingMinTLSVersionJSON struct { +// minTLSVersionJSON contains the JSON metadata for the struct [MinTLSVersion] +type minTLSVersionJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -86,42 +85,42 @@ type zoneSettingMinTLSVersionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingMinTLSVersion) UnmarshalJSON(data []byte) (err error) { +func (r *MinTLSVersion) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingMinTLSVersionJSON) RawJSON() string { +func (r minTLSVersionJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingMinTLSVersionID string +type MinTLSVersionID string const ( - ZoneSettingMinTLSVersionIDMinTLSVersion ZoneSettingMinTLSVersionID = "min_tls_version" + MinTLSVersionIDMinTLSVersion MinTLSVersionID = "min_tls_version" ) -func (r ZoneSettingMinTLSVersionID) IsKnown() bool { +func (r MinTLSVersionID) IsKnown() bool { switch r { - case ZoneSettingMinTLSVersionIDMinTLSVersion: + case MinTLSVersionIDMinTLSVersion: return true } return false } // Current value of the zone setting. -type ZoneSettingMinTLSVersionValue string +type MinTLSVersionValue string const ( - ZoneSettingMinTLSVersionValue1_0 ZoneSettingMinTLSVersionValue = "1.0" - ZoneSettingMinTLSVersionValue1_1 ZoneSettingMinTLSVersionValue = "1.1" - ZoneSettingMinTLSVersionValue1_2 ZoneSettingMinTLSVersionValue = "1.2" - ZoneSettingMinTLSVersionValue1_3 ZoneSettingMinTLSVersionValue = "1.3" + MinTLSVersionValue1_0 MinTLSVersionValue = "1.0" + MinTLSVersionValue1_1 MinTLSVersionValue = "1.1" + MinTLSVersionValue1_2 MinTLSVersionValue = "1.2" + MinTLSVersionValue1_3 MinTLSVersionValue = "1.3" ) -func (r ZoneSettingMinTLSVersionValue) IsKnown() bool { +func (r MinTLSVersionValue) IsKnown() bool { switch r { - case ZoneSettingMinTLSVersionValue1_0, ZoneSettingMinTLSVersionValue1_1, ZoneSettingMinTLSVersionValue1_2, ZoneSettingMinTLSVersionValue1_3: + case MinTLSVersionValue1_0, MinTLSVersionValue1_1, MinTLSVersionValue1_2, MinTLSVersionValue1_3: return true } return false @@ -129,16 +128,16 @@ func (r ZoneSettingMinTLSVersionValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingMinTLSVersionEditable bool +type MinTLSVersionEditable bool const ( - ZoneSettingMinTLSVersionEditableTrue ZoneSettingMinTLSVersionEditable = true - ZoneSettingMinTLSVersionEditableFalse ZoneSettingMinTLSVersionEditable = false + MinTLSVersionEditableTrue MinTLSVersionEditable = true + MinTLSVersionEditableFalse MinTLSVersionEditable = false ) -func (r ZoneSettingMinTLSVersionEditable) IsKnown() bool { +func (r MinTLSVersionEditable) IsKnown() bool { switch r { - case ZoneSettingMinTLSVersionEditableTrue, ZoneSettingMinTLSVersionEditableFalse: + case MinTLSVersionEditableTrue, MinTLSVersionEditableFalse: return true } return false @@ -181,7 +180,7 @@ type SettingMinTLSVersionEditResponseEnvelope struct { // Only accepts HTTPS requests that use at least the TLS protocol version // specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be // rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted. - Result ZoneSettingMinTLSVersion `json:"result"` + Result MinTLSVersion `json:"result"` JSON settingMinTLSVersionEditResponseEnvelopeJSON `json:"-"` } @@ -217,7 +216,7 @@ type SettingMinTLSVersionGetResponseEnvelope struct { // Only accepts HTTPS requests that use at least the TLS protocol version // specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be // rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted. - Result ZoneSettingMinTLSVersion `json:"result"` + Result MinTLSVersion `json:"result"` JSON settingMinTLSVersionGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingmirage.go b/zones/settingmirage.go index a26fbdadcbf..aef518ed31a 100644 --- a/zones/settingmirage.go +++ b/zones/settingmirage.go @@ -37,7 +37,7 @@ func NewSettingMirageService(opts ...option.RequestOption) (r *SettingMirageServ // Refer to our // [blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more // information. -func (r *SettingMirageService) Edit(ctx context.Context, params SettingMirageEditParams, opts ...option.RequestOption) (res *ZoneSettingMirage, err error) { +func (r *SettingMirageService) Edit(ctx context.Context, params SettingMirageEditParams, opts ...option.RequestOption) (res *Mirage, err error) { opts = append(r.Options[:], opts...) var env SettingMirageEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/mirage", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingMirageService) Edit(ctx context.Context, params SettingMirageEdi // Refer to our // [blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more // information. -func (r *SettingMirageService) Get(ctx context.Context, query SettingMirageGetParams, opts ...option.RequestOption) (res *ZoneSettingMirage, err error) { +func (r *SettingMirageService) Get(ctx context.Context, query SettingMirageGetParams, opts ...option.RequestOption) (res *Mirage, err error) { opts = append(r.Options[:], opts...) var env SettingMirageGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/mirage", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingMirageService) Get(ctx context.Context, query SettingMirageGetPa // Refer to // [our blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for // more information. -type ZoneSettingMirage struct { +type Mirage struct { // ID of the zone setting. - ID ZoneSettingMirageID `json:"id,required"` + ID MirageID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingMirageValue `json:"value,required"` + Value MirageValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingMirageEditable `json:"editable"` + Editable MirageEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingMirageJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON mirageJSON `json:"-"` } -// zoneSettingMirageJSON contains the JSON metadata for the struct -// [ZoneSettingMirage] -type zoneSettingMirageJSON struct { +// mirageJSON contains the JSON metadata for the struct [Mirage] +type mirageJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,40 +92,40 @@ type zoneSettingMirageJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingMirage) UnmarshalJSON(data []byte) (err error) { +func (r *Mirage) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingMirageJSON) RawJSON() string { +func (r mirageJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingMirageID string +type MirageID string const ( - ZoneSettingMirageIDMirage ZoneSettingMirageID = "mirage" + MirageIDMirage MirageID = "mirage" ) -func (r ZoneSettingMirageID) IsKnown() bool { +func (r MirageID) IsKnown() bool { switch r { - case ZoneSettingMirageIDMirage: + case MirageIDMirage: return true } return false } // Current value of the zone setting. -type ZoneSettingMirageValue string +type MirageValue string const ( - ZoneSettingMirageValueOn ZoneSettingMirageValue = "on" - ZoneSettingMirageValueOff ZoneSettingMirageValue = "off" + MirageValueOn MirageValue = "on" + MirageValueOff MirageValue = "off" ) -func (r ZoneSettingMirageValue) IsKnown() bool { +func (r MirageValue) IsKnown() bool { switch r { - case ZoneSettingMirageValueOn, ZoneSettingMirageValueOff: + case MirageValueOn, MirageValueOff: return true } return false @@ -134,16 +133,16 @@ func (r ZoneSettingMirageValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingMirageEditable bool +type MirageEditable bool const ( - ZoneSettingMirageEditableTrue ZoneSettingMirageEditable = true - ZoneSettingMirageEditableFalse ZoneSettingMirageEditable = false + MirageEditableTrue MirageEditable = true + MirageEditableFalse MirageEditable = false ) -func (r ZoneSettingMirageEditable) IsKnown() bool { +func (r MirageEditable) IsKnown() bool { switch r { - case ZoneSettingMirageEditableTrue, ZoneSettingMirageEditableFalse: + case MirageEditableTrue, MirageEditableFalse: return true } return false @@ -185,7 +184,7 @@ type SettingMirageEditResponseEnvelope struct { // Refer to // [our blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for // more information. - Result ZoneSettingMirage `json:"result"` + Result Mirage `json:"result"` JSON settingMirageEditResponseEnvelopeJSON `json:"-"` } @@ -222,7 +221,7 @@ type SettingMirageGetResponseEnvelope struct { // Refer to // [our blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for // more information. - Result ZoneSettingMirage `json:"result"` + Result Mirage `json:"result"` JSON settingMirageGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingmobileredirect.go b/zones/settingmobileredirect.go index c32d748230e..559385a9317 100644 --- a/zones/settingmobileredirect.go +++ b/zones/settingmobileredirect.go @@ -37,7 +37,7 @@ func NewSettingMobileRedirectService(opts ...option.RequestOption) (r *SettingMo // subdomain. Refer to // [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) // for more information. -func (r *SettingMobileRedirectService) Edit(ctx context.Context, params SettingMobileRedirectEditParams, opts ...option.RequestOption) (res *ZoneSettingMobileRedirect, err error) { +func (r *SettingMobileRedirectService) Edit(ctx context.Context, params SettingMobileRedirectEditParams, opts ...option.RequestOption) (res *MobileRedirect, err error) { opts = append(r.Options[:], opts...) var env SettingMobileRedirectEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/mobile_redirect", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingMobileRedirectService) Edit(ctx context.Context, params SettingM // subdomain. Refer to // [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) // for more information. -func (r *SettingMobileRedirectService) Get(ctx context.Context, query SettingMobileRedirectGetParams, opts ...option.RequestOption) (res *ZoneSettingMobileRedirect, err error) { +func (r *SettingMobileRedirectService) Get(ctx context.Context, query SettingMobileRedirectGetParams, opts ...option.RequestOption) (res *MobileRedirect, err error) { opts = append(r.Options[:], opts...) var env SettingMobileRedirectGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/mobile_redirect", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingMobileRedirectService) Get(ctx context.Context, query SettingMob // subdomain. Refer to // [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) // for more information. -type ZoneSettingMobileRedirect struct { +type MobileRedirect struct { // Identifier of the zone setting. - ID ZoneSettingMobileRedirectID `json:"id,required"` + ID MobileRedirectID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingMobileRedirectValue `json:"value,required"` + Value MobileRedirectValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingMobileRedirectEditable `json:"editable"` + Editable MobileRedirectEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingMobileRedirectJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON mobileRedirectJSON `json:"-"` } -// zoneSettingMobileRedirectJSON contains the JSON metadata for the struct -// [ZoneSettingMobileRedirect] -type zoneSettingMobileRedirectJSON struct { +// mobileRedirectJSON contains the JSON metadata for the struct [MobileRedirect] +type mobileRedirectJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,45 +92,45 @@ type zoneSettingMobileRedirectJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingMobileRedirect) UnmarshalJSON(data []byte) (err error) { +func (r *MobileRedirect) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingMobileRedirectJSON) RawJSON() string { +func (r mobileRedirectJSON) RawJSON() string { return r.raw } // Identifier of the zone setting. -type ZoneSettingMobileRedirectID string +type MobileRedirectID string const ( - ZoneSettingMobileRedirectIDMobileRedirect ZoneSettingMobileRedirectID = "mobile_redirect" + MobileRedirectIDMobileRedirect MobileRedirectID = "mobile_redirect" ) -func (r ZoneSettingMobileRedirectID) IsKnown() bool { +func (r MobileRedirectID) IsKnown() bool { switch r { - case ZoneSettingMobileRedirectIDMobileRedirect: + case MobileRedirectIDMobileRedirect: return true } return false } // Current value of the zone setting. -type ZoneSettingMobileRedirectValue struct { +type MobileRedirectValue struct { // Which subdomain prefix you wish to redirect visitors on mobile devices to // (subdomain must already exist). MobileSubdomain string `json:"mobile_subdomain,nullable"` // Whether or not mobile redirect is enabled. - Status ZoneSettingMobileRedirectValueStatus `json:"status"` + Status MobileRedirectValueStatus `json:"status"` // Whether to drop the current page path and redirect to the mobile subdomain URL // root, or keep the path and redirect to the same page on the mobile subdomain. - StripURI bool `json:"strip_uri"` - JSON zoneSettingMobileRedirectValueJSON `json:"-"` + StripURI bool `json:"strip_uri"` + JSON mobileRedirectValueJSON `json:"-"` } -// zoneSettingMobileRedirectValueJSON contains the JSON metadata for the struct -// [ZoneSettingMobileRedirectValue] -type zoneSettingMobileRedirectValueJSON struct { +// mobileRedirectValueJSON contains the JSON metadata for the struct +// [MobileRedirectValue] +type mobileRedirectValueJSON struct { MobileSubdomain apijson.Field Status apijson.Field StripURI apijson.Field @@ -139,25 +138,25 @@ type zoneSettingMobileRedirectValueJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingMobileRedirectValue) UnmarshalJSON(data []byte) (err error) { +func (r *MobileRedirectValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingMobileRedirectValueJSON) RawJSON() string { +func (r mobileRedirectValueJSON) RawJSON() string { return r.raw } // Whether or not mobile redirect is enabled. -type ZoneSettingMobileRedirectValueStatus string +type MobileRedirectValueStatus string const ( - ZoneSettingMobileRedirectValueStatusOn ZoneSettingMobileRedirectValueStatus = "on" - ZoneSettingMobileRedirectValueStatusOff ZoneSettingMobileRedirectValueStatus = "off" + MobileRedirectValueStatusOn MobileRedirectValueStatus = "on" + MobileRedirectValueStatusOff MobileRedirectValueStatus = "off" ) -func (r ZoneSettingMobileRedirectValueStatus) IsKnown() bool { +func (r MobileRedirectValueStatus) IsKnown() bool { switch r { - case ZoneSettingMobileRedirectValueStatusOn, ZoneSettingMobileRedirectValueStatusOff: + case MobileRedirectValueStatusOn, MobileRedirectValueStatusOff: return true } return false @@ -165,16 +164,16 @@ func (r ZoneSettingMobileRedirectValueStatus) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingMobileRedirectEditable bool +type MobileRedirectEditable bool const ( - ZoneSettingMobileRedirectEditableTrue ZoneSettingMobileRedirectEditable = true - ZoneSettingMobileRedirectEditableFalse ZoneSettingMobileRedirectEditable = false + MobileRedirectEditableTrue MobileRedirectEditable = true + MobileRedirectEditableFalse MobileRedirectEditable = false ) -func (r ZoneSettingMobileRedirectEditable) IsKnown() bool { +func (r MobileRedirectEditable) IsKnown() bool { switch r { - case ZoneSettingMobileRedirectEditableTrue, ZoneSettingMobileRedirectEditableFalse: + case MobileRedirectEditableTrue, MobileRedirectEditableFalse: return true } return false @@ -232,7 +231,7 @@ type SettingMobileRedirectEditResponseEnvelope struct { // subdomain. Refer to // [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) // for more information. - Result ZoneSettingMobileRedirect `json:"result"` + Result MobileRedirect `json:"result"` JSON settingMobileRedirectEditResponseEnvelopeJSON `json:"-"` } @@ -269,7 +268,7 @@ type SettingMobileRedirectGetResponseEnvelope struct { // subdomain. Refer to // [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) // for more information. - Result ZoneSettingMobileRedirect `json:"result"` + Result MobileRedirect `json:"result"` JSON settingMobileRedirectGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingnel.go b/zones/settingnel.go index 2917c3d272d..aca52409d00 100644 --- a/zones/settingnel.go +++ b/zones/settingnel.go @@ -35,7 +35,7 @@ func NewSettingNELService(opts ...option.RequestOption) (r *SettingNELService) { // Automatically optimize image loading for website visitors on mobile devices. // Refer to our [blog post](http://blog.cloudflare.com/nel-solving-mobile-speed) // for more information. -func (r *SettingNELService) Edit(ctx context.Context, params SettingNELEditParams, opts ...option.RequestOption) (res *ZoneSettingNEL, err error) { +func (r *SettingNELService) Edit(ctx context.Context, params SettingNELEditParams, opts ...option.RequestOption) (res *NEL, err error) { opts = append(r.Options[:], opts...) var env SettingNELEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/nel", params.ZoneID) @@ -48,7 +48,7 @@ func (r *SettingNELService) Edit(ctx context.Context, params SettingNELEditParam } // Enable Network Error Logging reporting on your zone. (Beta) -func (r *SettingNELService) Get(ctx context.Context, query SettingNELGetParams, opts ...option.RequestOption) (res *ZoneSettingNEL, err error) { +func (r *SettingNELService) Get(ctx context.Context, query SettingNELGetParams, opts ...option.RequestOption) (res *NEL, err error) { opts = append(r.Options[:], opts...) var env SettingNELGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/nel", query.ZoneID) @@ -61,21 +61,21 @@ func (r *SettingNELService) Get(ctx context.Context, query SettingNELGetParams, } // Enable Network Error Logging reporting on your zone. (Beta) -type ZoneSettingNEL struct { +type NEL struct { // Zone setting identifier. - ID ZoneSettingNELID `json:"id,required"` + ID NELID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingNELValue `json:"value,required"` + Value NELValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingNELEditable `json:"editable"` + Editable NELEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingNELJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON nelJSON `json:"-"` } -// zoneSettingNELJSON contains the JSON metadata for the struct [ZoneSettingNEL] -type zoneSettingNELJSON struct { +// nelJSON contains the JSON metadata for the struct [NEL] +type nelJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,86 +84,85 @@ type zoneSettingNELJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingNEL) UnmarshalJSON(data []byte) (err error) { +func (r *NEL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingNELJSON) RawJSON() string { +func (r nelJSON) RawJSON() string { return r.raw } // Zone setting identifier. -type ZoneSettingNELID string +type NELID string const ( - ZoneSettingNELIDNEL ZoneSettingNELID = "nel" + NELIDNEL NELID = "nel" ) -func (r ZoneSettingNELID) IsKnown() bool { +func (r NELID) IsKnown() bool { switch r { - case ZoneSettingNELIDNEL: + case NELIDNEL: return true } return false } // Current value of the zone setting. -type ZoneSettingNELValue struct { - Enabled bool `json:"enabled"` - JSON zoneSettingNELValueJSON `json:"-"` +type NELValue struct { + Enabled bool `json:"enabled"` + JSON nelValueJSON `json:"-"` } -// zoneSettingNELValueJSON contains the JSON metadata for the struct -// [ZoneSettingNELValue] -type zoneSettingNELValueJSON struct { +// nelValueJSON contains the JSON metadata for the struct [NELValue] +type nelValueJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZoneSettingNELValue) UnmarshalJSON(data []byte) (err error) { +func (r *NELValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingNELValueJSON) RawJSON() string { +func (r nelValueJSON) RawJSON() string { return r.raw } // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingNELEditable bool +type NELEditable bool const ( - ZoneSettingNELEditableTrue ZoneSettingNELEditable = true - ZoneSettingNELEditableFalse ZoneSettingNELEditable = false + NELEditableTrue NELEditable = true + NELEditableFalse NELEditable = false ) -func (r ZoneSettingNELEditable) IsKnown() bool { +func (r NELEditable) IsKnown() bool { switch r { - case ZoneSettingNELEditableTrue, ZoneSettingNELEditableFalse: + case NELEditableTrue, NELEditableFalse: return true } return false } // Enable Network Error Logging reporting on your zone. (Beta) -type ZoneSettingNELParam struct { +type NELParam struct { // Zone setting identifier. - ID param.Field[ZoneSettingNELID] `json:"id,required"` + ID param.Field[NELID] `json:"id,required"` // Current value of the zone setting. - Value param.Field[ZoneSettingNELValueParam] `json:"value,required"` + Value param.Field[NELValueParam] `json:"value,required"` } -func (r ZoneSettingNELParam) MarshalJSON() (data []byte, err error) { +func (r NELParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Current value of the zone setting. -type ZoneSettingNELValueParam struct { +type NELValueParam struct { Enabled param.Field[bool] `json:"enabled"` } -func (r ZoneSettingNELValueParam) MarshalJSON() (data []byte, err error) { +func (r NELValueParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -171,7 +170,7 @@ type SettingNELEditParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // Enable Network Error Logging reporting on your zone. (Beta) - Value param.Field[ZoneSettingNELParam] `json:"value,required"` + Value param.Field[NELParam] `json:"value,required"` } func (r SettingNELEditParams) MarshalJSON() (data []byte, err error) { @@ -184,7 +183,7 @@ type SettingNELEditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enable Network Error Logging reporting on your zone. (Beta) - Result ZoneSettingNEL `json:"result"` + Result NEL `json:"result"` JSON settingNELEditResponseEnvelopeJSON `json:"-"` } @@ -218,7 +217,7 @@ type SettingNELGetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enable Network Error Logging reporting on your zone. (Beta) - Result ZoneSettingNEL `json:"result"` + Result NEL `json:"result"` JSON settingNELGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingnel_test.go b/zones/settingnel_test.go index 8c1e24fe5a9..e3187fd522a 100644 --- a/zones/settingnel_test.go +++ b/zones/settingnel_test.go @@ -30,9 +30,9 @@ func TestSettingNELEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.NEL.Edit(context.TODO(), zones.SettingNELEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingNELParam{ - ID: cloudflare.F(zones.ZoneSettingNELIDNEL), - Value: cloudflare.F(zones.ZoneSettingNELValueParam{ + Value: cloudflare.F(zones.NELParam{ + ID: cloudflare.F(zones.NELIDNEL), + Value: cloudflare.F(zones.NELValueParam{ Enabled: cloudflare.F(false), }), }), diff --git a/zones/settingopportunisticencryption.go b/zones/settingopportunisticencryption.go index d5f81a32661..d78e86e1491 100644 --- a/zones/settingopportunisticencryption.go +++ b/zones/settingopportunisticencryption.go @@ -34,7 +34,7 @@ func NewSettingOpportunisticEncryptionService(opts ...option.RequestOption) (r * } // Changes Opportunistic Encryption setting. -func (r *SettingOpportunisticEncryptionService) Edit(ctx context.Context, params SettingOpportunisticEncryptionEditParams, opts ...option.RequestOption) (res *ZoneSettingOpportunisticEncryption, err error) { +func (r *SettingOpportunisticEncryptionService) Edit(ctx context.Context, params SettingOpportunisticEncryptionEditParams, opts ...option.RequestOption) (res *OpportunisticEncryption, err error) { opts = append(r.Options[:], opts...) var env SettingOpportunisticEncryptionEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/opportunistic_encryption", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingOpportunisticEncryptionService) Edit(ctx context.Context, params } // Gets Opportunistic Encryption setting. -func (r *SettingOpportunisticEncryptionService) Get(ctx context.Context, query SettingOpportunisticEncryptionGetParams, opts ...option.RequestOption) (res *ZoneSettingOpportunisticEncryption, err error) { +func (r *SettingOpportunisticEncryptionService) Get(ctx context.Context, query SettingOpportunisticEncryptionGetParams, opts ...option.RequestOption) (res *OpportunisticEncryption, err error) { opts = append(r.Options[:], opts...) var env SettingOpportunisticEncryptionGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/opportunistic_encryption", query.ZoneID) @@ -60,22 +60,22 @@ func (r *SettingOpportunisticEncryptionService) Get(ctx context.Context, query S } // Enables the Opportunistic Encryption feature for a zone. -type ZoneSettingOpportunisticEncryption struct { +type OpportunisticEncryption struct { // ID of the zone setting. - ID ZoneSettingOpportunisticEncryptionID `json:"id,required"` + ID OpportunisticEncryptionID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingOpportunisticEncryptionValue `json:"value,required"` + Value OpportunisticEncryptionValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingOpportunisticEncryptionEditable `json:"editable"` + Editable OpportunisticEncryptionEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingOpportunisticEncryptionJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON opportunisticEncryptionJSON `json:"-"` } -// zoneSettingOpportunisticEncryptionJSON contains the JSON metadata for the struct -// [ZoneSettingOpportunisticEncryption] -type zoneSettingOpportunisticEncryptionJSON struct { +// opportunisticEncryptionJSON contains the JSON metadata for the struct +// [OpportunisticEncryption] +type opportunisticEncryptionJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,40 +84,40 @@ type zoneSettingOpportunisticEncryptionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingOpportunisticEncryption) UnmarshalJSON(data []byte) (err error) { +func (r *OpportunisticEncryption) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingOpportunisticEncryptionJSON) RawJSON() string { +func (r opportunisticEncryptionJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingOpportunisticEncryptionID string +type OpportunisticEncryptionID string const ( - ZoneSettingOpportunisticEncryptionIDOpportunisticEncryption ZoneSettingOpportunisticEncryptionID = "opportunistic_encryption" + OpportunisticEncryptionIDOpportunisticEncryption OpportunisticEncryptionID = "opportunistic_encryption" ) -func (r ZoneSettingOpportunisticEncryptionID) IsKnown() bool { +func (r OpportunisticEncryptionID) IsKnown() bool { switch r { - case ZoneSettingOpportunisticEncryptionIDOpportunisticEncryption: + case OpportunisticEncryptionIDOpportunisticEncryption: return true } return false } // Current value of the zone setting. -type ZoneSettingOpportunisticEncryptionValue string +type OpportunisticEncryptionValue string const ( - ZoneSettingOpportunisticEncryptionValueOn ZoneSettingOpportunisticEncryptionValue = "on" - ZoneSettingOpportunisticEncryptionValueOff ZoneSettingOpportunisticEncryptionValue = "off" + OpportunisticEncryptionValueOn OpportunisticEncryptionValue = "on" + OpportunisticEncryptionValueOff OpportunisticEncryptionValue = "off" ) -func (r ZoneSettingOpportunisticEncryptionValue) IsKnown() bool { +func (r OpportunisticEncryptionValue) IsKnown() bool { switch r { - case ZoneSettingOpportunisticEncryptionValueOn, ZoneSettingOpportunisticEncryptionValueOff: + case OpportunisticEncryptionValueOn, OpportunisticEncryptionValueOff: return true } return false @@ -125,16 +125,16 @@ func (r ZoneSettingOpportunisticEncryptionValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingOpportunisticEncryptionEditable bool +type OpportunisticEncryptionEditable bool const ( - ZoneSettingOpportunisticEncryptionEditableTrue ZoneSettingOpportunisticEncryptionEditable = true - ZoneSettingOpportunisticEncryptionEditableFalse ZoneSettingOpportunisticEncryptionEditable = false + OpportunisticEncryptionEditableTrue OpportunisticEncryptionEditable = true + OpportunisticEncryptionEditableFalse OpportunisticEncryptionEditable = false ) -func (r ZoneSettingOpportunisticEncryptionEditable) IsKnown() bool { +func (r OpportunisticEncryptionEditable) IsKnown() bool { switch r { - case ZoneSettingOpportunisticEncryptionEditableTrue, ZoneSettingOpportunisticEncryptionEditableFalse: + case OpportunisticEncryptionEditableTrue, OpportunisticEncryptionEditableFalse: return true } return false @@ -175,7 +175,7 @@ type SettingOpportunisticEncryptionEditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enables the Opportunistic Encryption feature for a zone. - Result ZoneSettingOpportunisticEncryption `json:"result"` + Result OpportunisticEncryption `json:"result"` JSON settingOpportunisticEncryptionEditResponseEnvelopeJSON `json:"-"` } @@ -209,7 +209,7 @@ type SettingOpportunisticEncryptionGetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enables the Opportunistic Encryption feature for a zone. - Result ZoneSettingOpportunisticEncryption `json:"result"` + Result OpportunisticEncryption `json:"result"` JSON settingOpportunisticEncryptionGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingopportunisticonion.go b/zones/settingopportunisticonion.go index 4b00272c477..40e869e9da7 100644 --- a/zones/settingopportunisticonion.go +++ b/zones/settingopportunisticonion.go @@ -35,7 +35,7 @@ func NewSettingOpportunisticOnionService(opts ...option.RequestOption) (r *Setti // Add an Alt-Svc header to all legitimate requests from Tor, allowing the // connection to use our onion services instead of exit nodes. -func (r *SettingOpportunisticOnionService) Edit(ctx context.Context, params SettingOpportunisticOnionEditParams, opts ...option.RequestOption) (res *ZoneSettingOpportunisticOnion, err error) { +func (r *SettingOpportunisticOnionService) Edit(ctx context.Context, params SettingOpportunisticOnionEditParams, opts ...option.RequestOption) (res *OpportunisticOnion, err error) { opts = append(r.Options[:], opts...) var env SettingOpportunisticOnionEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/opportunistic_onion", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingOpportunisticOnionService) Edit(ctx context.Context, params Sett // Add an Alt-Svc header to all legitimate requests from Tor, allowing the // connection to use our onion services instead of exit nodes. -func (r *SettingOpportunisticOnionService) Get(ctx context.Context, query SettingOpportunisticOnionGetParams, opts ...option.RequestOption) (res *ZoneSettingOpportunisticOnion, err error) { +func (r *SettingOpportunisticOnionService) Get(ctx context.Context, query SettingOpportunisticOnionGetParams, opts ...option.RequestOption) (res *OpportunisticOnion, err error) { opts = append(r.Options[:], opts...) var env SettingOpportunisticOnionGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/opportunistic_onion", query.ZoneID) @@ -63,22 +63,22 @@ func (r *SettingOpportunisticOnionService) Get(ctx context.Context, query Settin // Add an Alt-Svc header to all legitimate requests from Tor, allowing the // connection to use our onion services instead of exit nodes. -type ZoneSettingOpportunisticOnion struct { +type OpportunisticOnion struct { // ID of the zone setting. - ID ZoneSettingOpportunisticOnionID `json:"id,required"` + ID OpportunisticOnionID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingOpportunisticOnionValue `json:"value,required"` + Value OpportunisticOnionValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingOpportunisticOnionEditable `json:"editable"` + Editable OpportunisticOnionEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingOpportunisticOnionJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON opportunisticOnionJSON `json:"-"` } -// zoneSettingOpportunisticOnionJSON contains the JSON metadata for the struct -// [ZoneSettingOpportunisticOnion] -type zoneSettingOpportunisticOnionJSON struct { +// opportunisticOnionJSON contains the JSON metadata for the struct +// [OpportunisticOnion] +type opportunisticOnionJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +87,40 @@ type zoneSettingOpportunisticOnionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingOpportunisticOnion) UnmarshalJSON(data []byte) (err error) { +func (r *OpportunisticOnion) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingOpportunisticOnionJSON) RawJSON() string { +func (r opportunisticOnionJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingOpportunisticOnionID string +type OpportunisticOnionID string const ( - ZoneSettingOpportunisticOnionIDOpportunisticOnion ZoneSettingOpportunisticOnionID = "opportunistic_onion" + OpportunisticOnionIDOpportunisticOnion OpportunisticOnionID = "opportunistic_onion" ) -func (r ZoneSettingOpportunisticOnionID) IsKnown() bool { +func (r OpportunisticOnionID) IsKnown() bool { switch r { - case ZoneSettingOpportunisticOnionIDOpportunisticOnion: + case OpportunisticOnionIDOpportunisticOnion: return true } return false } // Current value of the zone setting. -type ZoneSettingOpportunisticOnionValue string +type OpportunisticOnionValue string const ( - ZoneSettingOpportunisticOnionValueOn ZoneSettingOpportunisticOnionValue = "on" - ZoneSettingOpportunisticOnionValueOff ZoneSettingOpportunisticOnionValue = "off" + OpportunisticOnionValueOn OpportunisticOnionValue = "on" + OpportunisticOnionValueOff OpportunisticOnionValue = "off" ) -func (r ZoneSettingOpportunisticOnionValue) IsKnown() bool { +func (r OpportunisticOnionValue) IsKnown() bool { switch r { - case ZoneSettingOpportunisticOnionValueOn, ZoneSettingOpportunisticOnionValueOff: + case OpportunisticOnionValueOn, OpportunisticOnionValueOff: return true } return false @@ -128,16 +128,16 @@ func (r ZoneSettingOpportunisticOnionValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingOpportunisticOnionEditable bool +type OpportunisticOnionEditable bool const ( - ZoneSettingOpportunisticOnionEditableTrue ZoneSettingOpportunisticOnionEditable = true - ZoneSettingOpportunisticOnionEditableFalse ZoneSettingOpportunisticOnionEditable = false + OpportunisticOnionEditableTrue OpportunisticOnionEditable = true + OpportunisticOnionEditableFalse OpportunisticOnionEditable = false ) -func (r ZoneSettingOpportunisticOnionEditable) IsKnown() bool { +func (r OpportunisticOnionEditable) IsKnown() bool { switch r { - case ZoneSettingOpportunisticOnionEditableTrue, ZoneSettingOpportunisticOnionEditableFalse: + case OpportunisticOnionEditableTrue, OpportunisticOnionEditableFalse: return true } return false @@ -179,7 +179,7 @@ type SettingOpportunisticOnionEditResponseEnvelope struct { Success bool `json:"success,required"` // Add an Alt-Svc header to all legitimate requests from Tor, allowing the // connection to use our onion services instead of exit nodes. - Result ZoneSettingOpportunisticOnion `json:"result"` + Result OpportunisticOnion `json:"result"` JSON settingOpportunisticOnionEditResponseEnvelopeJSON `json:"-"` } @@ -214,7 +214,7 @@ type SettingOpportunisticOnionGetResponseEnvelope struct { Success bool `json:"success,required"` // Add an Alt-Svc header to all legitimate requests from Tor, allowing the // connection to use our onion services instead of exit nodes. - Result ZoneSettingOpportunisticOnion `json:"result"` + Result OpportunisticOnion `json:"result"` JSON settingOpportunisticOnionGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingorangetoorange.go b/zones/settingorangetoorange.go index bd246b45b2e..d8e277c834a 100644 --- a/zones/settingorangetoorange.go +++ b/zones/settingorangetoorange.go @@ -35,7 +35,7 @@ func NewSettingOrangeToOrangeService(opts ...option.RequestOption) (r *SettingOr // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. -func (r *SettingOrangeToOrangeService) Edit(ctx context.Context, params SettingOrangeToOrangeEditParams, opts ...option.RequestOption) (res *ZoneSettingOrangeToOrange, err error) { +func (r *SettingOrangeToOrangeService) Edit(ctx context.Context, params SettingOrangeToOrangeEditParams, opts ...option.RequestOption) (res *OrangeToOrange, err error) { opts = append(r.Options[:], opts...) var env SettingOrangeToOrangeEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/orange_to_orange", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingOrangeToOrangeService) Edit(ctx context.Context, params SettingO // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. -func (r *SettingOrangeToOrangeService) Get(ctx context.Context, query SettingOrangeToOrangeGetParams, opts ...option.RequestOption) (res *ZoneSettingOrangeToOrange, err error) { +func (r *SettingOrangeToOrangeService) Get(ctx context.Context, query SettingOrangeToOrangeGetParams, opts ...option.RequestOption) (res *OrangeToOrange, err error) { opts = append(r.Options[:], opts...) var env SettingOrangeToOrangeGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/orange_to_orange", query.ZoneID) @@ -63,22 +63,21 @@ func (r *SettingOrangeToOrangeService) Get(ctx context.Context, query SettingOra // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. -type ZoneSettingOrangeToOrange struct { +type OrangeToOrange struct { // ID of the zone setting. - ID ZoneSettingOrangeToOrangeID `json:"id,required"` + ID OrangeToOrangeID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingOrangeToOrangeValue `json:"value,required"` + Value OrangeToOrangeValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingOrangeToOrangeEditable `json:"editable"` + Editable OrangeToOrangeEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingOrangeToOrangeJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON orangeToOrangeJSON `json:"-"` } -// zoneSettingOrangeToOrangeJSON contains the JSON metadata for the struct -// [ZoneSettingOrangeToOrange] -type zoneSettingOrangeToOrangeJSON struct { +// orangeToOrangeJSON contains the JSON metadata for the struct [OrangeToOrange] +type orangeToOrangeJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +86,40 @@ type zoneSettingOrangeToOrangeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingOrangeToOrange) UnmarshalJSON(data []byte) (err error) { +func (r *OrangeToOrange) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingOrangeToOrangeJSON) RawJSON() string { +func (r orangeToOrangeJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingOrangeToOrangeID string +type OrangeToOrangeID string const ( - ZoneSettingOrangeToOrangeIDOrangeToOrange ZoneSettingOrangeToOrangeID = "orange_to_orange" + OrangeToOrangeIDOrangeToOrange OrangeToOrangeID = "orange_to_orange" ) -func (r ZoneSettingOrangeToOrangeID) IsKnown() bool { +func (r OrangeToOrangeID) IsKnown() bool { switch r { - case ZoneSettingOrangeToOrangeIDOrangeToOrange: + case OrangeToOrangeIDOrangeToOrange: return true } return false } // Current value of the zone setting. -type ZoneSettingOrangeToOrangeValue string +type OrangeToOrangeValue string const ( - ZoneSettingOrangeToOrangeValueOn ZoneSettingOrangeToOrangeValue = "on" - ZoneSettingOrangeToOrangeValueOff ZoneSettingOrangeToOrangeValue = "off" + OrangeToOrangeValueOn OrangeToOrangeValue = "on" + OrangeToOrangeValueOff OrangeToOrangeValue = "off" ) -func (r ZoneSettingOrangeToOrangeValue) IsKnown() bool { +func (r OrangeToOrangeValue) IsKnown() bool { switch r { - case ZoneSettingOrangeToOrangeValueOn, ZoneSettingOrangeToOrangeValueOff: + case OrangeToOrangeValueOn, OrangeToOrangeValueOff: return true } return false @@ -128,16 +127,16 @@ func (r ZoneSettingOrangeToOrangeValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingOrangeToOrangeEditable bool +type OrangeToOrangeEditable bool const ( - ZoneSettingOrangeToOrangeEditableTrue ZoneSettingOrangeToOrangeEditable = true - ZoneSettingOrangeToOrangeEditableFalse ZoneSettingOrangeToOrangeEditable = false + OrangeToOrangeEditableTrue OrangeToOrangeEditable = true + OrangeToOrangeEditableFalse OrangeToOrangeEditable = false ) -func (r ZoneSettingOrangeToOrangeEditable) IsKnown() bool { +func (r OrangeToOrangeEditable) IsKnown() bool { switch r { - case ZoneSettingOrangeToOrangeEditableTrue, ZoneSettingOrangeToOrangeEditableFalse: + case OrangeToOrangeEditableTrue, OrangeToOrangeEditableFalse: return true } return false @@ -145,14 +144,14 @@ func (r ZoneSettingOrangeToOrangeEditable) IsKnown() bool { // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. -type ZoneSettingOrangeToOrangeParam struct { +type OrangeToOrangeParam struct { // ID of the zone setting. - ID param.Field[ZoneSettingOrangeToOrangeID] `json:"id,required"` + ID param.Field[OrangeToOrangeID] `json:"id,required"` // Current value of the zone setting. - Value param.Field[ZoneSettingOrangeToOrangeValue] `json:"value,required"` + Value param.Field[OrangeToOrangeValue] `json:"value,required"` } -func (r ZoneSettingOrangeToOrangeParam) MarshalJSON() (data []byte, err error) { +func (r OrangeToOrangeParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -161,7 +160,7 @@ type SettingOrangeToOrangeEditParams struct { ZoneID param.Field[string] `path:"zone_id,required"` // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. - Value param.Field[ZoneSettingOrangeToOrangeParam] `json:"value,required"` + Value param.Field[OrangeToOrangeParam] `json:"value,required"` } func (r SettingOrangeToOrangeEditParams) MarshalJSON() (data []byte, err error) { @@ -175,7 +174,7 @@ type SettingOrangeToOrangeEditResponseEnvelope struct { Success bool `json:"success,required"` // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. - Result ZoneSettingOrangeToOrange `json:"result"` + Result OrangeToOrange `json:"result"` JSON settingOrangeToOrangeEditResponseEnvelopeJSON `json:"-"` } @@ -210,7 +209,7 @@ type SettingOrangeToOrangeGetResponseEnvelope struct { Success bool `json:"success,required"` // Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also // on Cloudflare. - Result ZoneSettingOrangeToOrange `json:"result"` + Result OrangeToOrange `json:"result"` JSON settingOrangeToOrangeGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingorangetoorange_test.go b/zones/settingorangetoorange_test.go index e2dbba4a226..dfed5834f13 100644 --- a/zones/settingorangetoorange_test.go +++ b/zones/settingorangetoorange_test.go @@ -30,9 +30,9 @@ func TestSettingOrangeToOrangeEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.OrangeToOrange.Edit(context.TODO(), zones.SettingOrangeToOrangeEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingOrangeToOrangeParam{ - ID: cloudflare.F(zones.ZoneSettingOrangeToOrangeIDOrangeToOrange), - Value: cloudflare.F(zones.ZoneSettingOrangeToOrangeValueOn), + Value: cloudflare.F(zones.OrangeToOrangeParam{ + ID: cloudflare.F(zones.OrangeToOrangeIDOrangeToOrange), + Value: cloudflare.F(zones.OrangeToOrangeValueOn), }), }) if err != nil { diff --git a/zones/settingoriginerrorpagepassthru.go b/zones/settingoriginerrorpagepassthru.go index 3cea199f351..9ac0bbeefa3 100644 --- a/zones/settingoriginerrorpagepassthru.go +++ b/zones/settingoriginerrorpagepassthru.go @@ -36,7 +36,7 @@ func NewSettingOriginErrorPagePassThruService(opts ...option.RequestOption) (r * // Cloudflare will proxy customer error pages on any 502,504 errors on origin // server instead of showing a default Cloudflare error page. This does not apply // to 522 errors and is limited to Enterprise Zones. -func (r *SettingOriginErrorPagePassThruService) Edit(ctx context.Context, params SettingOriginErrorPagePassThruEditParams, opts ...option.RequestOption) (res *ZoneSettingOriginErrorPagePassThru, err error) { +func (r *SettingOriginErrorPagePassThruService) Edit(ctx context.Context, params SettingOriginErrorPagePassThruEditParams, opts ...option.RequestOption) (res *OriginErrorPagePassThru, err error) { opts = append(r.Options[:], opts...) var env SettingOriginErrorPagePassThruEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/origin_error_page_pass_thru", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingOriginErrorPagePassThruService) Edit(ctx context.Context, params // Cloudflare will proxy customer error pages on any 502,504 errors on origin // server instead of showing a default Cloudflare error page. This does not apply // to 522 errors and is limited to Enterprise Zones. -func (r *SettingOriginErrorPagePassThruService) Get(ctx context.Context, query SettingOriginErrorPagePassThruGetParams, opts ...option.RequestOption) (res *ZoneSettingOriginErrorPagePassThru, err error) { +func (r *SettingOriginErrorPagePassThruService) Get(ctx context.Context, query SettingOriginErrorPagePassThruGetParams, opts ...option.RequestOption) (res *OriginErrorPagePassThru, err error) { opts = append(r.Options[:], opts...) var env SettingOriginErrorPagePassThruGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/origin_error_page_pass_thru", query.ZoneID) @@ -66,22 +66,22 @@ func (r *SettingOriginErrorPagePassThruService) Get(ctx context.Context, query S // Cloudflare will proxy customer error pages on any 502,504 errors on origin // server instead of showing a default Cloudflare error page. This does not apply // to 522 errors and is limited to Enterprise Zones. -type ZoneSettingOriginErrorPagePassThru struct { +type OriginErrorPagePassThru struct { // ID of the zone setting. - ID ZoneSettingOriginErrorPagePassThruID `json:"id,required"` + ID OriginErrorPagePassThruID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingOriginErrorPagePassThruValue `json:"value,required"` + Value OriginErrorPagePassThruValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingOriginErrorPagePassThruEditable `json:"editable"` + Editable OriginErrorPagePassThruEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingOriginErrorPagePassThruJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON originErrorPagePassThruJSON `json:"-"` } -// zoneSettingOriginErrorPagePassThruJSON contains the JSON metadata for the struct -// [ZoneSettingOriginErrorPagePassThru] -type zoneSettingOriginErrorPagePassThruJSON struct { +// originErrorPagePassThruJSON contains the JSON metadata for the struct +// [OriginErrorPagePassThru] +type originErrorPagePassThruJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -90,40 +90,40 @@ type zoneSettingOriginErrorPagePassThruJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingOriginErrorPagePassThru) UnmarshalJSON(data []byte) (err error) { +func (r *OriginErrorPagePassThru) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingOriginErrorPagePassThruJSON) RawJSON() string { +func (r originErrorPagePassThruJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingOriginErrorPagePassThruID string +type OriginErrorPagePassThruID string const ( - ZoneSettingOriginErrorPagePassThruIDOriginErrorPagePassThru ZoneSettingOriginErrorPagePassThruID = "origin_error_page_pass_thru" + OriginErrorPagePassThruIDOriginErrorPagePassThru OriginErrorPagePassThruID = "origin_error_page_pass_thru" ) -func (r ZoneSettingOriginErrorPagePassThruID) IsKnown() bool { +func (r OriginErrorPagePassThruID) IsKnown() bool { switch r { - case ZoneSettingOriginErrorPagePassThruIDOriginErrorPagePassThru: + case OriginErrorPagePassThruIDOriginErrorPagePassThru: return true } return false } // Current value of the zone setting. -type ZoneSettingOriginErrorPagePassThruValue string +type OriginErrorPagePassThruValue string const ( - ZoneSettingOriginErrorPagePassThruValueOn ZoneSettingOriginErrorPagePassThruValue = "on" - ZoneSettingOriginErrorPagePassThruValueOff ZoneSettingOriginErrorPagePassThruValue = "off" + OriginErrorPagePassThruValueOn OriginErrorPagePassThruValue = "on" + OriginErrorPagePassThruValueOff OriginErrorPagePassThruValue = "off" ) -func (r ZoneSettingOriginErrorPagePassThruValue) IsKnown() bool { +func (r OriginErrorPagePassThruValue) IsKnown() bool { switch r { - case ZoneSettingOriginErrorPagePassThruValueOn, ZoneSettingOriginErrorPagePassThruValueOff: + case OriginErrorPagePassThruValueOn, OriginErrorPagePassThruValueOff: return true } return false @@ -131,16 +131,16 @@ func (r ZoneSettingOriginErrorPagePassThruValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingOriginErrorPagePassThruEditable bool +type OriginErrorPagePassThruEditable bool const ( - ZoneSettingOriginErrorPagePassThruEditableTrue ZoneSettingOriginErrorPagePassThruEditable = true - ZoneSettingOriginErrorPagePassThruEditableFalse ZoneSettingOriginErrorPagePassThruEditable = false + OriginErrorPagePassThruEditableTrue OriginErrorPagePassThruEditable = true + OriginErrorPagePassThruEditableFalse OriginErrorPagePassThruEditable = false ) -func (r ZoneSettingOriginErrorPagePassThruEditable) IsKnown() bool { +func (r OriginErrorPagePassThruEditable) IsKnown() bool { switch r { - case ZoneSettingOriginErrorPagePassThruEditableTrue, ZoneSettingOriginErrorPagePassThruEditableFalse: + case OriginErrorPagePassThruEditableTrue, OriginErrorPagePassThruEditableFalse: return true } return false @@ -181,7 +181,7 @@ type SettingOriginErrorPagePassThruEditResponseEnvelope struct { // Cloudflare will proxy customer error pages on any 502,504 errors on origin // server instead of showing a default Cloudflare error page. This does not apply // to 522 errors and is limited to Enterprise Zones. - Result ZoneSettingOriginErrorPagePassThru `json:"result"` + Result OriginErrorPagePassThru `json:"result"` JSON settingOriginErrorPagePassThruEditResponseEnvelopeJSON `json:"-"` } @@ -217,7 +217,7 @@ type SettingOriginErrorPagePassThruGetResponseEnvelope struct { // Cloudflare will proxy customer error pages on any 502,504 errors on origin // server instead of showing a default Cloudflare error page. This does not apply // to 522 errors and is limited to Enterprise Zones. - Result ZoneSettingOriginErrorPagePassThru `json:"result"` + Result OriginErrorPagePassThru `json:"result"` JSON settingOriginErrorPagePassThruGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingpolish.go b/zones/settingpolish.go index a20883b0dae..bbdab2f5fd2 100644 --- a/zones/settingpolish.go +++ b/zones/settingpolish.go @@ -36,7 +36,7 @@ func NewSettingPolishService(opts ...option.RequestOption) (r *SettingPolishServ // Automatically optimize image loading for website visitors on mobile devices. // Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed) // for more information. -func (r *SettingPolishService) Edit(ctx context.Context, params SettingPolishEditParams, opts ...option.RequestOption) (res *ZoneSettingPolish, err error) { +func (r *SettingPolishService) Edit(ctx context.Context, params SettingPolishEditParams, opts ...option.RequestOption) (res *Polish, err error) { opts = append(r.Options[:], opts...) var env SettingPolishEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/polish", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingPolishService) Edit(ctx context.Context, params SettingPolishEdi // Automatically optimize image loading for website visitors on mobile devices. // Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed) // for more information. -func (r *SettingPolishService) Get(ctx context.Context, query SettingPolishGetParams, opts ...option.RequestOption) (res *ZoneSettingPolish, err error) { +func (r *SettingPolishService) Get(ctx context.Context, query SettingPolishGetParams, opts ...option.RequestOption) (res *Polish, err error) { opts = append(r.Options[:], opts...) var env SettingPolishGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/polish", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingPolishService) Get(ctx context.Context, query SettingPolishGetPa // image loading. Larger JPEGs are converted to progressive images, loading a // lower-resolution image first and ending in a higher-resolution version. Not // recommended for hi-res photography sites. -type ZoneSettingPolish struct { +type Polish struct { // ID of the zone setting. - ID ZoneSettingPolishID `json:"id,required"` + ID PolishID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingPolishValue `json:"value,required"` + Value PolishValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingPolishEditable `json:"editable"` + Editable PolishEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingPolishJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON polishJSON `json:"-"` } -// zoneSettingPolishJSON contains the JSON metadata for the struct -// [ZoneSettingPolish] -type zoneSettingPolishJSON struct { +// polishJSON contains the JSON metadata for the struct [Polish] +type polishJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,41 +92,41 @@ type zoneSettingPolishJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingPolish) UnmarshalJSON(data []byte) (err error) { +func (r *Polish) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingPolishJSON) RawJSON() string { +func (r polishJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingPolishID string +type PolishID string const ( - ZoneSettingPolishIDPolish ZoneSettingPolishID = "polish" + PolishIDPolish PolishID = "polish" ) -func (r ZoneSettingPolishID) IsKnown() bool { +func (r PolishID) IsKnown() bool { switch r { - case ZoneSettingPolishIDPolish: + case PolishIDPolish: return true } return false } // Current value of the zone setting. -type ZoneSettingPolishValue string +type PolishValue string const ( - ZoneSettingPolishValueOff ZoneSettingPolishValue = "off" - ZoneSettingPolishValueLossless ZoneSettingPolishValue = "lossless" - ZoneSettingPolishValueLossy ZoneSettingPolishValue = "lossy" + PolishValueOff PolishValue = "off" + PolishValueLossless PolishValue = "lossless" + PolishValueLossy PolishValue = "lossy" ) -func (r ZoneSettingPolishValue) IsKnown() bool { +func (r PolishValue) IsKnown() bool { switch r { - case ZoneSettingPolishValueOff, ZoneSettingPolishValueLossless, ZoneSettingPolishValueLossy: + case PolishValueOff, PolishValueLossless, PolishValueLossy: return true } return false @@ -135,16 +134,16 @@ func (r ZoneSettingPolishValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingPolishEditable bool +type PolishEditable bool const ( - ZoneSettingPolishEditableTrue ZoneSettingPolishEditable = true - ZoneSettingPolishEditableFalse ZoneSettingPolishEditable = false + PolishEditableTrue PolishEditable = true + PolishEditableFalse PolishEditable = false ) -func (r ZoneSettingPolishEditable) IsKnown() bool { +func (r PolishEditable) IsKnown() bool { switch r { - case ZoneSettingPolishEditableTrue, ZoneSettingPolishEditableFalse: + case PolishEditableTrue, PolishEditableFalse: return true } return false @@ -156,14 +155,14 @@ func (r ZoneSettingPolishEditable) IsKnown() bool { // image loading. Larger JPEGs are converted to progressive images, loading a // lower-resolution image first and ending in a higher-resolution version. Not // recommended for hi-res photography sites. -type ZoneSettingPolishParam struct { +type PolishParam struct { // ID of the zone setting. - ID param.Field[ZoneSettingPolishID] `json:"id,required"` + ID param.Field[PolishID] `json:"id,required"` // Current value of the zone setting. - Value param.Field[ZoneSettingPolishValue] `json:"value,required"` + Value param.Field[PolishValue] `json:"value,required"` } -func (r ZoneSettingPolishParam) MarshalJSON() (data []byte, err error) { +func (r PolishParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -176,7 +175,7 @@ type SettingPolishEditParams struct { // image loading. Larger JPEGs are converted to progressive images, loading a // lower-resolution image first and ending in a higher-resolution version. Not // recommended for hi-res photography sites. - Value param.Field[ZoneSettingPolishParam] `json:"value,required"` + Value param.Field[PolishParam] `json:"value,required"` } func (r SettingPolishEditParams) MarshalJSON() (data []byte, err error) { @@ -194,7 +193,7 @@ type SettingPolishEditResponseEnvelope struct { // image loading. Larger JPEGs are converted to progressive images, loading a // lower-resolution image first and ending in a higher-resolution version. Not // recommended for hi-res photography sites. - Result ZoneSettingPolish `json:"result"` + Result Polish `json:"result"` JSON settingPolishEditResponseEnvelopeJSON `json:"-"` } @@ -233,7 +232,7 @@ type SettingPolishGetResponseEnvelope struct { // image loading. Larger JPEGs are converted to progressive images, loading a // lower-resolution image first and ending in a higher-resolution version. Not // recommended for hi-res photography sites. - Result ZoneSettingPolish `json:"result"` + Result Polish `json:"result"` JSON settingPolishGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingpolish_test.go b/zones/settingpolish_test.go index 762f56783f9..a43ad239246 100644 --- a/zones/settingpolish_test.go +++ b/zones/settingpolish_test.go @@ -30,9 +30,9 @@ func TestSettingPolishEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.Polish.Edit(context.TODO(), zones.SettingPolishEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingPolishParam{ - ID: cloudflare.F(zones.ZoneSettingPolishIDPolish), - Value: cloudflare.F(zones.ZoneSettingPolishValueOff), + Value: cloudflare.F(zones.PolishParam{ + ID: cloudflare.F(zones.PolishIDPolish), + Value: cloudflare.F(zones.PolishValueOff), }), }) if err != nil { diff --git a/zones/settingprefetchpreload.go b/zones/settingprefetchpreload.go index befbc819002..a86481b08d4 100644 --- a/zones/settingprefetchpreload.go +++ b/zones/settingprefetchpreload.go @@ -35,7 +35,7 @@ func NewSettingPrefetchPreloadService(opts ...option.RequestOption) (r *SettingP // Cloudflare will prefetch any URLs that are included in the response headers. // This is limited to Enterprise Zones. -func (r *SettingPrefetchPreloadService) Edit(ctx context.Context, params SettingPrefetchPreloadEditParams, opts ...option.RequestOption) (res *ZoneSettingPrefetchPreload, err error) { +func (r *SettingPrefetchPreloadService) Edit(ctx context.Context, params SettingPrefetchPreloadEditParams, opts ...option.RequestOption) (res *PrefetchPreload, err error) { opts = append(r.Options[:], opts...) var env SettingPrefetchPreloadEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/prefetch_preload", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingPrefetchPreloadService) Edit(ctx context.Context, params Setting // Cloudflare will prefetch any URLs that are included in the response headers. // This is limited to Enterprise Zones. -func (r *SettingPrefetchPreloadService) Get(ctx context.Context, query SettingPrefetchPreloadGetParams, opts ...option.RequestOption) (res *ZoneSettingPrefetchPreload, err error) { +func (r *SettingPrefetchPreloadService) Get(ctx context.Context, query SettingPrefetchPreloadGetParams, opts ...option.RequestOption) (res *PrefetchPreload, err error) { opts = append(r.Options[:], opts...) var env SettingPrefetchPreloadGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/prefetch_preload", query.ZoneID) @@ -63,22 +63,21 @@ func (r *SettingPrefetchPreloadService) Get(ctx context.Context, query SettingPr // Cloudflare will prefetch any URLs that are included in the response headers. // This is limited to Enterprise Zones. -type ZoneSettingPrefetchPreload struct { +type PrefetchPreload struct { // ID of the zone setting. - ID ZoneSettingPrefetchPreloadID `json:"id,required"` + ID PrefetchPreloadID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingPrefetchPreloadValue `json:"value,required"` + Value PrefetchPreloadValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingPrefetchPreloadEditable `json:"editable"` + Editable PrefetchPreloadEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingPrefetchPreloadJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON prefetchPreloadJSON `json:"-"` } -// zoneSettingPrefetchPreloadJSON contains the JSON metadata for the struct -// [ZoneSettingPrefetchPreload] -type zoneSettingPrefetchPreloadJSON struct { +// prefetchPreloadJSON contains the JSON metadata for the struct [PrefetchPreload] +type prefetchPreloadJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +86,40 @@ type zoneSettingPrefetchPreloadJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingPrefetchPreload) UnmarshalJSON(data []byte) (err error) { +func (r *PrefetchPreload) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingPrefetchPreloadJSON) RawJSON() string { +func (r prefetchPreloadJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingPrefetchPreloadID string +type PrefetchPreloadID string const ( - ZoneSettingPrefetchPreloadIDPrefetchPreload ZoneSettingPrefetchPreloadID = "prefetch_preload" + PrefetchPreloadIDPrefetchPreload PrefetchPreloadID = "prefetch_preload" ) -func (r ZoneSettingPrefetchPreloadID) IsKnown() bool { +func (r PrefetchPreloadID) IsKnown() bool { switch r { - case ZoneSettingPrefetchPreloadIDPrefetchPreload: + case PrefetchPreloadIDPrefetchPreload: return true } return false } // Current value of the zone setting. -type ZoneSettingPrefetchPreloadValue string +type PrefetchPreloadValue string const ( - ZoneSettingPrefetchPreloadValueOn ZoneSettingPrefetchPreloadValue = "on" - ZoneSettingPrefetchPreloadValueOff ZoneSettingPrefetchPreloadValue = "off" + PrefetchPreloadValueOn PrefetchPreloadValue = "on" + PrefetchPreloadValueOff PrefetchPreloadValue = "off" ) -func (r ZoneSettingPrefetchPreloadValue) IsKnown() bool { +func (r PrefetchPreloadValue) IsKnown() bool { switch r { - case ZoneSettingPrefetchPreloadValueOn, ZoneSettingPrefetchPreloadValueOff: + case PrefetchPreloadValueOn, PrefetchPreloadValueOff: return true } return false @@ -128,16 +127,16 @@ func (r ZoneSettingPrefetchPreloadValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingPrefetchPreloadEditable bool +type PrefetchPreloadEditable bool const ( - ZoneSettingPrefetchPreloadEditableTrue ZoneSettingPrefetchPreloadEditable = true - ZoneSettingPrefetchPreloadEditableFalse ZoneSettingPrefetchPreloadEditable = false + PrefetchPreloadEditableTrue PrefetchPreloadEditable = true + PrefetchPreloadEditableFalse PrefetchPreloadEditable = false ) -func (r ZoneSettingPrefetchPreloadEditable) IsKnown() bool { +func (r PrefetchPreloadEditable) IsKnown() bool { switch r { - case ZoneSettingPrefetchPreloadEditableTrue, ZoneSettingPrefetchPreloadEditableFalse: + case PrefetchPreloadEditableTrue, PrefetchPreloadEditableFalse: return true } return false @@ -177,7 +176,7 @@ type SettingPrefetchPreloadEditResponseEnvelope struct { Success bool `json:"success,required"` // Cloudflare will prefetch any URLs that are included in the response headers. // This is limited to Enterprise Zones. - Result ZoneSettingPrefetchPreload `json:"result"` + Result PrefetchPreload `json:"result"` JSON settingPrefetchPreloadEditResponseEnvelopeJSON `json:"-"` } @@ -212,7 +211,7 @@ type SettingPrefetchPreloadGetResponseEnvelope struct { Success bool `json:"success,required"` // Cloudflare will prefetch any URLs that are included in the response headers. // This is limited to Enterprise Zones. - Result ZoneSettingPrefetchPreload `json:"result"` + Result PrefetchPreload `json:"result"` JSON settingPrefetchPreloadGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingproxyreadtimeout.go b/zones/settingproxyreadtimeout.go index f1f1bb8676c..b7b43296953 100644 --- a/zones/settingproxyreadtimeout.go +++ b/zones/settingproxyreadtimeout.go @@ -34,7 +34,7 @@ func NewSettingProxyReadTimeoutService(opts ...option.RequestOption) (r *Setting } // Maximum time between two read operations from origin. -func (r *SettingProxyReadTimeoutService) Edit(ctx context.Context, params SettingProxyReadTimeoutEditParams, opts ...option.RequestOption) (res *ZoneSettingProxyReadTimeout, err error) { +func (r *SettingProxyReadTimeoutService) Edit(ctx context.Context, params SettingProxyReadTimeoutEditParams, opts ...option.RequestOption) (res *ProxyReadTimeout, err error) { opts = append(r.Options[:], opts...) var env SettingProxyReadTimeoutEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/proxy_read_timeout", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingProxyReadTimeoutService) Edit(ctx context.Context, params Settin } // Maximum time between two read operations from origin. -func (r *SettingProxyReadTimeoutService) Get(ctx context.Context, query SettingProxyReadTimeoutGetParams, opts ...option.RequestOption) (res *ZoneSettingProxyReadTimeout, err error) { +func (r *SettingProxyReadTimeoutService) Get(ctx context.Context, query SettingProxyReadTimeoutGetParams, opts ...option.RequestOption) (res *ProxyReadTimeout, err error) { opts = append(r.Options[:], opts...) var env SettingProxyReadTimeoutGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/proxy_read_timeout", query.ZoneID) @@ -60,22 +60,22 @@ func (r *SettingProxyReadTimeoutService) Get(ctx context.Context, query SettingP } // Maximum time between two read operations from origin. -type ZoneSettingProxyReadTimeout struct { +type ProxyReadTimeout struct { // ID of the zone setting. - ID ZoneSettingProxyReadTimeoutID `json:"id,required"` + ID ProxyReadTimeoutID `json:"id,required"` // Current value of the zone setting. Value float64 `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingProxyReadTimeoutEditable `json:"editable"` + Editable ProxyReadTimeoutEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingProxyReadTimeoutJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON proxyReadTimeoutJSON `json:"-"` } -// zoneSettingProxyReadTimeoutJSON contains the JSON metadata for the struct -// [ZoneSettingProxyReadTimeout] -type zoneSettingProxyReadTimeoutJSON struct { +// proxyReadTimeoutJSON contains the JSON metadata for the struct +// [ProxyReadTimeout] +type proxyReadTimeoutJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,24 +84,24 @@ type zoneSettingProxyReadTimeoutJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingProxyReadTimeout) UnmarshalJSON(data []byte) (err error) { +func (r *ProxyReadTimeout) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingProxyReadTimeoutJSON) RawJSON() string { +func (r proxyReadTimeoutJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingProxyReadTimeoutID string +type ProxyReadTimeoutID string const ( - ZoneSettingProxyReadTimeoutIDProxyReadTimeout ZoneSettingProxyReadTimeoutID = "proxy_read_timeout" + ProxyReadTimeoutIDProxyReadTimeout ProxyReadTimeoutID = "proxy_read_timeout" ) -func (r ZoneSettingProxyReadTimeoutID) IsKnown() bool { +func (r ProxyReadTimeoutID) IsKnown() bool { switch r { - case ZoneSettingProxyReadTimeoutIDProxyReadTimeout: + case ProxyReadTimeoutIDProxyReadTimeout: return true } return false @@ -109,30 +109,30 @@ func (r ZoneSettingProxyReadTimeoutID) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingProxyReadTimeoutEditable bool +type ProxyReadTimeoutEditable bool const ( - ZoneSettingProxyReadTimeoutEditableTrue ZoneSettingProxyReadTimeoutEditable = true - ZoneSettingProxyReadTimeoutEditableFalse ZoneSettingProxyReadTimeoutEditable = false + ProxyReadTimeoutEditableTrue ProxyReadTimeoutEditable = true + ProxyReadTimeoutEditableFalse ProxyReadTimeoutEditable = false ) -func (r ZoneSettingProxyReadTimeoutEditable) IsKnown() bool { +func (r ProxyReadTimeoutEditable) IsKnown() bool { switch r { - case ZoneSettingProxyReadTimeoutEditableTrue, ZoneSettingProxyReadTimeoutEditableFalse: + case ProxyReadTimeoutEditableTrue, ProxyReadTimeoutEditableFalse: return true } return false } // Maximum time between two read operations from origin. -type ZoneSettingProxyReadTimeoutParam struct { +type ProxyReadTimeoutParam struct { // ID of the zone setting. - ID param.Field[ZoneSettingProxyReadTimeoutID] `json:"id,required"` + ID param.Field[ProxyReadTimeoutID] `json:"id,required"` // Current value of the zone setting. Value param.Field[float64] `json:"value,required"` } -func (r ZoneSettingProxyReadTimeoutParam) MarshalJSON() (data []byte, err error) { +func (r ProxyReadTimeoutParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -140,7 +140,7 @@ type SettingProxyReadTimeoutEditParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // Maximum time between two read operations from origin. - Value param.Field[ZoneSettingProxyReadTimeoutParam] `json:"value,required"` + Value param.Field[ProxyReadTimeoutParam] `json:"value,required"` } func (r SettingProxyReadTimeoutEditParams) MarshalJSON() (data []byte, err error) { @@ -153,7 +153,7 @@ type SettingProxyReadTimeoutEditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Maximum time between two read operations from origin. - Result ZoneSettingProxyReadTimeout `json:"result"` + Result ProxyReadTimeout `json:"result"` JSON settingProxyReadTimeoutEditResponseEnvelopeJSON `json:"-"` } @@ -187,7 +187,7 @@ type SettingProxyReadTimeoutGetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Maximum time between two read operations from origin. - Result ZoneSettingProxyReadTimeout `json:"result"` + Result ProxyReadTimeout `json:"result"` JSON settingProxyReadTimeoutGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingproxyreadtimeout_test.go b/zones/settingproxyreadtimeout_test.go index b75cb7eeb6a..aaf8688af73 100644 --- a/zones/settingproxyreadtimeout_test.go +++ b/zones/settingproxyreadtimeout_test.go @@ -30,8 +30,8 @@ func TestSettingProxyReadTimeoutEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.ProxyReadTimeout.Edit(context.TODO(), zones.SettingProxyReadTimeoutEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingProxyReadTimeoutParam{ - ID: cloudflare.F(zones.ZoneSettingProxyReadTimeoutIDProxyReadTimeout), + Value: cloudflare.F(zones.ProxyReadTimeoutParam{ + ID: cloudflare.F(zones.ProxyReadTimeoutIDProxyReadTimeout), Value: cloudflare.F(0.000000), }), }) diff --git a/zones/settingpseudoipv4.go b/zones/settingpseudoipv4.go index 879ff5a23f4..0872361eb22 100644 --- a/zones/settingpseudoipv4.go +++ b/zones/settingpseudoipv4.go @@ -34,7 +34,7 @@ func NewSettingPseudoIPV4Service(opts ...option.RequestOption) (r *SettingPseudo } // Value of the Pseudo IPv4 setting. -func (r *SettingPseudoIPV4Service) Edit(ctx context.Context, params SettingPseudoIPV4EditParams, opts ...option.RequestOption) (res *ZoneSettingPseudoIPV4, err error) { +func (r *SettingPseudoIPV4Service) Edit(ctx context.Context, params SettingPseudoIPV4EditParams, opts ...option.RequestOption) (res *PseudoIPV4, err error) { opts = append(r.Options[:], opts...) var env SettingPseudoIPV4EditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/pseudo_ipv4", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingPseudoIPV4Service) Edit(ctx context.Context, params SettingPseud } // Value of the Pseudo IPv4 setting. -func (r *SettingPseudoIPV4Service) Get(ctx context.Context, query SettingPseudoIPV4GetParams, opts ...option.RequestOption) (res *ZoneSettingPseudoIPV4, err error) { +func (r *SettingPseudoIPV4Service) Get(ctx context.Context, query SettingPseudoIPV4GetParams, opts ...option.RequestOption) (res *PseudoIPV4, err error) { opts = append(r.Options[:], opts...) var env SettingPseudoIPV4GetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/pseudo_ipv4", query.ZoneID) @@ -60,22 +60,21 @@ func (r *SettingPseudoIPV4Service) Get(ctx context.Context, query SettingPseudoI } // The value set for the Pseudo IPv4 setting. -type ZoneSettingPseudoIPV4 struct { +type PseudoIPV4 struct { // Value of the Pseudo IPv4 setting. - ID ZoneSettingPseudoIPV4ID `json:"id,required"` + ID PseudoIPV4ID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingPseudoIPV4Value `json:"value,required"` + Value PseudoIPV4Value `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingPseudoIPV4Editable `json:"editable"` + Editable PseudoIPV4Editable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingPseudoIPV4JSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON pseudoIPV4JSON `json:"-"` } -// zoneSettingPseudoIPV4JSON contains the JSON metadata for the struct -// [ZoneSettingPseudoIPV4] -type zoneSettingPseudoIPV4JSON struct { +// pseudoIPV4JSON contains the JSON metadata for the struct [PseudoIPV4] +type pseudoIPV4JSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,41 +83,41 @@ type zoneSettingPseudoIPV4JSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingPseudoIPV4) UnmarshalJSON(data []byte) (err error) { +func (r *PseudoIPV4) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingPseudoIPV4JSON) RawJSON() string { +func (r pseudoIPV4JSON) RawJSON() string { return r.raw } // Value of the Pseudo IPv4 setting. -type ZoneSettingPseudoIPV4ID string +type PseudoIPV4ID string const ( - ZoneSettingPseudoIPV4IDPseudoIPV4 ZoneSettingPseudoIPV4ID = "pseudo_ipv4" + PseudoIPV4IDPseudoIPV4 PseudoIPV4ID = "pseudo_ipv4" ) -func (r ZoneSettingPseudoIPV4ID) IsKnown() bool { +func (r PseudoIPV4ID) IsKnown() bool { switch r { - case ZoneSettingPseudoIPV4IDPseudoIPV4: + case PseudoIPV4IDPseudoIPV4: return true } return false } // Current value of the zone setting. -type ZoneSettingPseudoIPV4Value string +type PseudoIPV4Value string const ( - ZoneSettingPseudoIPV4ValueOff ZoneSettingPseudoIPV4Value = "off" - ZoneSettingPseudoIPV4ValueAddHeader ZoneSettingPseudoIPV4Value = "add_header" - ZoneSettingPseudoIPV4ValueOverwriteHeader ZoneSettingPseudoIPV4Value = "overwrite_header" + PseudoIPV4ValueOff PseudoIPV4Value = "off" + PseudoIPV4ValueAddHeader PseudoIPV4Value = "add_header" + PseudoIPV4ValueOverwriteHeader PseudoIPV4Value = "overwrite_header" ) -func (r ZoneSettingPseudoIPV4Value) IsKnown() bool { +func (r PseudoIPV4Value) IsKnown() bool { switch r { - case ZoneSettingPseudoIPV4ValueOff, ZoneSettingPseudoIPV4ValueAddHeader, ZoneSettingPseudoIPV4ValueOverwriteHeader: + case PseudoIPV4ValueOff, PseudoIPV4ValueAddHeader, PseudoIPV4ValueOverwriteHeader: return true } return false @@ -126,16 +125,16 @@ func (r ZoneSettingPseudoIPV4Value) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingPseudoIPV4Editable bool +type PseudoIPV4Editable bool const ( - ZoneSettingPseudoIPV4EditableTrue ZoneSettingPseudoIPV4Editable = true - ZoneSettingPseudoIPV4EditableFalse ZoneSettingPseudoIPV4Editable = false + PseudoIPV4EditableTrue PseudoIPV4Editable = true + PseudoIPV4EditableFalse PseudoIPV4Editable = false ) -func (r ZoneSettingPseudoIPV4Editable) IsKnown() bool { +func (r PseudoIPV4Editable) IsKnown() bool { switch r { - case ZoneSettingPseudoIPV4EditableTrue, ZoneSettingPseudoIPV4EditableFalse: + case PseudoIPV4EditableTrue, PseudoIPV4EditableFalse: return true } return false @@ -175,7 +174,7 @@ type SettingPseudoIPV4EditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // The value set for the Pseudo IPv4 setting. - Result ZoneSettingPseudoIPV4 `json:"result"` + Result PseudoIPV4 `json:"result"` JSON settingPseudoIPV4EditResponseEnvelopeJSON `json:"-"` } @@ -209,7 +208,7 @@ type SettingPseudoIPV4GetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // The value set for the Pseudo IPv4 setting. - Result ZoneSettingPseudoIPV4 `json:"result"` + Result PseudoIPV4 `json:"result"` JSON settingPseudoIPV4GetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingresponsebuffering.go b/zones/settingresponsebuffering.go index 46efb5d0315..47d06429d08 100644 --- a/zones/settingresponsebuffering.go +++ b/zones/settingresponsebuffering.go @@ -37,7 +37,7 @@ func NewSettingResponseBufferingService(opts ...option.RequestOption) (r *Settin // may buffer the whole payload to deliver it at once to the client versus allowing // it to be delivered in chunks. By default, the proxied server streams directly // and is not buffered by Cloudflare. This is limited to Enterprise Zones. -func (r *SettingResponseBufferingService) Edit(ctx context.Context, params SettingResponseBufferingEditParams, opts ...option.RequestOption) (res *ZoneSettingBuffering, err error) { +func (r *SettingResponseBufferingService) Edit(ctx context.Context, params SettingResponseBufferingEditParams, opts ...option.RequestOption) (res *ResponseBuffering, err error) { opts = append(r.Options[:], opts...) var env SettingResponseBufferingEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/response_buffering", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingResponseBufferingService) Edit(ctx context.Context, params Setti // may buffer the whole payload to deliver it at once to the client versus allowing // it to be delivered in chunks. By default, the proxied server streams directly // and is not buffered by Cloudflare. This is limited to Enterprise Zones. -func (r *SettingResponseBufferingService) Get(ctx context.Context, query SettingResponseBufferingGetParams, opts ...option.RequestOption) (res *ZoneSettingBuffering, err error) { +func (r *SettingResponseBufferingService) Get(ctx context.Context, query SettingResponseBufferingGetParams, opts ...option.RequestOption) (res *ResponseBuffering, err error) { opts = append(r.Options[:], opts...) var env SettingResponseBufferingGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/response_buffering", query.ZoneID) @@ -69,22 +69,22 @@ func (r *SettingResponseBufferingService) Get(ctx context.Context, query Setting // may buffer the whole payload to deliver it at once to the client versus allowing // it to be delivered in chunks. By default, the proxied server streams directly // and is not buffered by Cloudflare. This is limited to Enterprise Zones. -type ZoneSettingBuffering struct { +type ResponseBuffering struct { // ID of the zone setting. - ID ZoneSettingBufferingID `json:"id,required"` + ID ResponseBufferingID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingBufferingValue `json:"value,required"` + Value ResponseBufferingValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingBufferingEditable `json:"editable"` + Editable ResponseBufferingEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingBufferingJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON responseBufferingJSON `json:"-"` } -// zoneSettingBufferingJSON contains the JSON metadata for the struct -// [ZoneSettingBuffering] -type zoneSettingBufferingJSON struct { +// responseBufferingJSON contains the JSON metadata for the struct +// [ResponseBuffering] +type responseBufferingJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,40 +93,40 @@ type zoneSettingBufferingJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingBuffering) UnmarshalJSON(data []byte) (err error) { +func (r *ResponseBuffering) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingBufferingJSON) RawJSON() string { +func (r responseBufferingJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingBufferingID string +type ResponseBufferingID string const ( - ZoneSettingBufferingIDResponseBuffering ZoneSettingBufferingID = "response_buffering" + ResponseBufferingIDResponseBuffering ResponseBufferingID = "response_buffering" ) -func (r ZoneSettingBufferingID) IsKnown() bool { +func (r ResponseBufferingID) IsKnown() bool { switch r { - case ZoneSettingBufferingIDResponseBuffering: + case ResponseBufferingIDResponseBuffering: return true } return false } // Current value of the zone setting. -type ZoneSettingBufferingValue string +type ResponseBufferingValue string const ( - ZoneSettingBufferingValueOn ZoneSettingBufferingValue = "on" - ZoneSettingBufferingValueOff ZoneSettingBufferingValue = "off" + ResponseBufferingValueOn ResponseBufferingValue = "on" + ResponseBufferingValueOff ResponseBufferingValue = "off" ) -func (r ZoneSettingBufferingValue) IsKnown() bool { +func (r ResponseBufferingValue) IsKnown() bool { switch r { - case ZoneSettingBufferingValueOn, ZoneSettingBufferingValueOff: + case ResponseBufferingValueOn, ResponseBufferingValueOff: return true } return false @@ -134,16 +134,16 @@ func (r ZoneSettingBufferingValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingBufferingEditable bool +type ResponseBufferingEditable bool const ( - ZoneSettingBufferingEditableTrue ZoneSettingBufferingEditable = true - ZoneSettingBufferingEditableFalse ZoneSettingBufferingEditable = false + ResponseBufferingEditableTrue ResponseBufferingEditable = true + ResponseBufferingEditableFalse ResponseBufferingEditable = false ) -func (r ZoneSettingBufferingEditable) IsKnown() bool { +func (r ResponseBufferingEditable) IsKnown() bool { switch r { - case ZoneSettingBufferingEditableTrue, ZoneSettingBufferingEditableFalse: + case ResponseBufferingEditableTrue, ResponseBufferingEditableFalse: return true } return false @@ -185,7 +185,7 @@ type SettingResponseBufferingEditResponseEnvelope struct { // may buffer the whole payload to deliver it at once to the client versus allowing // it to be delivered in chunks. By default, the proxied server streams directly // and is not buffered by Cloudflare. This is limited to Enterprise Zones. - Result ZoneSettingBuffering `json:"result"` + Result ResponseBuffering `json:"result"` JSON settingResponseBufferingEditResponseEnvelopeJSON `json:"-"` } @@ -222,7 +222,7 @@ type SettingResponseBufferingGetResponseEnvelope struct { // may buffer the whole payload to deliver it at once to the client versus allowing // it to be delivered in chunks. By default, the proxied server streams directly // and is not buffered by Cloudflare. This is limited to Enterprise Zones. - Result ZoneSettingBuffering `json:"result"` + Result ResponseBuffering `json:"result"` JSON settingResponseBufferingGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingrocketloader.go b/zones/settingrocketloader.go index b6bfd5f7adb..4b8824590b0 100644 --- a/zones/settingrocketloader.go +++ b/zones/settingrocketloader.go @@ -43,7 +43,7 @@ func NewSettingRocketLoaderService(opts ...option.RequestOption) (r *SettingRock // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. -func (r *SettingRocketLoaderService) Edit(ctx context.Context, params SettingRocketLoaderEditParams, opts ...option.RequestOption) (res *ZoneSettingRocketLoader, err error) { +func (r *SettingRocketLoaderService) Edit(ctx context.Context, params SettingRocketLoaderEditParams, opts ...option.RequestOption) (res *RocketLoader, err error) { opts = append(r.Options[:], opts...) var env SettingRocketLoaderEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/rocket_loader", params.ZoneID) @@ -65,7 +65,7 @@ func (r *SettingRocketLoaderService) Edit(ctx context.Context, params SettingRoc // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. -func (r *SettingRocketLoaderService) Get(ctx context.Context, query SettingRocketLoaderGetParams, opts ...option.RequestOption) (res *ZoneSettingRocketLoader, err error) { +func (r *SettingRocketLoaderService) Get(ctx context.Context, query SettingRocketLoaderGetParams, opts ...option.RequestOption) (res *RocketLoader, err error) { opts = append(r.Options[:], opts...) var env SettingRocketLoaderGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/rocket_loader", query.ZoneID) @@ -87,22 +87,21 @@ func (r *SettingRocketLoaderService) Get(ctx context.Context, query SettingRocke // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. -type ZoneSettingRocketLoader struct { +type RocketLoader struct { // ID of the zone setting. - ID ZoneSettingRocketLoaderID `json:"id,required"` + ID RocketLoaderID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingRocketLoaderValue `json:"value,required"` + Value RocketLoaderValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingRocketLoaderEditable `json:"editable"` + Editable RocketLoaderEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingRocketLoaderJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON rocketLoaderJSON `json:"-"` } -// zoneSettingRocketLoaderJSON contains the JSON metadata for the struct -// [ZoneSettingRocketLoader] -type zoneSettingRocketLoaderJSON struct { +// rocketLoaderJSON contains the JSON metadata for the struct [RocketLoader] +type rocketLoaderJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -111,40 +110,40 @@ type zoneSettingRocketLoaderJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingRocketLoader) UnmarshalJSON(data []byte) (err error) { +func (r *RocketLoader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingRocketLoaderJSON) RawJSON() string { +func (r rocketLoaderJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingRocketLoaderID string +type RocketLoaderID string const ( - ZoneSettingRocketLoaderIDRocketLoader ZoneSettingRocketLoaderID = "rocket_loader" + RocketLoaderIDRocketLoader RocketLoaderID = "rocket_loader" ) -func (r ZoneSettingRocketLoaderID) IsKnown() bool { +func (r RocketLoaderID) IsKnown() bool { switch r { - case ZoneSettingRocketLoaderIDRocketLoader: + case RocketLoaderIDRocketLoader: return true } return false } // Current value of the zone setting. -type ZoneSettingRocketLoaderValue string +type RocketLoaderValue string const ( - ZoneSettingRocketLoaderValueOn ZoneSettingRocketLoaderValue = "on" - ZoneSettingRocketLoaderValueOff ZoneSettingRocketLoaderValue = "off" + RocketLoaderValueOn RocketLoaderValue = "on" + RocketLoaderValueOff RocketLoaderValue = "off" ) -func (r ZoneSettingRocketLoaderValue) IsKnown() bool { +func (r RocketLoaderValue) IsKnown() bool { switch r { - case ZoneSettingRocketLoaderValueOn, ZoneSettingRocketLoaderValueOff: + case RocketLoaderValueOn, RocketLoaderValueOff: return true } return false @@ -152,16 +151,16 @@ func (r ZoneSettingRocketLoaderValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingRocketLoaderEditable bool +type RocketLoaderEditable bool const ( - ZoneSettingRocketLoaderEditableTrue ZoneSettingRocketLoaderEditable = true - ZoneSettingRocketLoaderEditableFalse ZoneSettingRocketLoaderEditable = false + RocketLoaderEditableTrue RocketLoaderEditable = true + RocketLoaderEditableFalse RocketLoaderEditable = false ) -func (r ZoneSettingRocketLoaderEditable) IsKnown() bool { +func (r RocketLoaderEditable) IsKnown() bool { switch r { - case ZoneSettingRocketLoaderEditableTrue, ZoneSettingRocketLoaderEditableFalse: + case RocketLoaderEditableTrue, RocketLoaderEditableFalse: return true } return false @@ -177,14 +176,14 @@ func (r ZoneSettingRocketLoaderEditable) IsKnown() bool { // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. -type ZoneSettingRocketLoaderParam struct { +type RocketLoaderParam struct { // ID of the zone setting. - ID param.Field[ZoneSettingRocketLoaderID] `json:"id,required"` + ID param.Field[RocketLoaderID] `json:"id,required"` // Current value of the zone setting. - Value param.Field[ZoneSettingRocketLoaderValue] `json:"value,required"` + Value param.Field[RocketLoaderValue] `json:"value,required"` } -func (r ZoneSettingRocketLoaderParam) MarshalJSON() (data []byte, err error) { +func (r RocketLoaderParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -201,7 +200,7 @@ type SettingRocketLoaderEditParams struct { // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. - Value param.Field[ZoneSettingRocketLoaderParam] `json:"value,required"` + Value param.Field[RocketLoaderParam] `json:"value,required"` } func (r SettingRocketLoaderEditParams) MarshalJSON() (data []byte, err error) { @@ -223,7 +222,7 @@ type SettingRocketLoaderEditResponseEnvelope struct { // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. - Result ZoneSettingRocketLoader `json:"result"` + Result RocketLoader `json:"result"` JSON settingRocketLoaderEditResponseEnvelopeJSON `json:"-"` } @@ -266,7 +265,7 @@ type SettingRocketLoaderGetResponseEnvelope struct { // with no configuration required. Refer to // [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) // for more information. - Result ZoneSettingRocketLoader `json:"result"` + Result RocketLoader `json:"result"` JSON settingRocketLoaderGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingrocketloader_test.go b/zones/settingrocketloader_test.go index da6f4416f1d..80aa014fa02 100644 --- a/zones/settingrocketloader_test.go +++ b/zones/settingrocketloader_test.go @@ -30,9 +30,9 @@ func TestSettingRocketLoaderEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.RocketLoader.Edit(context.TODO(), zones.SettingRocketLoaderEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingRocketLoaderParam{ - ID: cloudflare.F(zones.ZoneSettingRocketLoaderIDRocketLoader), - Value: cloudflare.F(zones.ZoneSettingRocketLoaderValueOn), + Value: cloudflare.F(zones.RocketLoaderParam{ + ID: cloudflare.F(zones.RocketLoaderIDRocketLoader), + Value: cloudflare.F(zones.RocketLoaderValueOn), }), }) if err != nil { diff --git a/zones/settingsecurityheader.go b/zones/settingsecurityheader.go index 79c7f20fd62..10580ec92b1 100644 --- a/zones/settingsecurityheader.go +++ b/zones/settingsecurityheader.go @@ -34,7 +34,7 @@ func NewSettingSecurityHeaderService(opts ...option.RequestOption) (r *SettingSe } // Cloudflare security header for a zone. -func (r *SettingSecurityHeaderService) Edit(ctx context.Context, params SettingSecurityHeaderEditParams, opts ...option.RequestOption) (res *ZoneSettingSecurityHeader, err error) { +func (r *SettingSecurityHeaderService) Edit(ctx context.Context, params SettingSecurityHeaderEditParams, opts ...option.RequestOption) (res *SecurityHeaders, err error) { opts = append(r.Options[:], opts...) var env SettingSecurityHeaderEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/security_header", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingSecurityHeaderService) Edit(ctx context.Context, params SettingS } // Cloudflare security header for a zone. -func (r *SettingSecurityHeaderService) Get(ctx context.Context, query SettingSecurityHeaderGetParams, opts ...option.RequestOption) (res *ZoneSettingSecurityHeader, err error) { +func (r *SettingSecurityHeaderService) Get(ctx context.Context, query SettingSecurityHeaderGetParams, opts ...option.RequestOption) (res *SecurityHeaders, err error) { opts = append(r.Options[:], opts...) var env SettingSecurityHeaderGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/security_header", query.ZoneID) @@ -60,22 +60,21 @@ func (r *SettingSecurityHeaderService) Get(ctx context.Context, query SettingSec } // Cloudflare security header for a zone. -type ZoneSettingSecurityHeader struct { +type SecurityHeaders struct { // ID of the zone's security header. - ID ZoneSettingSecurityHeaderID `json:"id,required"` + ID SecurityHeadersID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingSecurityHeaderValue `json:"value,required"` + Value SecurityHeadersValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingSecurityHeaderEditable `json:"editable"` + Editable SecurityHeadersEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingSecurityHeaderJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON securityHeadersJSON `json:"-"` } -// zoneSettingSecurityHeaderJSON contains the JSON metadata for the struct -// [ZoneSettingSecurityHeader] -type zoneSettingSecurityHeaderJSON struct { +// securityHeadersJSON contains the JSON metadata for the struct [SecurityHeaders] +type securityHeadersJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,54 +83,54 @@ type zoneSettingSecurityHeaderJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSecurityHeader) UnmarshalJSON(data []byte) (err error) { +func (r *SecurityHeaders) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSecurityHeaderJSON) RawJSON() string { +func (r securityHeadersJSON) RawJSON() string { return r.raw } // ID of the zone's security header. -type ZoneSettingSecurityHeaderID string +type SecurityHeadersID string const ( - ZoneSettingSecurityHeaderIDSecurityHeader ZoneSettingSecurityHeaderID = "security_header" + SecurityHeadersIDSecurityHeader SecurityHeadersID = "security_header" ) -func (r ZoneSettingSecurityHeaderID) IsKnown() bool { +func (r SecurityHeadersID) IsKnown() bool { switch r { - case ZoneSettingSecurityHeaderIDSecurityHeader: + case SecurityHeadersIDSecurityHeader: return true } return false } // Current value of the zone setting. -type ZoneSettingSecurityHeaderValue struct { +type SecurityHeadersValue struct { // Strict Transport Security. - StrictTransportSecurity ZoneSettingSecurityHeaderValueStrictTransportSecurity `json:"strict_transport_security"` - JSON zoneSettingSecurityHeaderValueJSON `json:"-"` + StrictTransportSecurity SecurityHeadersValueStrictTransportSecurity `json:"strict_transport_security"` + JSON securityHeadersValueJSON `json:"-"` } -// zoneSettingSecurityHeaderValueJSON contains the JSON metadata for the struct -// [ZoneSettingSecurityHeaderValue] -type zoneSettingSecurityHeaderValueJSON struct { +// securityHeadersValueJSON contains the JSON metadata for the struct +// [SecurityHeadersValue] +type securityHeadersValueJSON struct { StrictTransportSecurity apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSecurityHeaderValue) UnmarshalJSON(data []byte) (err error) { +func (r *SecurityHeadersValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSecurityHeaderValueJSON) RawJSON() string { +func (r securityHeadersValueJSON) RawJSON() string { return r.raw } // Strict Transport Security. -type ZoneSettingSecurityHeaderValueStrictTransportSecurity struct { +type SecurityHeadersValueStrictTransportSecurity struct { // Whether or not strict transport security is enabled. Enabled bool `json:"enabled"` // Include all subdomains for strict transport security. @@ -139,13 +138,13 @@ type ZoneSettingSecurityHeaderValueStrictTransportSecurity struct { // Max age in seconds of the strict transport security. MaxAge float64 `json:"max_age"` // Whether or not to include 'X-Content-Type-Options: nosniff' header. - Nosniff bool `json:"nosniff"` - JSON zoneSettingSecurityHeaderValueStrictTransportSecurityJSON `json:"-"` + Nosniff bool `json:"nosniff"` + JSON securityHeadersValueStrictTransportSecurityJSON `json:"-"` } -// zoneSettingSecurityHeaderValueStrictTransportSecurityJSON contains the JSON -// metadata for the struct [ZoneSettingSecurityHeaderValueStrictTransportSecurity] -type zoneSettingSecurityHeaderValueStrictTransportSecurityJSON struct { +// securityHeadersValueStrictTransportSecurityJSON contains the JSON metadata for +// the struct [SecurityHeadersValueStrictTransportSecurity] +type securityHeadersValueStrictTransportSecurityJSON struct { Enabled apijson.Field IncludeSubdomains apijson.Field MaxAge apijson.Field @@ -154,26 +153,26 @@ type zoneSettingSecurityHeaderValueStrictTransportSecurityJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSecurityHeaderValueStrictTransportSecurity) UnmarshalJSON(data []byte) (err error) { +func (r *SecurityHeadersValueStrictTransportSecurity) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSecurityHeaderValueStrictTransportSecurityJSON) RawJSON() string { +func (r securityHeadersValueStrictTransportSecurityJSON) RawJSON() string { return r.raw } // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingSecurityHeaderEditable bool +type SecurityHeadersEditable bool const ( - ZoneSettingSecurityHeaderEditableTrue ZoneSettingSecurityHeaderEditable = true - ZoneSettingSecurityHeaderEditableFalse ZoneSettingSecurityHeaderEditable = false + SecurityHeadersEditableTrue SecurityHeadersEditable = true + SecurityHeadersEditableFalse SecurityHeadersEditable = false ) -func (r ZoneSettingSecurityHeaderEditable) IsKnown() bool { +func (r SecurityHeadersEditable) IsKnown() bool { switch r { - case ZoneSettingSecurityHeaderEditableTrue, ZoneSettingSecurityHeaderEditableFalse: + case SecurityHeadersEditableTrue, SecurityHeadersEditableFalse: return true } return false @@ -220,7 +219,7 @@ type SettingSecurityHeaderEditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Cloudflare security header for a zone. - Result ZoneSettingSecurityHeader `json:"result"` + Result SecurityHeaders `json:"result"` JSON settingSecurityHeaderEditResponseEnvelopeJSON `json:"-"` } @@ -254,7 +253,7 @@ type SettingSecurityHeaderGetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Cloudflare security header for a zone. - Result ZoneSettingSecurityHeader `json:"result"` + Result SecurityHeaders `json:"result"` JSON settingSecurityHeaderGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingsecuritylevel.go b/zones/settingsecuritylevel.go index 44da3fc0d38..a620a974378 100644 --- a/zones/settingsecuritylevel.go +++ b/zones/settingsecuritylevel.go @@ -37,7 +37,7 @@ func NewSettingSecurityLevelService(opts ...option.RequestOption) (r *SettingSec // automatically adjust each of the security settings. If you choose to customize // an individual security setting, the profile will become Custom. // (https://support.cloudflare.com/hc/en-us/articles/200170056). -func (r *SettingSecurityLevelService) Edit(ctx context.Context, params SettingSecurityLevelEditParams, opts ...option.RequestOption) (res *ZoneSettingSecurityLevel, err error) { +func (r *SettingSecurityLevelService) Edit(ctx context.Context, params SettingSecurityLevelEditParams, opts ...option.RequestOption) (res *SecurityLevel, err error) { opts = append(r.Options[:], opts...) var env SettingSecurityLevelEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/security_level", params.ZoneID) @@ -53,7 +53,7 @@ func (r *SettingSecurityLevelService) Edit(ctx context.Context, params SettingSe // automatically adjust each of the security settings. If you choose to customize // an individual security setting, the profile will become Custom. // (https://support.cloudflare.com/hc/en-us/articles/200170056). -func (r *SettingSecurityLevelService) Get(ctx context.Context, query SettingSecurityLevelGetParams, opts ...option.RequestOption) (res *ZoneSettingSecurityLevel, err error) { +func (r *SettingSecurityLevelService) Get(ctx context.Context, query SettingSecurityLevelGetParams, opts ...option.RequestOption) (res *SecurityLevel, err error) { opts = append(r.Options[:], opts...) var env SettingSecurityLevelGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/security_level", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingSecurityLevelService) Get(ctx context.Context, query SettingSecu // automatically adjust each of the security settings. If you choose to customize // an individual security setting, the profile will become Custom. // (https://support.cloudflare.com/hc/en-us/articles/200170056). -type ZoneSettingSecurityLevel struct { +type SecurityLevel struct { // ID of the zone setting. - ID ZoneSettingSecurityLevelID `json:"id,required"` + ID SecurityLevelID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingSecurityLevelValue `json:"value,required"` + Value SecurityLevelValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingSecurityLevelEditable `json:"editable"` + Editable SecurityLevelEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingSecurityLevelJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON securityLevelJSON `json:"-"` } -// zoneSettingSecurityLevelJSON contains the JSON metadata for the struct -// [ZoneSettingSecurityLevel] -type zoneSettingSecurityLevelJSON struct { +// securityLevelJSON contains the JSON metadata for the struct [SecurityLevel] +type securityLevelJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,44 +92,44 @@ type zoneSettingSecurityLevelJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSecurityLevel) UnmarshalJSON(data []byte) (err error) { +func (r *SecurityLevel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSecurityLevelJSON) RawJSON() string { +func (r securityLevelJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingSecurityLevelID string +type SecurityLevelID string const ( - ZoneSettingSecurityLevelIDSecurityLevel ZoneSettingSecurityLevelID = "security_level" + SecurityLevelIDSecurityLevel SecurityLevelID = "security_level" ) -func (r ZoneSettingSecurityLevelID) IsKnown() bool { +func (r SecurityLevelID) IsKnown() bool { switch r { - case ZoneSettingSecurityLevelIDSecurityLevel: + case SecurityLevelIDSecurityLevel: return true } return false } // Current value of the zone setting. -type ZoneSettingSecurityLevelValue string +type SecurityLevelValue string const ( - ZoneSettingSecurityLevelValueOff ZoneSettingSecurityLevelValue = "off" - ZoneSettingSecurityLevelValueEssentiallyOff ZoneSettingSecurityLevelValue = "essentially_off" - ZoneSettingSecurityLevelValueLow ZoneSettingSecurityLevelValue = "low" - ZoneSettingSecurityLevelValueMedium ZoneSettingSecurityLevelValue = "medium" - ZoneSettingSecurityLevelValueHigh ZoneSettingSecurityLevelValue = "high" - ZoneSettingSecurityLevelValueUnderAttack ZoneSettingSecurityLevelValue = "under_attack" + SecurityLevelValueOff SecurityLevelValue = "off" + SecurityLevelValueEssentiallyOff SecurityLevelValue = "essentially_off" + SecurityLevelValueLow SecurityLevelValue = "low" + SecurityLevelValueMedium SecurityLevelValue = "medium" + SecurityLevelValueHigh SecurityLevelValue = "high" + SecurityLevelValueUnderAttack SecurityLevelValue = "under_attack" ) -func (r ZoneSettingSecurityLevelValue) IsKnown() bool { +func (r SecurityLevelValue) IsKnown() bool { switch r { - case ZoneSettingSecurityLevelValueOff, ZoneSettingSecurityLevelValueEssentiallyOff, ZoneSettingSecurityLevelValueLow, ZoneSettingSecurityLevelValueMedium, ZoneSettingSecurityLevelValueHigh, ZoneSettingSecurityLevelValueUnderAttack: + case SecurityLevelValueOff, SecurityLevelValueEssentiallyOff, SecurityLevelValueLow, SecurityLevelValueMedium, SecurityLevelValueHigh, SecurityLevelValueUnderAttack: return true } return false @@ -138,16 +137,16 @@ func (r ZoneSettingSecurityLevelValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingSecurityLevelEditable bool +type SecurityLevelEditable bool const ( - ZoneSettingSecurityLevelEditableTrue ZoneSettingSecurityLevelEditable = true - ZoneSettingSecurityLevelEditableFalse ZoneSettingSecurityLevelEditable = false + SecurityLevelEditableTrue SecurityLevelEditable = true + SecurityLevelEditableFalse SecurityLevelEditable = false ) -func (r ZoneSettingSecurityLevelEditable) IsKnown() bool { +func (r SecurityLevelEditable) IsKnown() bool { switch r { - case ZoneSettingSecurityLevelEditableTrue, ZoneSettingSecurityLevelEditableFalse: + case SecurityLevelEditableTrue, SecurityLevelEditableFalse: return true } return false @@ -193,7 +192,7 @@ type SettingSecurityLevelEditResponseEnvelope struct { // automatically adjust each of the security settings. If you choose to customize // an individual security setting, the profile will become Custom. // (https://support.cloudflare.com/hc/en-us/articles/200170056). - Result ZoneSettingSecurityLevel `json:"result"` + Result SecurityLevel `json:"result"` JSON settingSecurityLevelEditResponseEnvelopeJSON `json:"-"` } @@ -230,7 +229,7 @@ type SettingSecurityLevelGetResponseEnvelope struct { // automatically adjust each of the security settings. If you choose to customize // an individual security setting, the profile will become Custom. // (https://support.cloudflare.com/hc/en-us/articles/200170056). - Result ZoneSettingSecurityLevel `json:"result"` + Result SecurityLevel `json:"result"` JSON settingSecurityLevelGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingserversideexclude.go b/zones/settingserversideexclude.go index 067f0bcc4b3..7721f9960e2 100644 --- a/zones/settingserversideexclude.go +++ b/zones/settingserversideexclude.go @@ -44,7 +44,7 @@ func NewSettingServerSideExcludeService(opts ...option.RequestOption) (r *Settin // Cloudflare's HTML minification and SSE functionality occur on-the-fly as the // resource moves through our network to the visitor's computer. // (https://support.cloudflare.com/hc/en-us/articles/200170036). -func (r *SettingServerSideExcludeService) Edit(ctx context.Context, params SettingServerSideExcludeEditParams, opts ...option.RequestOption) (res *ZoneSettingServerSideExclude, err error) { +func (r *SettingServerSideExcludeService) Edit(ctx context.Context, params SettingServerSideExcludeEditParams, opts ...option.RequestOption) (res *ServerSideExcludes, err error) { opts = append(r.Options[:], opts...) var env SettingServerSideExcludeEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/server_side_exclude", params.ZoneID) @@ -67,7 +67,7 @@ func (r *SettingServerSideExcludeService) Edit(ctx context.Context, params Setti // Cloudflare's HTML minification and SSE functionality occur on-the-fly as the // resource moves through our network to the visitor's computer. // (https://support.cloudflare.com/hc/en-us/articles/200170036). -func (r *SettingServerSideExcludeService) Get(ctx context.Context, query SettingServerSideExcludeGetParams, opts ...option.RequestOption) (res *ZoneSettingServerSideExclude, err error) { +func (r *SettingServerSideExcludeService) Get(ctx context.Context, query SettingServerSideExcludeGetParams, opts ...option.RequestOption) (res *ServerSideExcludes, err error) { opts = append(r.Options[:], opts...) var env SettingServerSideExcludeGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/server_side_exclude", query.ZoneID) @@ -90,22 +90,22 @@ func (r *SettingServerSideExcludeService) Get(ctx context.Context, query Setting // Cloudflare's HTML minification and SSE functionality occur on-the-fly as the // resource moves through our network to the visitor's computer. // (https://support.cloudflare.com/hc/en-us/articles/200170036). -type ZoneSettingServerSideExclude struct { +type ServerSideExcludes struct { // ID of the zone setting. - ID ZoneSettingServerSideExcludeID `json:"id,required"` + ID ServerSideExcludesID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingServerSideExcludeValue `json:"value,required"` + Value ServerSideExcludesValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingServerSideExcludeEditable `json:"editable"` + Editable ServerSideExcludesEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingServerSideExcludeJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON serverSideExcludesJSON `json:"-"` } -// zoneSettingServerSideExcludeJSON contains the JSON metadata for the struct -// [ZoneSettingServerSideExclude] -type zoneSettingServerSideExcludeJSON struct { +// serverSideExcludesJSON contains the JSON metadata for the struct +// [ServerSideExcludes] +type serverSideExcludesJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -114,40 +114,40 @@ type zoneSettingServerSideExcludeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingServerSideExclude) UnmarshalJSON(data []byte) (err error) { +func (r *ServerSideExcludes) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingServerSideExcludeJSON) RawJSON() string { +func (r serverSideExcludesJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingServerSideExcludeID string +type ServerSideExcludesID string const ( - ZoneSettingServerSideExcludeIDServerSideExclude ZoneSettingServerSideExcludeID = "server_side_exclude" + ServerSideExcludesIDServerSideExclude ServerSideExcludesID = "server_side_exclude" ) -func (r ZoneSettingServerSideExcludeID) IsKnown() bool { +func (r ServerSideExcludesID) IsKnown() bool { switch r { - case ZoneSettingServerSideExcludeIDServerSideExclude: + case ServerSideExcludesIDServerSideExclude: return true } return false } // Current value of the zone setting. -type ZoneSettingServerSideExcludeValue string +type ServerSideExcludesValue string const ( - ZoneSettingServerSideExcludeValueOn ZoneSettingServerSideExcludeValue = "on" - ZoneSettingServerSideExcludeValueOff ZoneSettingServerSideExcludeValue = "off" + ServerSideExcludesValueOn ServerSideExcludesValue = "on" + ServerSideExcludesValueOff ServerSideExcludesValue = "off" ) -func (r ZoneSettingServerSideExcludeValue) IsKnown() bool { +func (r ServerSideExcludesValue) IsKnown() bool { switch r { - case ZoneSettingServerSideExcludeValueOn, ZoneSettingServerSideExcludeValueOff: + case ServerSideExcludesValueOn, ServerSideExcludesValueOff: return true } return false @@ -155,16 +155,16 @@ func (r ZoneSettingServerSideExcludeValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingServerSideExcludeEditable bool +type ServerSideExcludesEditable bool const ( - ZoneSettingServerSideExcludeEditableTrue ZoneSettingServerSideExcludeEditable = true - ZoneSettingServerSideExcludeEditableFalse ZoneSettingServerSideExcludeEditable = false + ServerSideExcludesEditableTrue ServerSideExcludesEditable = true + ServerSideExcludesEditableFalse ServerSideExcludesEditable = false ) -func (r ZoneSettingServerSideExcludeEditable) IsKnown() bool { +func (r ServerSideExcludesEditable) IsKnown() bool { switch r { - case ZoneSettingServerSideExcludeEditableTrue, ZoneSettingServerSideExcludeEditableFalse: + case ServerSideExcludesEditableTrue, ServerSideExcludesEditableFalse: return true } return false @@ -213,7 +213,7 @@ type SettingServerSideExcludeEditResponseEnvelope struct { // Cloudflare's HTML minification and SSE functionality occur on-the-fly as the // resource moves through our network to the visitor's computer. // (https://support.cloudflare.com/hc/en-us/articles/200170036). - Result ZoneSettingServerSideExclude `json:"result"` + Result ServerSideExcludes `json:"result"` JSON settingServerSideExcludeEditResponseEnvelopeJSON `json:"-"` } @@ -257,7 +257,7 @@ type SettingServerSideExcludeGetResponseEnvelope struct { // Cloudflare's HTML minification and SSE functionality occur on-the-fly as the // resource moves through our network to the visitor's computer. // (https://support.cloudflare.com/hc/en-us/articles/200170036). - Result ZoneSettingServerSideExclude `json:"result"` + Result ServerSideExcludes `json:"result"` JSON settingServerSideExcludeGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingsortquerystringforcache.go b/zones/settingsortquerystringforcache.go index bc2521f839c..b1d2d8a9a8f 100644 --- a/zones/settingsortquerystringforcache.go +++ b/zones/settingsortquerystringforcache.go @@ -36,7 +36,7 @@ func NewSettingSortQueryStringForCacheService(opts ...option.RequestOption) (r * // Cloudflare will treat files with the same query strings as the same file in // cache, regardless of the order of the query strings. This is limited to // Enterprise Zones. -func (r *SettingSortQueryStringForCacheService) Edit(ctx context.Context, params SettingSortQueryStringForCacheEditParams, opts ...option.RequestOption) (res *ZoneSettingSortQueryStringForCache, err error) { +func (r *SettingSortQueryStringForCacheService) Edit(ctx context.Context, params SettingSortQueryStringForCacheEditParams, opts ...option.RequestOption) (res *SortQueryStringForCache, err error) { opts = append(r.Options[:], opts...) var env SettingSortQueryStringForCacheEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/sort_query_string_for_cache", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingSortQueryStringForCacheService) Edit(ctx context.Context, params // Cloudflare will treat files with the same query strings as the same file in // cache, regardless of the order of the query strings. This is limited to // Enterprise Zones. -func (r *SettingSortQueryStringForCacheService) Get(ctx context.Context, query SettingSortQueryStringForCacheGetParams, opts ...option.RequestOption) (res *ZoneSettingSortQueryStringForCache, err error) { +func (r *SettingSortQueryStringForCacheService) Get(ctx context.Context, query SettingSortQueryStringForCacheGetParams, opts ...option.RequestOption) (res *SortQueryStringForCache, err error) { opts = append(r.Options[:], opts...) var env SettingSortQueryStringForCacheGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/sort_query_string_for_cache", query.ZoneID) @@ -66,22 +66,22 @@ func (r *SettingSortQueryStringForCacheService) Get(ctx context.Context, query S // Cloudflare will treat files with the same query strings as the same file in // cache, regardless of the order of the query strings. This is limited to // Enterprise Zones. -type ZoneSettingSortQueryStringForCache struct { +type SortQueryStringForCache struct { // ID of the zone setting. - ID ZoneSettingSortQueryStringForCacheID `json:"id,required"` + ID SortQueryStringForCacheID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingSortQueryStringForCacheValue `json:"value,required"` + Value SortQueryStringForCacheValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingSortQueryStringForCacheEditable `json:"editable"` + Editable SortQueryStringForCacheEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingSortQueryStringForCacheJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON sortQueryStringForCacheJSON `json:"-"` } -// zoneSettingSortQueryStringForCacheJSON contains the JSON metadata for the struct -// [ZoneSettingSortQueryStringForCache] -type zoneSettingSortQueryStringForCacheJSON struct { +// sortQueryStringForCacheJSON contains the JSON metadata for the struct +// [SortQueryStringForCache] +type sortQueryStringForCacheJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -90,40 +90,40 @@ type zoneSettingSortQueryStringForCacheJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSortQueryStringForCache) UnmarshalJSON(data []byte) (err error) { +func (r *SortQueryStringForCache) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSortQueryStringForCacheJSON) RawJSON() string { +func (r sortQueryStringForCacheJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingSortQueryStringForCacheID string +type SortQueryStringForCacheID string const ( - ZoneSettingSortQueryStringForCacheIDSortQueryStringForCache ZoneSettingSortQueryStringForCacheID = "sort_query_string_for_cache" + SortQueryStringForCacheIDSortQueryStringForCache SortQueryStringForCacheID = "sort_query_string_for_cache" ) -func (r ZoneSettingSortQueryStringForCacheID) IsKnown() bool { +func (r SortQueryStringForCacheID) IsKnown() bool { switch r { - case ZoneSettingSortQueryStringForCacheIDSortQueryStringForCache: + case SortQueryStringForCacheIDSortQueryStringForCache: return true } return false } // Current value of the zone setting. -type ZoneSettingSortQueryStringForCacheValue string +type SortQueryStringForCacheValue string const ( - ZoneSettingSortQueryStringForCacheValueOn ZoneSettingSortQueryStringForCacheValue = "on" - ZoneSettingSortQueryStringForCacheValueOff ZoneSettingSortQueryStringForCacheValue = "off" + SortQueryStringForCacheValueOn SortQueryStringForCacheValue = "on" + SortQueryStringForCacheValueOff SortQueryStringForCacheValue = "off" ) -func (r ZoneSettingSortQueryStringForCacheValue) IsKnown() bool { +func (r SortQueryStringForCacheValue) IsKnown() bool { switch r { - case ZoneSettingSortQueryStringForCacheValueOn, ZoneSettingSortQueryStringForCacheValueOff: + case SortQueryStringForCacheValueOn, SortQueryStringForCacheValueOff: return true } return false @@ -131,16 +131,16 @@ func (r ZoneSettingSortQueryStringForCacheValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingSortQueryStringForCacheEditable bool +type SortQueryStringForCacheEditable bool const ( - ZoneSettingSortQueryStringForCacheEditableTrue ZoneSettingSortQueryStringForCacheEditable = true - ZoneSettingSortQueryStringForCacheEditableFalse ZoneSettingSortQueryStringForCacheEditable = false + SortQueryStringForCacheEditableTrue SortQueryStringForCacheEditable = true + SortQueryStringForCacheEditableFalse SortQueryStringForCacheEditable = false ) -func (r ZoneSettingSortQueryStringForCacheEditable) IsKnown() bool { +func (r SortQueryStringForCacheEditable) IsKnown() bool { switch r { - case ZoneSettingSortQueryStringForCacheEditableTrue, ZoneSettingSortQueryStringForCacheEditableFalse: + case SortQueryStringForCacheEditableTrue, SortQueryStringForCacheEditableFalse: return true } return false @@ -181,7 +181,7 @@ type SettingSortQueryStringForCacheEditResponseEnvelope struct { // Cloudflare will treat files with the same query strings as the same file in // cache, regardless of the order of the query strings. This is limited to // Enterprise Zones. - Result ZoneSettingSortQueryStringForCache `json:"result"` + Result SortQueryStringForCache `json:"result"` JSON settingSortQueryStringForCacheEditResponseEnvelopeJSON `json:"-"` } @@ -217,7 +217,7 @@ type SettingSortQueryStringForCacheGetResponseEnvelope struct { // Cloudflare will treat files with the same query strings as the same file in // cache, regardless of the order of the query strings. This is limited to // Enterprise Zones. - Result ZoneSettingSortQueryStringForCache `json:"result"` + Result SortQueryStringForCache `json:"result"` JSON settingSortQueryStringForCacheGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingssl.go b/zones/settingssl.go index 4dee757c64d..0ac29785047 100644 --- a/zones/settingssl.go +++ b/zones/settingssl.go @@ -48,7 +48,7 @@ func NewSettingSSLService(opts ...option.RequestOption) (r *SettingSSLService) { // web server. This certificate must be signed by a certificate authority, have an // expiration date in the future, and respond for the request domain name // (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). -func (r *SettingSSLService) Edit(ctx context.Context, params SettingSSLEditParams, opts ...option.RequestOption) (res *ZoneSettingSSL, err error) { +func (r *SettingSSLService) Edit(ctx context.Context, params SettingSSLEditParams, opts ...option.RequestOption) (res *SSL, err error) { opts = append(r.Options[:], opts...) var env SettingSSLEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ssl", params.ZoneID) @@ -76,7 +76,7 @@ func (r *SettingSSLService) Edit(ctx context.Context, params SettingSSLEditParam // web server. This certificate must be signed by a certificate authority, have an // expiration date in the future, and respond for the request domain name // (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). -func (r *SettingSSLService) Get(ctx context.Context, query SettingSSLGetParams, opts ...option.RequestOption) (res *ZoneSettingSSL, err error) { +func (r *SettingSSLService) Get(ctx context.Context, query SettingSSLGetParams, opts ...option.RequestOption) (res *SSL, err error) { opts = append(r.Options[:], opts...) var env SettingSSLGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ssl", query.ZoneID) @@ -104,21 +104,21 @@ func (r *SettingSSLService) Get(ctx context.Context, query SettingSSLGetParams, // web server. This certificate must be signed by a certificate authority, have an // expiration date in the future, and respond for the request domain name // (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). -type ZoneSettingSSL struct { +type SSL struct { // ID of the zone setting. - ID ZoneSettingSSLID `json:"id,required"` + ID SSLID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingSSLValue `json:"value,required"` + Value SSLValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingSSLEditable `json:"editable"` + Editable SSLEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingSSLJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON sslJSON `json:"-"` } -// zoneSettingSSLJSON contains the JSON metadata for the struct [ZoneSettingSSL] -type zoneSettingSSLJSON struct { +// sslJSON contains the JSON metadata for the struct [SSL] +type sslJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -127,42 +127,42 @@ type zoneSettingSSLJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSSL) UnmarshalJSON(data []byte) (err error) { +func (r *SSL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSSLJSON) RawJSON() string { +func (r sslJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingSSLID string +type SSLID string const ( - ZoneSettingSSLIDSSL ZoneSettingSSLID = "ssl" + SSLIDSSL SSLID = "ssl" ) -func (r ZoneSettingSSLID) IsKnown() bool { +func (r SSLID) IsKnown() bool { switch r { - case ZoneSettingSSLIDSSL: + case SSLIDSSL: return true } return false } // Current value of the zone setting. -type ZoneSettingSSLValue string +type SSLValue string const ( - ZoneSettingSSLValueOff ZoneSettingSSLValue = "off" - ZoneSettingSSLValueFlexible ZoneSettingSSLValue = "flexible" - ZoneSettingSSLValueFull ZoneSettingSSLValue = "full" - ZoneSettingSSLValueStrict ZoneSettingSSLValue = "strict" + SSLValueOff SSLValue = "off" + SSLValueFlexible SSLValue = "flexible" + SSLValueFull SSLValue = "full" + SSLValueStrict SSLValue = "strict" ) -func (r ZoneSettingSSLValue) IsKnown() bool { +func (r SSLValue) IsKnown() bool { switch r { - case ZoneSettingSSLValueOff, ZoneSettingSSLValueFlexible, ZoneSettingSSLValueFull, ZoneSettingSSLValueStrict: + case SSLValueOff, SSLValueFlexible, SSLValueFull, SSLValueStrict: return true } return false @@ -170,16 +170,16 @@ func (r ZoneSettingSSLValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingSSLEditable bool +type SSLEditable bool const ( - ZoneSettingSSLEditableTrue ZoneSettingSSLEditable = true - ZoneSettingSSLEditableFalse ZoneSettingSSLEditable = false + SSLEditableTrue SSLEditable = true + SSLEditableFalse SSLEditable = false ) -func (r ZoneSettingSSLEditable) IsKnown() bool { +func (r SSLEditable) IsKnown() bool { switch r { - case ZoneSettingSSLEditableTrue, ZoneSettingSSLEditableFalse: + case SSLEditableTrue, SSLEditableFalse: return true } return false @@ -235,7 +235,7 @@ type SettingSSLEditResponseEnvelope struct { // web server. This certificate must be signed by a certificate authority, have an // expiration date in the future, and respond for the request domain name // (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). - Result ZoneSettingSSL `json:"result"` + Result SSL `json:"result"` JSON settingSSLEditResponseEnvelopeJSON `json:"-"` } @@ -284,7 +284,7 @@ type SettingSSLGetResponseEnvelope struct { // web server. This certificate must be signed by a certificate authority, have an // expiration date in the future, and respond for the request domain name // (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). - Result ZoneSettingSSL `json:"result"` + Result SSL `json:"result"` JSON settingSSLGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingsslrecommender.go b/zones/settingsslrecommender.go index 2c9409a6994..153d91b67cf 100644 --- a/zones/settingsslrecommender.go +++ b/zones/settingsslrecommender.go @@ -35,7 +35,7 @@ func NewSettingSSLRecommenderService(opts ...option.RequestOption) (r *SettingSS // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. -func (r *SettingSSLRecommenderService) Edit(ctx context.Context, params SettingSSLRecommenderEditParams, opts ...option.RequestOption) (res *ZoneSettingSSLRecommender, err error) { +func (r *SettingSSLRecommenderService) Edit(ctx context.Context, params SettingSSLRecommenderEditParams, opts ...option.RequestOption) (res *SSLRecommender, err error) { opts = append(r.Options[:], opts...) var env SettingSSLRecommenderEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ssl_recommender", params.ZoneID) @@ -50,7 +50,7 @@ func (r *SettingSSLRecommenderService) Edit(ctx context.Context, params SettingS // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. -func (r *SettingSSLRecommenderService) Get(ctx context.Context, query SettingSSLRecommenderGetParams, opts ...option.RequestOption) (res *ZoneSettingSSLRecommender, err error) { +func (r *SettingSSLRecommenderService) Get(ctx context.Context, query SettingSSLRecommenderGetParams, opts ...option.RequestOption) (res *SSLRecommender, err error) { opts = append(r.Options[:], opts...) var env SettingSSLRecommenderGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/ssl_recommender", query.ZoneID) @@ -65,41 +65,40 @@ func (r *SettingSSLRecommenderService) Get(ctx context.Context, query SettingSSL // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. -type ZoneSettingSSLRecommender struct { +type SSLRecommender struct { // Enrollment value for SSL/TLS Recommender. - ID ZoneSettingSSLRecommenderID `json:"id"` + ID SSLRecommenderID `json:"id"` // ssl-recommender enrollment setting. - Enabled bool `json:"enabled"` - JSON zoneSettingSSLRecommenderJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON sslRecommenderJSON `json:"-"` } -// zoneSettingSSLRecommenderJSON contains the JSON metadata for the struct -// [ZoneSettingSSLRecommender] -type zoneSettingSSLRecommenderJSON struct { +// sslRecommenderJSON contains the JSON metadata for the struct [SSLRecommender] +type sslRecommenderJSON struct { ID apijson.Field Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZoneSettingSSLRecommender) UnmarshalJSON(data []byte) (err error) { +func (r *SSLRecommender) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingSSLRecommenderJSON) RawJSON() string { +func (r sslRecommenderJSON) RawJSON() string { return r.raw } // Enrollment value for SSL/TLS Recommender. -type ZoneSettingSSLRecommenderID string +type SSLRecommenderID string const ( - ZoneSettingSSLRecommenderIDSSLRecommender ZoneSettingSSLRecommenderID = "ssl_recommender" + SSLRecommenderIDSSLRecommender SSLRecommenderID = "ssl_recommender" ) -func (r ZoneSettingSSLRecommenderID) IsKnown() bool { +func (r SSLRecommenderID) IsKnown() bool { switch r { - case ZoneSettingSSLRecommenderIDSSLRecommender: + case SSLRecommenderIDSSLRecommender: return true } return false @@ -108,14 +107,14 @@ func (r ZoneSettingSSLRecommenderID) IsKnown() bool { // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. -type ZoneSettingSSLRecommenderParam struct { +type SSLRecommenderParam struct { // Enrollment value for SSL/TLS Recommender. - ID param.Field[ZoneSettingSSLRecommenderID] `json:"id"` + ID param.Field[SSLRecommenderID] `json:"id"` // ssl-recommender enrollment setting. Enabled param.Field[bool] `json:"enabled"` } -func (r ZoneSettingSSLRecommenderParam) MarshalJSON() (data []byte, err error) { +func (r SSLRecommenderParam) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -125,7 +124,7 @@ type SettingSSLRecommenderEditParams struct { // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. - Value param.Field[ZoneSettingSSLRecommenderParam] `json:"value,required"` + Value param.Field[SSLRecommenderParam] `json:"value,required"` } func (r SettingSSLRecommenderEditParams) MarshalJSON() (data []byte, err error) { @@ -140,7 +139,7 @@ type SettingSSLRecommenderEditResponseEnvelope struct { // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. - Result ZoneSettingSSLRecommender `json:"result"` + Result SSLRecommender `json:"result"` JSON settingSSLRecommenderEditResponseEnvelopeJSON `json:"-"` } @@ -176,7 +175,7 @@ type SettingSSLRecommenderGetResponseEnvelope struct { // Enrollment in the SSL/TLS Recommender service which tries to detect and // recommend (by sending periodic emails) the most secure SSL/TLS setting your // origin servers support. - Result ZoneSettingSSLRecommender `json:"result"` + Result SSLRecommender `json:"result"` JSON settingSSLRecommenderGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingsslrecommender_test.go b/zones/settingsslrecommender_test.go index 83b1f7401ce..e4ecc3a40ae 100644 --- a/zones/settingsslrecommender_test.go +++ b/zones/settingsslrecommender_test.go @@ -30,9 +30,9 @@ func TestSettingSSLRecommenderEditWithOptionalParams(t *testing.T) { ) _, err := client.Zones.Settings.SSLRecommender.Edit(context.TODO(), zones.SettingSSLRecommenderEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Value: cloudflare.F(zones.ZoneSettingSSLRecommenderParam{ + Value: cloudflare.F(zones.SSLRecommenderParam{ Enabled: cloudflare.F(true), - ID: cloudflare.F(zones.ZoneSettingSSLRecommenderIDSSLRecommender), + ID: cloudflare.F(zones.SSLRecommenderIDSSLRecommender), }), }) if err != nil { diff --git a/zones/settingtls13.go b/zones/settingtls13.go index 5144287c927..77235b5e268 100644 --- a/zones/settingtls13.go +++ b/zones/settingtls13.go @@ -34,7 +34,7 @@ func NewSettingTLS1_3Service(opts ...option.RequestOption) (r *SettingTLS1_3Serv } // Changes TLS 1.3 setting. -func (r *SettingTLS1_3Service) Edit(ctx context.Context, params SettingTLS1_3EditParams, opts ...option.RequestOption) (res *ZoneSettingTLS1_3, err error) { +func (r *SettingTLS1_3Service) Edit(ctx context.Context, params SettingTLS1_3EditParams, opts ...option.RequestOption) (res *TLS1_3, err error) { opts = append(r.Options[:], opts...) var env SettingTls1_3EditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/tls_1_3", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingTLS1_3Service) Edit(ctx context.Context, params SettingTLS1_3Edi } // Gets TLS 1.3 setting enabled for a zone. -func (r *SettingTLS1_3Service) Get(ctx context.Context, query SettingTLS1_3GetParams, opts ...option.RequestOption) (res *ZoneSettingTLS1_3, err error) { +func (r *SettingTLS1_3Service) Get(ctx context.Context, query SettingTLS1_3GetParams, opts ...option.RequestOption) (res *TLS1_3, err error) { opts = append(r.Options[:], opts...) var env SettingTls1_3GetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/tls_1_3", query.ZoneID) @@ -60,22 +60,21 @@ func (r *SettingTLS1_3Service) Get(ctx context.Context, query SettingTLS1_3GetPa } // Enables Crypto TLS 1.3 feature for a zone. -type ZoneSettingTLS1_3 struct { +type TLS1_3 struct { // ID of the zone setting. - ID ZoneSettingTLS1_3ID `json:"id,required"` + ID TLS1_3ID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingTLS1_3Value `json:"value,required"` + Value TLS1_3Value `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingTLS1_3Editable `json:"editable"` + Editable TLS1_3Editable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingTls1_3JSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON tls1_3JSON `json:"-"` } -// zoneSettingTls1_3JSON contains the JSON metadata for the struct -// [ZoneSettingTLS1_3] -type zoneSettingTls1_3JSON struct { +// tls1_3JSON contains the JSON metadata for the struct [TLS1_3] +type tls1_3JSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -84,41 +83,41 @@ type zoneSettingTls1_3JSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingTLS1_3) UnmarshalJSON(data []byte) (err error) { +func (r *TLS1_3) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingTls1_3JSON) RawJSON() string { +func (r tls1_3JSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingTLS1_3ID string +type TLS1_3ID string const ( - ZoneSettingTLS1_3IDTLS1_3 ZoneSettingTLS1_3ID = "tls_1_3" + TLS1_3IDTLS1_3 TLS1_3ID = "tls_1_3" ) -func (r ZoneSettingTLS1_3ID) IsKnown() bool { +func (r TLS1_3ID) IsKnown() bool { switch r { - case ZoneSettingTLS1_3IDTLS1_3: + case TLS1_3IDTLS1_3: return true } return false } // Current value of the zone setting. -type ZoneSettingTLS1_3Value string +type TLS1_3Value string const ( - ZoneSettingTLS1_3ValueOn ZoneSettingTLS1_3Value = "on" - ZoneSettingTLS1_3ValueOff ZoneSettingTLS1_3Value = "off" - ZoneSettingTLS1_3ValueZrt ZoneSettingTLS1_3Value = "zrt" + TLS1_3ValueOn TLS1_3Value = "on" + TLS1_3ValueOff TLS1_3Value = "off" + TLS1_3ValueZrt TLS1_3Value = "zrt" ) -func (r ZoneSettingTLS1_3Value) IsKnown() bool { +func (r TLS1_3Value) IsKnown() bool { switch r { - case ZoneSettingTLS1_3ValueOn, ZoneSettingTLS1_3ValueOff, ZoneSettingTLS1_3ValueZrt: + case TLS1_3ValueOn, TLS1_3ValueOff, TLS1_3ValueZrt: return true } return false @@ -126,16 +125,16 @@ func (r ZoneSettingTLS1_3Value) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingTLS1_3Editable bool +type TLS1_3Editable bool const ( - ZoneSettingTLS1_3EditableTrue ZoneSettingTLS1_3Editable = true - ZoneSettingTLS1_3EditableFalse ZoneSettingTLS1_3Editable = false + TLS1_3EditableTrue TLS1_3Editable = true + TLS1_3EditableFalse TLS1_3Editable = false ) -func (r ZoneSettingTLS1_3Editable) IsKnown() bool { +func (r TLS1_3Editable) IsKnown() bool { switch r { - case ZoneSettingTLS1_3EditableTrue, ZoneSettingTLS1_3EditableFalse: + case TLS1_3EditableTrue, TLS1_3EditableFalse: return true } return false @@ -177,7 +176,7 @@ type SettingTls1_3EditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enables Crypto TLS 1.3 feature for a zone. - Result ZoneSettingTLS1_3 `json:"result"` + Result TLS1_3 `json:"result"` JSON settingTls1_3EditResponseEnvelopeJSON `json:"-"` } @@ -211,7 +210,7 @@ type SettingTls1_3GetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // Enables Crypto TLS 1.3 feature for a zone. - Result ZoneSettingTLS1_3 `json:"result"` + Result TLS1_3 `json:"result"` JSON settingTls1_3GetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingtlsclientauth.go b/zones/settingtlsclientauth.go index 18a226a89a3..ffcee22e54f 100644 --- a/zones/settingtlsclientauth.go +++ b/zones/settingtlsclientauth.go @@ -35,7 +35,7 @@ func NewSettingTLSClientAuthService(opts ...option.RequestOption) (r *SettingTLS // TLS Client Auth requires Cloudflare to connect to your origin server using a // client certificate (Enterprise Only). -func (r *SettingTLSClientAuthService) Edit(ctx context.Context, params SettingTLSClientAuthEditParams, opts ...option.RequestOption) (res *ZoneSettingTLSClientAuth, err error) { +func (r *SettingTLSClientAuthService) Edit(ctx context.Context, params SettingTLSClientAuthEditParams, opts ...option.RequestOption) (res *TLSClientAuth, err error) { opts = append(r.Options[:], opts...) var env SettingTLSClientAuthEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/tls_client_auth", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingTLSClientAuthService) Edit(ctx context.Context, params SettingTL // TLS Client Auth requires Cloudflare to connect to your origin server using a // client certificate (Enterprise Only). -func (r *SettingTLSClientAuthService) Get(ctx context.Context, query SettingTLSClientAuthGetParams, opts ...option.RequestOption) (res *ZoneSettingTLSClientAuth, err error) { +func (r *SettingTLSClientAuthService) Get(ctx context.Context, query SettingTLSClientAuthGetParams, opts ...option.RequestOption) (res *TLSClientAuth, err error) { opts = append(r.Options[:], opts...) var env SettingTLSClientAuthGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/tls_client_auth", query.ZoneID) @@ -63,22 +63,21 @@ func (r *SettingTLSClientAuthService) Get(ctx context.Context, query SettingTLSC // TLS Client Auth requires Cloudflare to connect to your origin server using a // client certificate (Enterprise Only). -type ZoneSettingTLSClientAuth struct { +type TLSClientAuth struct { // ID of the zone setting. - ID ZoneSettingTLSClientAuthID `json:"id,required"` + ID TLSClientAuthID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingTLSClientAuthValue `json:"value,required"` + Value TLSClientAuthValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingTLSClientAuthEditable `json:"editable"` + Editable TLSClientAuthEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingTLSClientAuthJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON tlsClientAuthJSON `json:"-"` } -// zoneSettingTLSClientAuthJSON contains the JSON metadata for the struct -// [ZoneSettingTLSClientAuth] -type zoneSettingTLSClientAuthJSON struct { +// tlsClientAuthJSON contains the JSON metadata for the struct [TLSClientAuth] +type tlsClientAuthJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +86,40 @@ type zoneSettingTLSClientAuthJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingTLSClientAuth) UnmarshalJSON(data []byte) (err error) { +func (r *TLSClientAuth) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingTLSClientAuthJSON) RawJSON() string { +func (r tlsClientAuthJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingTLSClientAuthID string +type TLSClientAuthID string const ( - ZoneSettingTLSClientAuthIDTLSClientAuth ZoneSettingTLSClientAuthID = "tls_client_auth" + TLSClientAuthIDTLSClientAuth TLSClientAuthID = "tls_client_auth" ) -func (r ZoneSettingTLSClientAuthID) IsKnown() bool { +func (r TLSClientAuthID) IsKnown() bool { switch r { - case ZoneSettingTLSClientAuthIDTLSClientAuth: + case TLSClientAuthIDTLSClientAuth: return true } return false } // Current value of the zone setting. -type ZoneSettingTLSClientAuthValue string +type TLSClientAuthValue string const ( - ZoneSettingTLSClientAuthValueOn ZoneSettingTLSClientAuthValue = "on" - ZoneSettingTLSClientAuthValueOff ZoneSettingTLSClientAuthValue = "off" + TLSClientAuthValueOn TLSClientAuthValue = "on" + TLSClientAuthValueOff TLSClientAuthValue = "off" ) -func (r ZoneSettingTLSClientAuthValue) IsKnown() bool { +func (r TLSClientAuthValue) IsKnown() bool { switch r { - case ZoneSettingTLSClientAuthValueOn, ZoneSettingTLSClientAuthValueOff: + case TLSClientAuthValueOn, TLSClientAuthValueOff: return true } return false @@ -128,16 +127,16 @@ func (r ZoneSettingTLSClientAuthValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingTLSClientAuthEditable bool +type TLSClientAuthEditable bool const ( - ZoneSettingTLSClientAuthEditableTrue ZoneSettingTLSClientAuthEditable = true - ZoneSettingTLSClientAuthEditableFalse ZoneSettingTLSClientAuthEditable = false + TLSClientAuthEditableTrue TLSClientAuthEditable = true + TLSClientAuthEditableFalse TLSClientAuthEditable = false ) -func (r ZoneSettingTLSClientAuthEditable) IsKnown() bool { +func (r TLSClientAuthEditable) IsKnown() bool { switch r { - case ZoneSettingTLSClientAuthEditableTrue, ZoneSettingTLSClientAuthEditableFalse: + case TLSClientAuthEditableTrue, TLSClientAuthEditableFalse: return true } return false @@ -177,7 +176,7 @@ type SettingTLSClientAuthEditResponseEnvelope struct { Success bool `json:"success,required"` // TLS Client Auth requires Cloudflare to connect to your origin server using a // client certificate (Enterprise Only). - Result ZoneSettingTLSClientAuth `json:"result"` + Result TLSClientAuth `json:"result"` JSON settingTLSClientAuthEditResponseEnvelopeJSON `json:"-"` } @@ -212,7 +211,7 @@ type SettingTLSClientAuthGetResponseEnvelope struct { Success bool `json:"success,required"` // TLS Client Auth requires Cloudflare to connect to your origin server using a // client certificate (Enterprise Only). - Result ZoneSettingTLSClientAuth `json:"result"` + Result TLSClientAuth `json:"result"` JSON settingTLSClientAuthGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingtrueclientipheader.go b/zones/settingtrueclientipheader.go index 72ae9175376..dceb896f9f6 100644 --- a/zones/settingtrueclientipheader.go +++ b/zones/settingtrueclientipheader.go @@ -35,7 +35,7 @@ func NewSettingTrueClientIPHeaderService(opts ...option.RequestOption) (r *Setti // Allows customer to continue to use True Client IP (Akamai feature) in the // headers we send to the origin. This is limited to Enterprise Zones. -func (r *SettingTrueClientIPHeaderService) Edit(ctx context.Context, params SettingTrueClientIPHeaderEditParams, opts ...option.RequestOption) (res *ZoneSettingTrueClientIPHeader, err error) { +func (r *SettingTrueClientIPHeaderService) Edit(ctx context.Context, params SettingTrueClientIPHeaderEditParams, opts ...option.RequestOption) (res *TrueClientIPHeader, err error) { opts = append(r.Options[:], opts...) var env SettingTrueClientIPHeaderEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/true_client_ip_header", params.ZoneID) @@ -49,7 +49,7 @@ func (r *SettingTrueClientIPHeaderService) Edit(ctx context.Context, params Sett // Allows customer to continue to use True Client IP (Akamai feature) in the // headers we send to the origin. This is limited to Enterprise Zones. -func (r *SettingTrueClientIPHeaderService) Get(ctx context.Context, query SettingTrueClientIPHeaderGetParams, opts ...option.RequestOption) (res *ZoneSettingTrueClientIPHeader, err error) { +func (r *SettingTrueClientIPHeaderService) Get(ctx context.Context, query SettingTrueClientIPHeaderGetParams, opts ...option.RequestOption) (res *TrueClientIPHeader, err error) { opts = append(r.Options[:], opts...) var env SettingTrueClientIPHeaderGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/true_client_ip_header", query.ZoneID) @@ -63,22 +63,22 @@ func (r *SettingTrueClientIPHeaderService) Get(ctx context.Context, query Settin // Allows customer to continue to use True Client IP (Akamai feature) in the // headers we send to the origin. This is limited to Enterprise Zones. -type ZoneSettingTrueClientIPHeader struct { +type TrueClientIPHeader struct { // ID of the zone setting. - ID ZoneSettingTrueClientIPHeaderID `json:"id,required"` + ID TrueClientIPHeaderID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingTrueClientIPHeaderValue `json:"value,required"` + Value TrueClientIPHeaderValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingTrueClientIPHeaderEditable `json:"editable"` + Editable TrueClientIPHeaderEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingTrueClientIPHeaderJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON trueClientIPHeaderJSON `json:"-"` } -// zoneSettingTrueClientIPHeaderJSON contains the JSON metadata for the struct -// [ZoneSettingTrueClientIPHeader] -type zoneSettingTrueClientIPHeaderJSON struct { +// trueClientIPHeaderJSON contains the JSON metadata for the struct +// [TrueClientIPHeader] +type trueClientIPHeaderJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -87,40 +87,40 @@ type zoneSettingTrueClientIPHeaderJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingTrueClientIPHeader) UnmarshalJSON(data []byte) (err error) { +func (r *TrueClientIPHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingTrueClientIPHeaderJSON) RawJSON() string { +func (r trueClientIPHeaderJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingTrueClientIPHeaderID string +type TrueClientIPHeaderID string const ( - ZoneSettingTrueClientIPHeaderIDTrueClientIPHeader ZoneSettingTrueClientIPHeaderID = "true_client_ip_header" + TrueClientIPHeaderIDTrueClientIPHeader TrueClientIPHeaderID = "true_client_ip_header" ) -func (r ZoneSettingTrueClientIPHeaderID) IsKnown() bool { +func (r TrueClientIPHeaderID) IsKnown() bool { switch r { - case ZoneSettingTrueClientIPHeaderIDTrueClientIPHeader: + case TrueClientIPHeaderIDTrueClientIPHeader: return true } return false } // Current value of the zone setting. -type ZoneSettingTrueClientIPHeaderValue string +type TrueClientIPHeaderValue string const ( - ZoneSettingTrueClientIPHeaderValueOn ZoneSettingTrueClientIPHeaderValue = "on" - ZoneSettingTrueClientIPHeaderValueOff ZoneSettingTrueClientIPHeaderValue = "off" + TrueClientIPHeaderValueOn TrueClientIPHeaderValue = "on" + TrueClientIPHeaderValueOff TrueClientIPHeaderValue = "off" ) -func (r ZoneSettingTrueClientIPHeaderValue) IsKnown() bool { +func (r TrueClientIPHeaderValue) IsKnown() bool { switch r { - case ZoneSettingTrueClientIPHeaderValueOn, ZoneSettingTrueClientIPHeaderValueOff: + case TrueClientIPHeaderValueOn, TrueClientIPHeaderValueOff: return true } return false @@ -128,16 +128,16 @@ func (r ZoneSettingTrueClientIPHeaderValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingTrueClientIPHeaderEditable bool +type TrueClientIPHeaderEditable bool const ( - ZoneSettingTrueClientIPHeaderEditableTrue ZoneSettingTrueClientIPHeaderEditable = true - ZoneSettingTrueClientIPHeaderEditableFalse ZoneSettingTrueClientIPHeaderEditable = false + TrueClientIPHeaderEditableTrue TrueClientIPHeaderEditable = true + TrueClientIPHeaderEditableFalse TrueClientIPHeaderEditable = false ) -func (r ZoneSettingTrueClientIPHeaderEditable) IsKnown() bool { +func (r TrueClientIPHeaderEditable) IsKnown() bool { switch r { - case ZoneSettingTrueClientIPHeaderEditableTrue, ZoneSettingTrueClientIPHeaderEditableFalse: + case TrueClientIPHeaderEditableTrue, TrueClientIPHeaderEditableFalse: return true } return false @@ -177,7 +177,7 @@ type SettingTrueClientIPHeaderEditResponseEnvelope struct { Success bool `json:"success,required"` // Allows customer to continue to use True Client IP (Akamai feature) in the // headers we send to the origin. This is limited to Enterprise Zones. - Result ZoneSettingTrueClientIPHeader `json:"result"` + Result TrueClientIPHeader `json:"result"` JSON settingTrueClientIPHeaderEditResponseEnvelopeJSON `json:"-"` } @@ -212,7 +212,7 @@ type SettingTrueClientIPHeaderGetResponseEnvelope struct { Success bool `json:"success,required"` // Allows customer to continue to use True Client IP (Akamai feature) in the // headers we send to the origin. This is limited to Enterprise Zones. - Result ZoneSettingTrueClientIPHeader `json:"result"` + Result TrueClientIPHeader `json:"result"` JSON settingTrueClientIPHeaderGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingwaf.go b/zones/settingwaf.go index e5922dbdee0..c7491ed7e63 100644 --- a/zones/settingwaf.go +++ b/zones/settingwaf.go @@ -42,7 +42,7 @@ func NewSettingWAFService(opts ...option.RequestOption) (r *SettingWAFService) { // Cloudflare's WAF will block any traffic identified as illegitimate before it // reaches your origin web server. // (https://support.cloudflare.com/hc/en-us/articles/200172016). -func (r *SettingWAFService) Edit(ctx context.Context, params SettingWAFEditParams, opts ...option.RequestOption) (res *ZoneSettingWAF, err error) { +func (r *SettingWAFService) Edit(ctx context.Context, params SettingWAFEditParams, opts ...option.RequestOption) (res *WAF, err error) { opts = append(r.Options[:], opts...) var env SettingWAFEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/waf", params.ZoneID) @@ -64,7 +64,7 @@ func (r *SettingWAFService) Edit(ctx context.Context, params SettingWAFEditParam // Cloudflare's WAF will block any traffic identified as illegitimate before it // reaches your origin web server. // (https://support.cloudflare.com/hc/en-us/articles/200172016). -func (r *SettingWAFService) Get(ctx context.Context, query SettingWAFGetParams, opts ...option.RequestOption) (res *ZoneSettingWAF, err error) { +func (r *SettingWAFService) Get(ctx context.Context, query SettingWAFGetParams, opts ...option.RequestOption) (res *WAF, err error) { opts = append(r.Options[:], opts...) var env SettingWAFGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/waf", query.ZoneID) @@ -86,21 +86,21 @@ func (r *SettingWAFService) Get(ctx context.Context, query SettingWAFGetParams, // Cloudflare's WAF will block any traffic identified as illegitimate before it // reaches your origin web server. // (https://support.cloudflare.com/hc/en-us/articles/200172016). -type ZoneSettingWAF struct { +type WAF struct { // ID of the zone setting. - ID ZoneSettingWAFID `json:"id,required"` + ID WAFID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingWAFValue `json:"value,required"` + Value WAFValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingWAFEditable `json:"editable"` + Editable WAFEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingWAFJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON wafJSON `json:"-"` } -// zoneSettingWAFJSON contains the JSON metadata for the struct [ZoneSettingWAF] -type zoneSettingWAFJSON struct { +// wafJSON contains the JSON metadata for the struct [WAF] +type wafJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -109,40 +109,40 @@ type zoneSettingWAFJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingWAF) UnmarshalJSON(data []byte) (err error) { +func (r *WAF) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingWAFJSON) RawJSON() string { +func (r wafJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingWAFID string +type WAFID string const ( - ZoneSettingWAFIDWAF ZoneSettingWAFID = "waf" + WAFIDWAF WAFID = "waf" ) -func (r ZoneSettingWAFID) IsKnown() bool { +func (r WAFID) IsKnown() bool { switch r { - case ZoneSettingWAFIDWAF: + case WAFIDWAF: return true } return false } // Current value of the zone setting. -type ZoneSettingWAFValue string +type WAFValue string const ( - ZoneSettingWAFValueOn ZoneSettingWAFValue = "on" - ZoneSettingWAFValueOff ZoneSettingWAFValue = "off" + WAFValueOn WAFValue = "on" + WAFValueOff WAFValue = "off" ) -func (r ZoneSettingWAFValue) IsKnown() bool { +func (r WAFValue) IsKnown() bool { switch r { - case ZoneSettingWAFValueOn, ZoneSettingWAFValueOff: + case WAFValueOn, WAFValueOff: return true } return false @@ -150,16 +150,16 @@ func (r ZoneSettingWAFValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingWAFEditable bool +type WAFEditable bool const ( - ZoneSettingWAFEditableTrue ZoneSettingWAFEditable = true - ZoneSettingWAFEditableFalse ZoneSettingWAFEditable = false + WAFEditableTrue WAFEditable = true + WAFEditableFalse WAFEditable = false ) -func (r ZoneSettingWAFEditable) IsKnown() bool { +func (r WAFEditable) IsKnown() bool { switch r { - case ZoneSettingWAFEditableTrue, ZoneSettingWAFEditableFalse: + case WAFEditableTrue, WAFEditableFalse: return true } return false @@ -207,7 +207,7 @@ type SettingWAFEditResponseEnvelope struct { // Cloudflare's WAF will block any traffic identified as illegitimate before it // reaches your origin web server. // (https://support.cloudflare.com/hc/en-us/articles/200172016). - Result ZoneSettingWAF `json:"result"` + Result WAF `json:"result"` JSON settingWAFEditResponseEnvelopeJSON `json:"-"` } @@ -250,7 +250,7 @@ type SettingWAFGetResponseEnvelope struct { // Cloudflare's WAF will block any traffic identified as illegitimate before it // reaches your origin web server. // (https://support.cloudflare.com/hc/en-us/articles/200172016). - Result ZoneSettingWAF `json:"result"` + Result WAF `json:"result"` JSON settingWAFGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingwebp.go b/zones/settingwebp.go index d9d34107ead..3fe46831997 100644 --- a/zones/settingwebp.go +++ b/zones/settingwebp.go @@ -36,7 +36,7 @@ func NewSettingWebPService(opts ...option.RequestOption) (r *SettingWebPService) // When the client requesting the image supports the WebP image codec, and WebP // offers a performance advantage over the original image format, Cloudflare will // serve a WebP version of the original image. -func (r *SettingWebPService) Edit(ctx context.Context, params SettingWebPEditParams, opts ...option.RequestOption) (res *ZoneSettingWebP, err error) { +func (r *SettingWebPService) Edit(ctx context.Context, params SettingWebPEditParams, opts ...option.RequestOption) (res *WebP, err error) { opts = append(r.Options[:], opts...) var env SettingWebPEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/webp", params.ZoneID) @@ -51,7 +51,7 @@ func (r *SettingWebPService) Edit(ctx context.Context, params SettingWebPEditPar // When the client requesting the image supports the WebP image codec, and WebP // offers a performance advantage over the original image format, Cloudflare will // serve a WebP version of the original image. -func (r *SettingWebPService) Get(ctx context.Context, query SettingWebPGetParams, opts ...option.RequestOption) (res *ZoneSettingWebP, err error) { +func (r *SettingWebPService) Get(ctx context.Context, query SettingWebPGetParams, opts ...option.RequestOption) (res *WebP, err error) { opts = append(r.Options[:], opts...) var env SettingWebPGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/webp", query.ZoneID) @@ -66,21 +66,21 @@ func (r *SettingWebPService) Get(ctx context.Context, query SettingWebPGetParams // When the client requesting the image supports the WebP image codec, and WebP // offers a performance advantage over the original image format, Cloudflare will // serve a WebP version of the original image. -type ZoneSettingWebP struct { +type WebP struct { // ID of the zone setting. - ID ZoneSettingWebPID `json:"id,required"` + ID WebPID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingWebPValue `json:"value,required"` + Value WebPValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingWebPEditable `json:"editable"` + Editable WebPEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingWebPJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON WebPJSON `json:"-"` } -// zoneSettingWebPJSON contains the JSON metadata for the struct [ZoneSettingWebP] -type zoneSettingWebPJSON struct { +// WebPJSON contains the JSON metadata for the struct [WebP] +type WebPJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -89,40 +89,40 @@ type zoneSettingWebPJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingWebP) UnmarshalJSON(data []byte) (err error) { +func (r *WebP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingWebPJSON) RawJSON() string { +func (r WebPJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingWebPID string +type WebPID string const ( - ZoneSettingWebPIDWebP ZoneSettingWebPID = "webp" + WebPIDWebP WebPID = "webp" ) -func (r ZoneSettingWebPID) IsKnown() bool { +func (r WebPID) IsKnown() bool { switch r { - case ZoneSettingWebPIDWebP: + case WebPIDWebP: return true } return false } // Current value of the zone setting. -type ZoneSettingWebPValue string +type WebPValue string const ( - ZoneSettingWebPValueOff ZoneSettingWebPValue = "off" - ZoneSettingWebPValueOn ZoneSettingWebPValue = "on" + WebPValueOff WebPValue = "off" + WebPValueOn WebPValue = "on" ) -func (r ZoneSettingWebPValue) IsKnown() bool { +func (r WebPValue) IsKnown() bool { switch r { - case ZoneSettingWebPValueOff, ZoneSettingWebPValueOn: + case WebPValueOff, WebPValueOn: return true } return false @@ -130,16 +130,16 @@ func (r ZoneSettingWebPValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingWebPEditable bool +type WebPEditable bool const ( - ZoneSettingWebPEditableTrue ZoneSettingWebPEditable = true - ZoneSettingWebPEditableFalse ZoneSettingWebPEditable = false + WebPEditableTrue WebPEditable = true + WebPEditableFalse WebPEditable = false ) -func (r ZoneSettingWebPEditable) IsKnown() bool { +func (r WebPEditable) IsKnown() bool { switch r { - case ZoneSettingWebPEditableTrue, ZoneSettingWebPEditableFalse: + case WebPEditableTrue, WebPEditableFalse: return true } return false @@ -180,7 +180,7 @@ type SettingWebPEditResponseEnvelope struct { // When the client requesting the image supports the WebP image codec, and WebP // offers a performance advantage over the original image format, Cloudflare will // serve a WebP version of the original image. - Result ZoneSettingWebP `json:"result"` + Result WebP `json:"result"` JSON settingWebPEditResponseEnvelopeJSON `json:"-"` } @@ -216,7 +216,7 @@ type SettingWebPGetResponseEnvelope struct { // When the client requesting the image supports the WebP image codec, and WebP // offers a performance advantage over the original image format, Cloudflare will // serve a WebP version of the original image. - Result ZoneSettingWebP `json:"result"` + Result WebP `json:"result"` JSON settingWebPGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingwebsocket.go b/zones/settingwebsocket.go index e0b9941e5a9..f3f1b9043b3 100644 --- a/zones/settingwebsocket.go +++ b/zones/settingwebsocket.go @@ -36,7 +36,7 @@ func NewSettingWebsocketService(opts ...option.RequestOption) (r *SettingWebsock // Changes Websockets setting. For more information about Websockets, please refer // to // [Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets). -func (r *SettingWebsocketService) Edit(ctx context.Context, params SettingWebsocketEditParams, opts ...option.RequestOption) (res *ZoneSettingWebsockets, err error) { +func (r *SettingWebsocketService) Edit(ctx context.Context, params SettingWebsocketEditParams, opts ...option.RequestOption) (res *Websocket, err error) { opts = append(r.Options[:], opts...) var env SettingWebsocketEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/websockets", params.ZoneID) @@ -50,7 +50,7 @@ func (r *SettingWebsocketService) Edit(ctx context.Context, params SettingWebsoc // Gets Websockets setting. For more information about Websockets, please refer to // [Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets). -func (r *SettingWebsocketService) Get(ctx context.Context, query SettingWebsocketGetParams, opts ...option.RequestOption) (res *ZoneSettingWebsockets, err error) { +func (r *SettingWebsocketService) Get(ctx context.Context, query SettingWebsocketGetParams, opts ...option.RequestOption) (res *Websocket, err error) { opts = append(r.Options[:], opts...) var env SettingWebsocketGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/websockets", query.ZoneID) @@ -69,22 +69,21 @@ func (r *SettingWebsocketService) Get(ctx context.Context, query SettingWebsocke // real-time applications such as live chat and gaming. For more information refer // to // [Can I use Cloudflare with Websockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-Cloudflare-with-WebSockets-). -type ZoneSettingWebsockets struct { +type Websocket struct { // ID of the zone setting. - ID ZoneSettingWebsocketsID `json:"id,required"` + ID WebsocketID `json:"id,required"` // Current value of the zone setting. - Value ZoneSettingWebsocketsValue `json:"value,required"` + Value WebsocketValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSettingWebsocketsEditable `json:"editable"` + Editable WebsocketEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSettingWebsocketsJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON websocketJSON `json:"-"` } -// zoneSettingWebsocketsJSON contains the JSON metadata for the struct -// [ZoneSettingWebsockets] -type zoneSettingWebsocketsJSON struct { +// websocketJSON contains the JSON metadata for the struct [Websocket] +type websocketJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -93,40 +92,40 @@ type zoneSettingWebsocketsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSettingWebsockets) UnmarshalJSON(data []byte) (err error) { +func (r *Websocket) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSettingWebsocketsJSON) RawJSON() string { +func (r websocketJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSettingWebsocketsID string +type WebsocketID string const ( - ZoneSettingWebsocketsIDWebsockets ZoneSettingWebsocketsID = "websockets" + WebsocketIDWebsockets WebsocketID = "websockets" ) -func (r ZoneSettingWebsocketsID) IsKnown() bool { +func (r WebsocketID) IsKnown() bool { switch r { - case ZoneSettingWebsocketsIDWebsockets: + case WebsocketIDWebsockets: return true } return false } // Current value of the zone setting. -type ZoneSettingWebsocketsValue string +type WebsocketValue string const ( - ZoneSettingWebsocketsValueOff ZoneSettingWebsocketsValue = "off" - ZoneSettingWebsocketsValueOn ZoneSettingWebsocketsValue = "on" + WebsocketValueOff WebsocketValue = "off" + WebsocketValueOn WebsocketValue = "on" ) -func (r ZoneSettingWebsocketsValue) IsKnown() bool { +func (r WebsocketValue) IsKnown() bool { switch r { - case ZoneSettingWebsocketsValueOff, ZoneSettingWebsocketsValueOn: + case WebsocketValueOff, WebsocketValueOn: return true } return false @@ -134,16 +133,16 @@ func (r ZoneSettingWebsocketsValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSettingWebsocketsEditable bool +type WebsocketEditable bool const ( - ZoneSettingWebsocketsEditableTrue ZoneSettingWebsocketsEditable = true - ZoneSettingWebsocketsEditableFalse ZoneSettingWebsocketsEditable = false + WebsocketEditableTrue WebsocketEditable = true + WebsocketEditableFalse WebsocketEditable = false ) -func (r ZoneSettingWebsocketsEditable) IsKnown() bool { +func (r WebsocketEditable) IsKnown() bool { switch r { - case ZoneSettingWebsocketsEditableTrue, ZoneSettingWebsocketsEditableFalse: + case WebsocketEditableTrue, WebsocketEditableFalse: return true } return false @@ -188,7 +187,7 @@ type SettingWebsocketEditResponseEnvelope struct { // real-time applications such as live chat and gaming. For more information refer // to // [Can I use Cloudflare with Websockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-Cloudflare-with-WebSockets-). - Result ZoneSettingWebsockets `json:"result"` + Result Websocket `json:"result"` JSON settingWebsocketEditResponseEnvelopeJSON `json:"-"` } @@ -228,7 +227,7 @@ type SettingWebsocketGetResponseEnvelope struct { // real-time applications such as live chat and gaming. For more information refer // to // [Can I use Cloudflare with Websockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-Cloudflare-with-WebSockets-). - Result ZoneSettingWebsockets `json:"result"` + Result Websocket `json:"result"` JSON settingWebsocketGetResponseEnvelopeJSON `json:"-"` } diff --git a/zones/settingzerortt.go b/zones/settingzerortt.go index bd7a2084d2f..788de703d05 100644 --- a/zones/settingzerortt.go +++ b/zones/settingzerortt.go @@ -34,7 +34,7 @@ func NewSettingZeroRTTService(opts ...option.RequestOption) (r *SettingZeroRTTSe } // Changes the 0-RTT session resumption setting. -func (r *SettingZeroRTTService) Edit(ctx context.Context, params SettingZeroRTTEditParams, opts ...option.RequestOption) (res *ZoneSetting0rtt, err error) { +func (r *SettingZeroRTTService) Edit(ctx context.Context, params SettingZeroRTTEditParams, opts ...option.RequestOption) (res *ZeroRTT, err error) { opts = append(r.Options[:], opts...) var env SettingZeroRTTEditResponseEnvelope path := fmt.Sprintf("zones/%s/settings/0rtt", params.ZoneID) @@ -47,7 +47,7 @@ func (r *SettingZeroRTTService) Edit(ctx context.Context, params SettingZeroRTTE } // Gets 0-RTT session resumption setting. -func (r *SettingZeroRTTService) Get(ctx context.Context, query SettingZeroRTTGetParams, opts ...option.RequestOption) (res *ZoneSetting0rtt, err error) { +func (r *SettingZeroRTTService) Get(ctx context.Context, query SettingZeroRTTGetParams, opts ...option.RequestOption) (res *ZeroRTT, err error) { opts = append(r.Options[:], opts...) var env SettingZeroRTTGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/0rtt", query.ZoneID) @@ -60,21 +60,21 @@ func (r *SettingZeroRTTService) Get(ctx context.Context, query SettingZeroRTTGet } // 0-RTT session resumption enabled for this zone. -type ZoneSetting0rtt struct { +type ZeroRTT struct { // ID of the zone setting. - ID ZoneSetting0rttID `json:"id,required"` + ID ZeroRTTID `json:"id,required"` // Current value of the zone setting. - Value ZoneSetting0rttValue `json:"value,required"` + Value ZeroRTTValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable ZoneSetting0rttEditable `json:"editable"` + Editable ZeroRTTEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON zoneSetting0rttJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON zeroRTTJSON `json:"-"` } -// zoneSetting0rttJSON contains the JSON metadata for the struct [ZoneSetting0rtt] -type zoneSetting0rttJSON struct { +// zeroRTTJSON contains the JSON metadata for the struct [ZeroRTT] +type zeroRTTJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -83,40 +83,40 @@ type zoneSetting0rttJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneSetting0rtt) UnmarshalJSON(data []byte) (err error) { +func (r *ZeroRTT) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r zoneSetting0rttJSON) RawJSON() string { +func (r zeroRTTJSON) RawJSON() string { return r.raw } // ID of the zone setting. -type ZoneSetting0rttID string +type ZeroRTTID string const ( - ZoneSetting0rttID0rtt ZoneSetting0rttID = "0rtt" + ZeroRTTID0rtt ZeroRTTID = "0rtt" ) -func (r ZoneSetting0rttID) IsKnown() bool { +func (r ZeroRTTID) IsKnown() bool { switch r { - case ZoneSetting0rttID0rtt: + case ZeroRTTID0rtt: return true } return false } // Current value of the zone setting. -type ZoneSetting0rttValue string +type ZeroRTTValue string const ( - ZoneSetting0rttValueOn ZoneSetting0rttValue = "on" - ZoneSetting0rttValueOff ZoneSetting0rttValue = "off" + ZeroRTTValueOn ZeroRTTValue = "on" + ZeroRTTValueOff ZeroRTTValue = "off" ) -func (r ZoneSetting0rttValue) IsKnown() bool { +func (r ZeroRTTValue) IsKnown() bool { switch r { - case ZoneSetting0rttValueOn, ZoneSetting0rttValueOff: + case ZeroRTTValueOn, ZeroRTTValueOff: return true } return false @@ -124,16 +124,16 @@ func (r ZoneSetting0rttValue) IsKnown() bool { // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type ZoneSetting0rttEditable bool +type ZeroRTTEditable bool const ( - ZoneSetting0rttEditableTrue ZoneSetting0rttEditable = true - ZoneSetting0rttEditableFalse ZoneSetting0rttEditable = false + ZeroRTTEditableTrue ZeroRTTEditable = true + ZeroRTTEditableFalse ZeroRTTEditable = false ) -func (r ZoneSetting0rttEditable) IsKnown() bool { +func (r ZeroRTTEditable) IsKnown() bool { switch r { - case ZoneSetting0rttEditableTrue, ZoneSetting0rttEditableFalse: + case ZeroRTTEditableTrue, ZeroRTTEditableFalse: return true } return false @@ -172,7 +172,7 @@ type SettingZeroRTTEditResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // 0-RTT session resumption enabled for this zone. - Result ZoneSetting0rtt `json:"result"` + Result ZeroRTT `json:"result"` JSON settingZeroRTTEditResponseEnvelopeJSON `json:"-"` } @@ -206,7 +206,7 @@ type SettingZeroRTTGetResponseEnvelope struct { // Whether the API call was successful Success bool `json:"success,required"` // 0-RTT session resumption enabled for this zone. - Result ZoneSetting0rtt `json:"result"` + Result ZeroRTT `json:"result"` JSON settingZeroRTTGetResponseEnvelopeJSON `json:"-"` }