Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deprecate pricing floating ip field #523

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hcloud/pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (

// Pricing specifies pricing information for various resources.
type Pricing struct {
Image ImagePricing
Image ImagePricing
// Deprecated: [Pricing.FloatingIP] is deprecated, use [Pricing.FloatingIPs] instead.
FloatingIP FloatingIPPricing
FloatingIPs []FloatingIPTypePricing
PrimaryIPs []PrimaryIPPricing
Expand Down
7 changes: 4 additions & 3 deletions hcloud/schema/pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package schema

// Pricing defines the schema for pricing information.
type Pricing struct {
Currency string `json:"currency"`
VATRate string `json:"vat_rate"`
Image PricingImage `json:"image"`
Currency string `json:"currency"`
VATRate string `json:"vat_rate"`
Image PricingImage `json:"image"`
// Deprecated: [Pricing.FloatingIP] is deprecated, use [Pricing.FloatingIPs] instead.
FloatingIP PricingFloatingIP `json:"floating_ip"`
FloatingIPs []PricingFloatingIPType `json:"floating_ips"`
PrimaryIPs []PricingPrimaryIP `json:"primary_ips"`
Expand Down
4 changes: 2 additions & 2 deletions hcloud/schema_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ func imagePricingFromSchema(s schema.Pricing) ImagePricing {
func floatingIPPricingFromSchema(s schema.Pricing) FloatingIPPricing {
return FloatingIPPricing{
Monthly: Price{
Net: s.FloatingIP.PriceMonthly.Net,
Gross: s.FloatingIP.PriceMonthly.Gross,
Net: s.FloatingIP.PriceMonthly.Net, // nolint:staticcheck // Field is deprecated, but removal is not planned
Gross: s.FloatingIP.PriceMonthly.Gross, // nolint:staticcheck // Field is deprecated, but removal is not planned
Currency: s.Currency,
VATRate: s.VATRate,
},
Expand Down
Loading