hetznercloud 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06a4e896b46519c4a0958035850492707d7daa2d1a31e47fea371b6a41c227d6
4
- data.tar.gz: fba0bd660575d033ad085695bd973bdf5f322b74fd42e50b404e4948cd140020
3
+ metadata.gz: c90b55b1202ba500b10d67653c2c0bf7d4af7b2045f257a58d973da7d73501db
4
+ data.tar.gz: f752ab64cb5d2208aed1cae8d5312aafee5314a54d27929e67f38978439d7b36
5
5
  SHA512:
6
- metadata.gz: f6eb5ee3785442e6306114ed9d2dd9493c21101042f42d96f8160ece9daadaad207e9f0f97194252a71fece6e80df9816f8d4837b2dd1353156f8b607aec2cf9
7
- data.tar.gz: f915b96269c8f87357ee9ae76b45d43700a6bda2ad95206e7306afaae56391d1aa840151d450cdd6b5c29f48c4a4e982912fcb70524b21b14c25f79b09b7ea7d
6
+ metadata.gz: 99a1bd26d8f9e2f4f0c4bfffdc3f01233cd5e3616594c15144a3c3f6ee3f268f6fd47c18c57a8073118d8630832d15ace0c89c8af355a31602eb7d78221ce6c9
7
+ data.tar.gz: 9db2511d57761816e5a02051f0c9e3ab817074056c05ce33d079ad0dfb34173da239f97cf14342dd9c8986ce65770b621c2568d762ef8647d8dc1335b573ca80
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## HCloud v2.1.0 (2024-07-28)
4
+
5
+ - Add `included_traffic` attribute to `ServerType#prices` and `LoadBalancerType#prices`
6
+ - Add `price_per_tb_traffic` attribute to `ServerType#prices` and `LoadBalancerType#prices`
7
+ - Add deprecation warning for `Pricing#traffic`
8
+ - Add deprecation warning for `ServerType#included_traffic`
9
+ - Fix crash on prices when using `Pricing` API
10
+
3
11
  ## HCloud v2.0.0 (2024-01-10)
4
12
 
5
13
  - Remove `deprecated` attribute from `ISO`
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # HCloud
2
2
 
3
- ![Continuous Integration](https://github.com/floriandejonckheere/hcloud/workflows/Continuous%20Integration/badge.svg)
3
+ ![Continuous Integration](https://github.com/floriandejonckheere/hcloud/actions/workflows/ci.yml/badge.svg)
4
4
  ![Release](https://img.shields.io/github/v/release/floriandejonckheere/hcloud?label=Latest%20release)
5
5
 
6
6
  Unofficial Ruby integration with the [Hetzner Cloud API](https://docs.hetzner.cloud/).
@@ -3,6 +3,6 @@
3
3
  module HCloud
4
4
  class FloatingIPPrices < Entity
5
5
  attribute :type
6
- attribute :prices, :price
6
+ attribute :prices, :price, array: true, default: -> { [] }
7
7
  end
8
8
  end
@@ -2,8 +2,10 @@
2
2
 
3
3
  module HCloud
4
4
  class Price < Entity
5
+ attribute :included_traffic, :integer
5
6
  attribute :location
6
7
  attribute :price_hourly, :amount
7
8
  attribute :price_monthly, :amount
9
+ attribute :price_per_tb_traffic, :amount
8
10
  end
9
11
  end
@@ -3,6 +3,6 @@
3
3
  module HCloud
4
4
  class PrimaryIPPrices < Entity
5
5
  attribute :type
6
- attribute :prices, :price
6
+ attribute :prices, :price, array: true, default: -> { [] }
7
7
  end
8
8
  end
@@ -30,6 +30,16 @@ module HCloud
30
30
  id && id == other.id
31
31
  end
32
32
 
33
+ def self.attribute(name, *args, deprecated: false, **kwargs)
34
+ super(name, *args, **kwargs)
35
+
36
+ define_method(name) do |**params|
37
+ warn "[DEPRECATION] Field \"#{name}\" on #{self.class.name} is deprecated." if deprecated
38
+
39
+ super(**params)
40
+ end
41
+ end
42
+
33
43
  def self.resource_name
34
44
  name.demodulize.underscore
35
45
  end
@@ -27,7 +27,7 @@ module HCloud
27
27
 
28
28
  attribute :server_types, :server_type_price, array: true, default: -> { [] }
29
29
 
30
- attribute :traffic, :traffic_price
30
+ attribute :traffic, :traffic_price, deprecated: true
31
31
 
32
32
  attribute :vat_rate
33
33
 
@@ -30,21 +30,19 @@ module HCloud
30
30
  attribute :cores, :integer
31
31
  attribute :disk, :integer
32
32
  attribute :memory, :integer
33
- attribute :included_traffic, :integer
33
+
34
+ # FIXME: Attribute will return null on 2024-08-05
35
+ # FIXME: Attribute will be removed on 2024-11-05
36
+ attribute :included_traffic, :integer, deprecated: true
34
37
 
35
38
  attribute :cpu_type
36
39
  attribute :storage_type
37
40
 
38
41
  attribute :prices, :price, array: true, default: -> { [] }
39
42
 
40
- attribute :deprecated, :boolean
41
43
  attribute :deprecation, :deprecation
42
44
 
43
- def deprecated
44
- warn "[DEPRECATION] Field \"deprecated\" on server types is deprecated."
45
-
46
- super
47
- end
45
+ attribute :deprecated, :boolean, deprecated: true
48
46
 
49
47
  alias deprecated? deprecated
50
48
  end
@@ -3,7 +3,7 @@
3
3
  module HCloud
4
4
  module Version
5
5
  MAJOR = 2
6
- MINOR = 0
6
+ MINOR = 1
7
7
  PATCH = 0
8
8
  PRE = nil
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hetznercloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel