packages feed

hetzner 0.6.0.0 → 0.7.0.0

raw patch · 4 files changed

+25/−18 lines, 4 filesdep ~basenew-component:exe:hetzner-testPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

- Hetzner.Cloud: [serverIncludedTraffic] :: ServerType -> Int
+ Hetzner.Cloud: OpenSUSE :: OSFlavor
+ Hetzner.Cloud: [includedTraffic] :: PriceInLocation -> Int
- Hetzner.Cloud: PriceInLocation :: Text -> Maybe Price -> Price -> PriceInLocation
+ Hetzner.Cloud: PriceInLocation :: Text -> Maybe Price -> Price -> Int -> PriceInLocation
- Hetzner.Cloud: ServerType :: Architecture -> Int -> CPUType -> Bool -> Text -> Int -> ServerTypeID -> Int -> Text -> [PriceInLocation] -> StorageType -> Int -> ServerType
+ Hetzner.Cloud: ServerType :: Architecture -> Int -> CPUType -> Bool -> Text -> Int -> ServerTypeID -> Int -> Text -> [PriceInLocation] -> StorageType -> ServerType
- Hetzner.Cloud.Fingerprint: data Fingerprint
+ Hetzner.Cloud.Fingerprint: data () => Fingerprint

Files

apps/Docs.hs view
@@ -58,8 +58,6 @@           H.td $ toHtml $ Hetzner.serverCores serverType           H.td $ toHtml $ show (Hetzner.serverMemory serverType) ++ " GB"           H.td $ toHtml $ show (Hetzner.serverDisk serverType) ++ " GB"-          let terabyte = 1024 ^ (4 :: Int)-          H.td $ toHtml $ show (Hetzner.serverIncludedTraffic serverType `div` terabyte) ++ " TB"           H.td $ toHtml $ case Hetzner.serverCPUType serverType of             Hetzner.SharedCPU -> "Shared" :: String             Hetzner.DedicatedCPU -> "Dedicated"
changelog.md view
@@ -1,3 +1,10 @@+## 0.7.0.0+* base-19 and base-20 support.+* Make hetzner-test executable.+* Fix typo in documentation.+* Server type and location price API update.+* Add support for OpenSUSE OS flavor.+ ## 0.6.0.0 * Add new fields to the `Image` type: `imageArchitecture`, `imageName`. * Add [image list webpage](https://daniel-casanueva.gitlab.io/haskell/hetzner/images).
hetzner.cabal view
@@ -2,7 +2,7 @@ category: Cloud synopsis: Hetzner Cloud and DNS library. description: Hetzner Cloud and DNS library. Check the readme and documentation for more details.-version: 0.6.0.0+version: 0.7.0.0 cabal-version: 1.18 build-type: Simple author: Daniel Casanueva (daniel.casanueva `at` proton.me)@@ -31,15 +31,14 @@     , TypeApplications     , CPP   build-depends:-      base >= 4.16 && < 4.19+      base >= 4.16 && < 4.21     , text, aeson, containers, conduit     , http-conduit, bytestring, yaml, time     , country, ip, megaparsec, scientific -test-suite hetzner-test+executable hetzner-test   default-language: Haskell2010   hs-source-dirs: test-  type: exitcode-stdio-1.0   main-is: Main.hs   ghc-options: -Wall -Wunused-packages   default-extensions: ImportQualifiedPost, OverloadedStrings
src/Hetzner/Cloud.hs view
@@ -21,7 +21,7 @@ -- --   Or to get all volumes as a stream: ----- > streamPages $ getVolumes token :: ConduitT i Action m ()+-- > streamPages $ getVolumes token :: ConduitT i Volume m () -- --   If you are not interested in the streaming functionality, you --   can simply use 'streamToList' to turn the stream into a list:@@ -1250,17 +1250,20 @@ newtype ImageID = ImageID Int deriving (Eq, Ord, Show, FromJSON, ToJSON)  -- | Flavor of operative system.-data OSFlavor = Ubuntu | CentOS | Debian | Fedora | Rocky | Alma | UnknownOS deriving Show+data OSFlavor = Ubuntu | CentOS | Debian | Fedora | Rocky | Alma+              | OpenSUSE | UnknownOS+                deriving Show  instance FromJSON OSFlavor where   parseJSON = JSON.withText "OSFlavor" $ \t -> case t of-    "ubuntu"  -> pure Ubuntu-    "centos"  -> pure CentOS-    "debian"  -> pure Debian-    "fedora"  -> pure Fedora-    "rocky"   -> pure Rocky-    "alma"    -> pure Alma-    "unknown" -> pure UnknownOS+    "ubuntu"   -> pure Ubuntu+    "centos"   -> pure CentOS+    "debian"   -> pure Debian+    "fedora"   -> pure Fedora+    "rocky"    -> pure Rocky+    "alma"     -> pure Alma+    "opensuse" -> pure OpenSUSE+    "unknown"  -> pure UnknownOS     _ -> fail $ "Unknown OS flavor: " ++ Text.unpack t  -- | Image type.@@ -1664,6 +1667,8 @@   , hourlyPrice :: Maybe Price     -- | Monthly price.   , monthlyPrice :: Price+    -- | Outgoing traffic included (in bytes).+  , includedTraffic :: Int     } deriving Show  instance FromJSON PriceInLocation where@@ -1671,6 +1676,7 @@     <$> o .:  "location"     <*> o .:? "price_hourly"     <*> o .:  "price_monthly"+    <*> o .:  "included_traffic"  ---------------------------------------------------------------------------------------------------- -- Servers@@ -1939,8 +1945,6 @@   , serverTypeName :: Text   , serverPricing :: [PriceInLocation]   , serverStorageType :: StorageType-    -- | Outgoing traffic included (in bytes).-  , serverIncludedTraffic :: Int     } deriving Show  instance FromJSON ServerType where@@ -1956,7 +1960,6 @@     <*> o .: "name"     <*> o .: "prices"     <*> o .: "storage_type"-    <*> o .: "included_traffic"  -- | Get all server types. --