Repository: cloudflare/cloudflare-go
Pull request #3049 (2024-09-10 06:15:16)

feat(api): move rate plans and plans under zone


Patch:
diff --git a/api.md b/api.md
index 04096472b..b77f74d7b 100644
--- a/api.md
+++ b/api.md
@@ -435,6 +435,27 @@ Methods:
 - <code title="put /zones/{identifier}/subscription">client.Zones.Subscriptions.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#SubscriptionService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#SubscriptionUpdateParams">SubscriptionUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#interface{}">interface{}</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
 - <code title="get /zones/{identifier}/subscription">client.Zones.Subscriptions.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#SubscriptionService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#interface{}">interface{}</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
 
+## Plans
+
+Response Types:
+
+- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#AvailableRatePlan">AvailableRatePlan</a>
+
+Methods:
+
+- <code title="get /zones/{zone_id}/available_plans">client.Zones.Plans.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#PlanService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#PlanListParams">PlanListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/internal/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/internal/pagination#SinglePage">SinglePage</a>[<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#AvailableRatePlan">AvailableRatePlan</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
+- <code title="get /zones/{zone_id}/available_plans/{plan_identifier}">client.Zones.Plans.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#PlanService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, planIdentifier <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#PlanGetParams">PlanGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#AvailableRatePlan">AvailableRatePlan</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
+
+## RatePlans
+
+Response Types:
+
+- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#RatePlanGetResponse">RatePlanGetResponse</a>
+
+Methods:
+
+- <code title="get /zones/{zone_id}/available_rate_plans">client.Zones.RatePlans.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#RatePlanService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#RatePlanGetParams">RatePlanGetParams</a>) ([]<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones">zones</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zones#RatePlanGetResponse">RatePlanGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
+
 # LoadBalancers
 
 Params Types:
@@ -804,27 +825,6 @@ Methods:
 - <code title="patch /zones/{zone_id}/argo/tiered_caching">client.Argo.TieredCaching.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo#TieredCachingService.Edit">Edit</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo">argo</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo#TieredCachingEditParams">TieredCachingEditParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo">argo</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo#TieredCachingEditResponse">TieredCachingEditResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
 - <code title="get /zones/{zone_id}/argo/tiered_caching">client.Argo.TieredCaching.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo#TieredCachingService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo">argo</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo#TieredCachingGetParams">TieredCachingGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo">argo</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/argo#TieredCachingGetResponse">TieredCachingGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
 
-# Plans
-
-Response Types:
-
-- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans">plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#AvailableRatePlan">AvailableRatePlan</a>
-
-Methods:
-
-- <code title="get /zones/{zone_id}/available_plans">client.Plans.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#PlanService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans">plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#PlanListParams">PlanListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/internal/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/internal/pagination#SinglePage">SinglePage</a>[<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans">plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#AvailableRatePlan">AvailableRatePlan</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
-- <code title="get /zones/{zone_id}/available_plans/{plan_identifier}">client.Plans.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#PlanService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, planIdentifier <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans">plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#PlanGetParams">PlanGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans">plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/plans#AvailableRatePlan">AvailableRatePlan</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
-
-# RatePlans
-
-Response Types:
-
-- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans">rate_plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans#RatePlan">RatePlan</a>
-
-Methods:
-
-- <code title="get /zones/{zone_id}/available_rate_plans">client.RatePlans.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans#RatePlanService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans">rate_plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans#RatePlanGetParams">RatePlanGetParams</a>) ([]<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans">rate_plans</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/rate_plans#RatePlan">RatePlan</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
-
 # CertificateAuthorities
 
 ## HostnameAssociations
diff --git a/client.go b/client.go
index 4f650517d..6aa5e94ea 100644
--- a/client.go
+++ b/client.go
@@ -64,12 +64,10 @@ import (
 	"github.com/cloudflare/cloudflare-go/v2/page_shield"
 	"github.com/cloudflare/cloudflare-go/v2/pagerules"
 	"github.com/cloudflare/cloudflare-go/v2/pages"
-	"github.com/cloudflare/cloudflare-go/v2/plans"
 	"github.com/cloudflare/cloudflare-go/v2/queues"
 	"github.com/cloudflare/cloudflare-go/v2/r2"
 	"github.com/cloudflare/cloudflare-go/v2/radar"
 	"github.com/cloudflare/cloudflare-go/v2/rate_limits"
-	"github.com/cloudflare/cloudflare-go/v2/rate_plans"
 	"github.com/cloudflare/cloudflare-go/v2/registrar"
 	"github.com/cloudflare/cloudflare-go/v2/request_tracers"
 	"github.com/cloudflare/cloudflare-go/v2/rules"
@@ -112,8 +110,6 @@ type Client struct {
 	SSL                         *ssl.SSLService
 	ACM                         *acm.ACMService
 	Argo                        *argo.ArgoService
-	Plans                       *plans.PlanService
-	RatePlans                   *rate_plans.RatePlanService
 	CertificateAuthorities      *certificate_authorities.CertificateAuthorityService
 	ClientCertificates          *client_certificates.ClientCertificateService
 	CustomCertificates          *custom_certificates.CustomCertificateService
@@ -222,8 +218,6 @@ func NewClient(opts ...option.RequestOption) (r *Client) {
 	r.SSL = ssl.NewSSLService(opts...)
 	r.ACM = acm.NewACMService(opts...)
 	r.Argo = argo.NewArgoService(opts...)
-	r.Plans = plans.NewPlanService(opts...)
-	r.RatePlans = rate_plans.NewRatePlanService(opts...)
 	r.CertificateAuthorities = certificate_authorities.NewCertificateAuthorityService(opts...)
 	r.ClientCertificates = client_certificates.NewClientCertificateService(opts...)
 	r.CustomCertificates = custom_certificates.NewCustomCertificateService(opts...)
diff --git a/plans/aliases.go b/plans/aliases.go
deleted file mode 100644
index 1e9c9b749..000000000
--- a/plans/aliases.go
+++ /dev/null
@@ -1,238 +0,0 @@
-// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-package plans
-
-import (
-	"github.com/cloudflare/cloudflare-go/v2/internal/apierror"
-	"github.com/cloudflare/cloudflare-go/v2/shared"
-)
-
-type Error = apierror.Error
-
-// This is an alias to an internal type.
-type ASN = shared.ASN
-
-// This is an alias to an internal type.
-type ASNParam = shared.ASNParam
-
-// This is an alias to an internal type.
-type AuditLog = shared.AuditLog
-
-// This is an alias to an internal type.
-type AuditLogAction = shared.AuditLogAction
-
-// This is an alias to an internal type.
-type AuditLogActor = shared.AuditLogActor
-
-// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
-//
-// This is an alias to an internal type.
-type AuditLogActorType = shared.AuditLogActorType
-
-// This is an alias to an internal value.
-const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
-
-// This is an alias to an internal value.
-const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
-
-// This is an alias to an internal value.
-const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
-
-// This is an alias to an internal type.
-type AuditLogOwner = shared.AuditLogOwner
-
-// This is an alias to an internal type.
-type AuditLogResource = shared.AuditLogResource
-
-// The Certificate Authority that will issue the certificate
-//
-// This is an alias to an internal type.
-type CertificateCA = shared.CertificateCA
-
-// This is an alias to an internal value.
-const CertificateCADigicert = shared.CertificateCADigicert
-
-// This is an alias to an internal value.
-const CertificateCAGoogle = shared.CertificateCAGoogle
-
-// This is an alias to an internal value.
-const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
-
-// This is an alias to an internal value.
-const CertificateCASSLCom = shared.CertificateCASSLCom
-
-// Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa),
-// or "keyless-certificate" (for Keyless SSL servers).
-//
-// This is an alias to an internal type.
-type CertificateRequestType = shared.CertificateRequestType
-
-// This is an alias to an internal value.
-const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
-
-// This is an alias to an internal value.
-const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
-
-// This is an alias to an internal value.
-const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
-
-// A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
-//
-// This is an alias to an internal type.
-type CloudflareTunnel = shared.CloudflareTunnel
-
-// This is an alias to an internal type.
-type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
-
-// The status of the tunnel. Valid values are `inactive` (tunnel has never been
-// run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy
-// state), `healthy` (tunnel is active and able to serve traffic), or `down`
-// (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
-//
-// This is an alias to an internal type.
-type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
-
-// The type of tunnel.
-//
-// This is an alias to an internal type.
-type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
-
-// This is an alias to an internal type.
-type ErrorData = shared.ErrorData
-
-// This is an alias to an internal type.
-type MemberParam = shared.MemberParam
-
-// This is an alias to an internal type.
-type MemberRoleParam = shared.MemberRoleParam
-
-// This is an alias to an internal type.
-type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam
-
-// A member's status in the account.
-//
-// This is an alias to an internal type.
-type MemberStatus = shared.MemberStatus
-
-// This is an alias to an internal value.
-const MemberStatusAccepted = shared.MemberStatusAccepted
-
-// This is an alias to an internal value.
-const MemberStatusPending = shared.MemberStatusPending
-
-// Details of the user associated to the membership.
-//
-// This is an alias to an internal type.
-type MemberUserParam = shared.MemberUserParam
-
-// This is an alias to an internal type.
-type Permission = shared.Permission
-
-// This is an alias to an internal type.
-type PermissionGrant = shared.PermissionGrant
-
-// This is an alias to an internal type.
-type PermissionGrantParam = shared.PermissionGrantParam
-
-// The rate plan applied to the subscription.
-//
-// This is an alias to an internal type.
-type RatePlan = shared.RatePlan
-
-// The rate plan applied to the subscription.
-//
-// This is an alias to an internal type.
-type RatePlanParam = shared.RatePlanParam
-
-// This is an alias to an internal type.
-type ResponseInfo = shared.ResponseInfo
-
-// This is an alias to an internal type.
-type Role = shared.Role
-
-// Direction to order DNS records in.
-//
-// This is an alias to an internal type.
-type SortDirection = shared.SortDirection
-
-// This is an alias to an internal value.
-const SortDirectionAsc = shared.SortDirectionAsc
-
-// This is an alias to an internal value.
-const SortDirectionDesc = shared.SortDirectionDesc
-
-// This is an alias to an internal type.
-type Subscription = shared.Subscription
-
-// How often the subscription is renewed automatically.
-//
-// This is an alias to an internal type.
-type SubscriptionFrequency = shared.SubscriptionFrequency
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
-
-// The state that the subscription is in.
-//
-// This is an alias to an internal type.
-type SubscriptionState = shared.SubscriptionState
-
-// This is an alias to an internal value.
-const SubscriptionStateTrial = shared.SubscriptionStateTrial
-
-// This is an alias to an internal value.
-const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
-
-// This is an alias to an internal value.
-const SubscriptionStatePaid = shared.SubscriptionStatePaid
-
-// This is an alias to an internal value.
-const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
-
-// This is an alias to an internal value.
-const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
-
-// This is an alias to an internal value.
-const SubscriptionStateFailed = shared.SubscriptionStateFailed
-
-// This is an alias to an internal value.
-const SubscriptionStateExpired = shared.SubscriptionStateExpired
-
-// This is an alias to an internal type.
-type SubscriptionParam = shared.SubscriptionParam
diff --git a/rate_plans/aliases.go b/rate_plans/aliases.go
deleted file mode 100644
index 23fa2205f..000000000
--- a/rate_plans/aliases.go
+++ /dev/null
@@ -1,238 +0,0 @@
-// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-package rate_plans
-
-import (
-	"github.com/cloudflare/cloudflare-go/v2/internal/apierror"
-	"github.com/cloudflare/cloudflare-go/v2/shared"
-)
-
-type Error = apierror.Error
-
-// This is an alias to an internal type.
-type ASN = shared.ASN
-
-// This is an alias to an internal type.
-type ASNParam = shared.ASNParam
-
-// This is an alias to an internal type.
-type AuditLog = shared.AuditLog
-
-// This is an alias to an internal type.
-type AuditLogAction = shared.AuditLogAction
-
-// This is an alias to an internal type.
-type AuditLogActor = shared.AuditLogActor
-
-// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
-//
-// This is an alias to an internal type.
-type AuditLogActorType = shared.AuditLogActorType
-
-// This is an alias to an internal value.
-const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
-
-// This is an alias to an internal value.
-const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
-
-// This is an alias to an internal value.
-const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
-
-// This is an alias to an internal type.
-type AuditLogOwner = shared.AuditLogOwner
-
-// This is an alias to an internal type.
-type AuditLogResource = shared.AuditLogResource
-
-// The Certificate Authority that will issue the certificate
-//
-// This is an alias to an internal type.
-type CertificateCA = shared.CertificateCA
-
-// This is an alias to an internal value.
-const CertificateCADigicert = shared.CertificateCADigicert
-
-// This is an alias to an internal value.
-const CertificateCAGoogle = shared.CertificateCAGoogle
-
-// This is an alias to an internal value.
-const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
-
-// This is an alias to an internal value.
-const CertificateCASSLCom = shared.CertificateCASSLCom
-
-// Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa),
-// or "keyless-certificate" (for Keyless SSL servers).
-//
-// This is an alias to an internal type.
-type CertificateRequestType = shared.CertificateRequestType
-
-// This is an alias to an internal value.
-const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
-
-// This is an alias to an internal value.
-const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
-
-// This is an alias to an internal value.
-const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
-
-// A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
-//
-// This is an alias to an internal type.
-type CloudflareTunnel = shared.CloudflareTunnel
-
-// This is an alias to an internal type.
-type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
-
-// The status of the tunnel. Valid values are `inactive` (tunnel has never been
-// run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy
-// state), `healthy` (tunnel is active and able to serve traffic), or `down`
-// (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
-//
-// This is an alias to an internal type.
-type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
-
-// This is an alias to an internal value.
-const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
-
-// The type of tunnel.
-//
-// This is an alias to an internal type.
-type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
-
-// This is an alias to an internal value.
-const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
-
-// This is an alias to an internal type.
-type ErrorData = shared.ErrorData
-
-// This is an alias to an internal type.
-type MemberParam = shared.MemberParam
-
-// This is an alias to an internal type.
-type MemberRoleParam = shared.MemberRoleParam
-
-// This is an alias to an internal type.
-type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam
-
-// A member's status in the account.
-//
-// This is an alias to an internal type.
-type MemberStatus = shared.MemberStatus
-
-// This is an alias to an internal value.
-const MemberStatusAccepted = shared.MemberStatusAccepted
-
-// This is an alias to an internal value.
-const MemberStatusPending = shared.MemberStatusPending
-
-// Details of the user associated to the membership.
-//
-// This is an alias to an internal type.
-type MemberUserParam = shared.MemberUserParam
-
-// This is an alias to an internal type.
-type Permission = shared.Permission
-
-// This is an alias to an internal type.
-type PermissionGrant = shared.PermissionGrant
-
-// This is an alias to an internal type.
-type PermissionGrantParam = shared.PermissionGrantParam
-
-// The rate plan applied to the subscription.
-//
-// This is an alias to an internal type.
-type RatePlan = shared.RatePlan
-
-// The rate plan applied to the subscription.
-//
-// This is an alias to an internal type.
-type RatePlanParam = shared.RatePlanParam
-
-// This is an alias to an internal type.
-type ResponseInfo = shared.ResponseInfo
-
-// This is an alias to an internal type.
-type Role = shared.Role
-
-// Direction to order DNS records in.
-//
-// This is an alias to an internal type.
-type SortDirection = shared.SortDirection
-
-// This is an alias to an internal value.
-const SortDirectionAsc = shared.SortDirectionAsc
-
-// This is an alias to an internal value.
-const SortDirectionDesc = shared.SortDirectionDesc
-
-// This is an alias to an internal type.
-type Subscription = shared.Subscription
-
-// How often the subscription is renewed automatically.
-//
-// This is an alias to an internal type.
-type SubscriptionFrequency = shared.SubscriptionFrequency
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
-
-// This is an alias to an internal value.
-const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
-
-// The state that the subscription is in.
-//
-// This is an alias to an internal type.
-type SubscriptionState = shared.SubscriptionState
-
-// This is an alias to an internal value.
-const SubscriptionStateTrial = shared.SubscriptionStateTrial
-
-// This is an alias to an internal value.
-const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
-
-// This is an alias to an internal value.
-const SubscriptionStatePaid = shared.SubscriptionStatePaid
-
-// This is an alias to an internal value.
-const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
-
-// This is an alias to an internal value.
-const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
-
-// This is an alias to an internal value.
-const SubscriptionStateFailed = shared.SubscriptionStateFailed
-
-// This is an alias to an internal value.
-const SubscriptionStateExpired = shared.SubscriptionStateExpired
-
-// This is an alias to an internal type.
-type SubscriptionParam = shared.SubscriptionParam
diff --git a/plans/plan.go b/zones/plan.go
similarity index 99%
rename from plans/plan.go
rename to zones/plan.go
index 018c742fa..3ec3b0027 100644
--- a/plans/plan.go
+++ b/zones/plan.go
@@ -1,6 +1,6 @@
 // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 
-package plans
+package zones
 
 import (
 	"context"
diff --git a/rate_plans/rateplan.go b/zones/rateplan.go
similarity index 67%
rename from rate_plans/rateplan.go
rename to zones/rateplan.go
index 962eda83e..7e32b6543 100644
--- a/rate_plans/rateplan.go
+++ b/zones/rateplan.go
@@ -1,6 +1,6 @@
 // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 
-package rate_plans
+package zones
 
 import (
 	"context"
@@ -35,7 +35,7 @@ func NewRatePlanService(opts ...option.RequestOption) (r *RatePlanService) {
 }
 
 // Lists all rate plans the zone can subscribe to.
-func (r *RatePlanService) Get(ctx context.Context, query RatePlanGetParams, opts ...option.RequestOption) (res *[]RatePlan, err error) {
+func (r *RatePlanService) Get(ctx context.Context, query RatePlanGetParams, opts ...option.RequestOption) (res *[]RatePlanGetResponse, err error) {
 	var env RatePlanGetResponseEnvelope
 	opts = append(r.Options[:], opts...)
 	if query.ZoneID.Value == "" {
@@ -51,24 +51,25 @@ func (r *RatePlanService) Get(ctx context.Context, query RatePlanGetParams, opts
 	return
 }
 
-type RatePlan struct {
+type RatePlanGetResponse struct {
 	// Plan identifier tag.
 	ID string `json:"id"`
 	// Array of available components values for the plan.
-	Components []RatePlanComponent `json:"components"`
+	Components []RatePlanGetResponseComponent `json:"components"`
 	// The monetary unit in which pricing information is displayed.
 	Currency string `json:"currency"`
 	// The duration of the plan subscription.
 	Duration float64 `json:"duration"`
 	// The frequency at which you will be billed for this plan.
-	Frequency RatePlanFrequency `json:"frequency"`
+	Frequency RatePlanGetResponseFrequency `json:"frequency"`
 	// The plan name.
-	Name string       `json:"name"`
-	JSON ratePlanJSON `json:"-"`
+	Name string                  `json:"name"`
+	JSON ratePlanGetResponseJSON `json:"-"`
 }
 
-// ratePlanJSON contains the JSON metadata for the struct [RatePlan]
-type ratePlanJSON struct {
+// ratePlanGetResponseJSON contains the JSON metadata for the struct
+// [RatePlanGetResponse]
+type ratePlanGetResponseJSON struct {
 	ID          apijson.Field
 	Components  apijson.Field
 	Currency    apijson.Field
@@ -79,27 +80,27 @@ type ratePlanJSON struct {
 	ExtraFields map[string]apijson.Field
 }
 
-func (r *RatePlan) UnmarshalJSON(data []byte) (err error) {
+func (r *RatePlanGetResponse) UnmarshalJSON(data []byte) (err error) {
 	return apijson.UnmarshalRoot(data, r)
 }
 
-func (r ratePlanJSON) RawJSON() string {
+func (r ratePlanGetResponseJSON) RawJSON() string {
 	return r.raw
 }
 
-type RatePlanComponent struct {
+type RatePlanGetResponseComponent struct {
 	// The default amount allocated.
 	Default float64 `json:"default"`
 	// The unique component.
-	Name RatePlanComponentsName `json:"name"`
+	Name RatePlanGetResponseComponentsName `json:"name"`
 	// The unit price of the addon.
-	UnitPrice float64               `json:"unit_price"`
-	JSON      ratePlanComponentJSON `json:"-"`
+	UnitPrice float64                          `json:"unit_price"`
+	JSON      ratePlanGetResponseComponentJSON `json:"-"`
 }
 
-// ratePlanComponentJSON contains the JSON metadata for the struct
-// [RatePlanComponent]
-type ratePlanComponentJSON struct {
+// ratePlanGetResponseComponentJSON contains the JSON metadata for the struct
+// [RatePlanGetResponseComponent]
+type ratePlanGetResponseComponentJSON struct {
 	Default     apijson.Field
 	Name        apijson.Field
 	UnitPrice   apijson.Field
@@ -107,45 +108,45 @@ type ratePlanComponentJSON struct {
 	ExtraFields map[string]apijson.Field
 }
 
-func (r *RatePlanComponent) UnmarshalJSON(data []byte) (err error) {
+func (r *RatePlanGetResponseComponent) UnmarshalJSON(data []byte) (err error) {
 	return apijson.UnmarshalRoot(data, r)
 }
 
-func (r ratePlanComponentJSON) RawJSON() string {
+func (r ratePlanGetResponseComponentJSON) RawJSON() string {
 	return r.raw
 }
 
 // The unique component.
-type RatePlanComponentsName string
+type RatePlanGetResponseComponentsName string
 
 const (
-	RatePlanComponentsNameZones                       RatePlanComponentsName = "zones"
-	RatePlanComponentsNamePageRules                   RatePlanComponentsName = "page_rules"
-	RatePlanComponentsNameDedicatedCertificates       RatePlanComponentsName = "dedicated_certificates"
-	RatePlanComponentsNameDedicatedCertificatesCustom RatePlanComponentsName = "dedicated_certificates_custom"
+	RatePlanGetResponseComponentsNameZones                       RatePlanGetResponseComponentsName = "zones"
+	RatePlanGetResponseComponentsNamePageRules                   RatePlanGetResponseComponentsName = "page_rules"
+	RatePlanGetResponseComponentsNameDedicatedCertificates       RatePlanGetResponseComponentsName = "dedicated_certificates"
+	RatePlanGetResponseComponentsNameDedicatedCertificatesCustom RatePlanGetResponseComponentsName = "dedicated_certificates_custom"
 )
 
-func (r RatePlanComponentsName) IsKnown() bool {
+func (r RatePlanGetResponseComponentsName) IsKnown() bool {
 	switch r {
-	case RatePlanComponentsNameZones, RatePlanComponentsNamePageRules, RatePlanComponentsNameDedicatedCertificates, RatePlanComponentsNameDedicatedCertificatesCustom:
+	case RatePlanGetResponseComponentsNameZones, RatePlanGetResponseComponentsNamePageRules, RatePlanGetResponseComponentsNameDedicatedCertificates, RatePlanGetResponseComponentsNameDedicatedCertificatesCustom:
 		return true
 	}
 	return false
 }
 
 // The frequency at which you will be billed for this plan.
-type RatePlanFrequency string
+type RatePlanGetResponseFrequency string
 
 const (
-	RatePlanFrequencyWeekly    RatePlanFrequency = "weekly"
-	RatePlanFrequencyMonthly   RatePlanFrequency = "monthly"
-	RatePlanFrequencyQuarterly RatePlanFrequency = "quarterly"
-	RatePlanFrequencyYearly    RatePlanFrequency = "yearly"
+	RatePlanGetResponseFrequencyWeekly    RatePlanGetResponseFrequency = "weekly"
+	RatePlanGetResponseFrequencyMonthly   RatePlanGetResponseFrequency = "monthly"
+	RatePlanGetResponseFrequencyQuarterly RatePlanGetResponseFrequency = "quarterly"
+	RatePlanGetResponseFrequencyYearly    RatePlanGetResponseFrequency = "yearly"
 )
 
-func (r RatePlanFrequency) IsKnown() bool {
+func (r RatePlanGetResponseFrequency) IsKnown() bool {
 	switch r {
-	case RatePlanFrequencyWeekly, RatePlanFrequencyMonthly, RatePlanFrequencyQuarterly, RatePlanFrequencyYearly:
+	case RatePlanGetResponseFrequencyWeekly, RatePlanGetResponseFrequencyMonthly, RatePlanGetResponseFrequencyQuarterly, RatePlanGetResponseFrequencyYearly:
 		return true
 	}
 	return false
@@ -159,7 +160,7 @@ type RatePlanGetParams struct {
 type RatePlanGetResponseEnvelope struct {
 	Errors   []shared.ResponseInfo `json:"errors,required"`
 	Messages []shared.ResponseInfo `json:"messages,required"`
-	Result   []RatePlan            `json:"result,required,nullable"`
+	Result   []RatePlanGetResponse `json:"result,required,nullable"`
 	// Whether the API call was successful
 	Success    RatePlanGetResponseEnvelopeSuccess    `json:"success,required"`
 	ResultInfo RatePlanGetResponseEnvelopeResultInfo `json:"result_info"`
diff --git a/zones/zone.go b/zones/zone.go
index 34ab71f73..292a5cfef 100644
--- a/zones/zone.go
+++ b/zones/zone.go
@@ -32,6 +32,8 @@ type ZoneService struct {
 	CustomNameservers *CustomNameserverService
 	Holds             *HoldService
 	Subscriptions     *SubscriptionService
+	Plans             *PlanService
+	RatePlans         *RatePlanService
 }
 
 // NewZoneService generates a new service that applies the given options to each
@@ -45,6 +47,8 @@ func NewZoneService(opts ...option.RequestOption) (r *ZoneService) {
 	r.CustomNameservers = NewCustomNameserverService(opts...)
 	r.Holds = NewHoldService(opts...)
 	r.Subscriptions = NewSubscriptionService(opts...)
+	r.Plans = NewPlanService(opts...)
+	r.RatePlans = NewRatePlanService(opts...)
 	return
 }
 


Test patch:
diff --git a/plans/plan_test.go b/zones/plan_test.go
similarity index 88%
rename from plans/plan_test.go
rename to zones/plan_test.go
index 01181081e..3e5575d9a 100644
--- a/plans/plan_test.go
+++ b/zones/plan_test.go
@@ -1,6 +1,6 @@
 // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 
-package plans_test
+package zones_test
 
 import (
 	"context"
@@ -11,7 +11,7 @@ import (
 	"github.com/cloudflare/cloudflare-go/v2"
 	"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
 	"github.com/cloudflare/cloudflare-go/v2/option"
-	"github.com/cloudflare/cloudflare-go/v2/plans"
+	"github.com/cloudflare/cloudflare-go/v2/zones"
 )
 
 func TestPlanList(t *testing.T) {
@@ -27,7 +27,7 @@ func TestPlanList(t *testing.T) {
 		option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
 		option.WithAPIEmail("user@example.com"),
 	)
-	_, err := client.Plans.List(context.TODO(), plans.PlanListParams{
+	_, err := client.Zones.Plans.List(context.TODO(), zones.PlanListParams{
 		ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
 	})
 	if err != nil {
@@ -52,10 +52,10 @@ func TestPlanGet(t *testing.T) {
 		option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
 		option.WithAPIEmail("user@example.com"),
 	)
-	_, err := client.Plans.Get(
+	_, err := client.Zones.Plans.Get(
 		context.TODO(),
 		"023e105f4ecef8ad9ca31a8372d0c353",
-		plans.PlanGetParams{
+		zones.PlanGetParams{
 			ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
 		},
 	)
diff --git a/rate_plans/rateplan_test.go b/zones/rateplan_test.go
similarity index 85%
rename from rate_plans/rateplan_test.go
rename to zones/rateplan_test.go
index a6e0706b6..a6e12f236 100644
--- a/rate_plans/rateplan_test.go
+++ b/zones/rateplan_test.go
@@ -1,6 +1,6 @@
 // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 
-package rate_plans_test
+package zones_test
 
 import (
 	"context"
@@ -11,7 +11,7 @@ import (
 	"github.com/cloudflare/cloudflare-go/v2"
 	"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
 	"github.com/cloudflare/cloudflare-go/v2/option"
-	"github.com/cloudflare/cloudflare-go/v2/rate_plans"
+	"github.com/cloudflare/cloudflare-go/v2/zones"
 )
 
 func TestRatePlanGet(t *testing.T) {
@@ -27,7 +27,7 @@ func TestRatePlanGet(t *testing.T) {
 		option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
 		option.WithAPIEmail("user@example.com"),
 	)
-	_, err := client.RatePlans.Get(context.TODO(), rate_plans.RatePlanGetParams{
+	_, err := client.Zones.RatePlans.Get(context.TODO(), zones.RatePlanGetParams{
 		ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
 	})
 	if err != nil {