From 592cd63fc2d135637fbb9a63d8072108e63650db Mon Sep 17 00:00:00 2001 From: tacosontitan Date: Thu, 25 Jul 2024 22:33:59 -0500 Subject: [PATCH] Defined unit preference enum. --- src/Weatherstack/UnitPreference.cs | 114 +++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 src/Weatherstack/UnitPreference.cs diff --git a/src/Weatherstack/UnitPreference.cs b/src/Weatherstack/UnitPreference.cs new file mode 100644 index 0000000..9597b76 --- /dev/null +++ b/src/Weatherstack/UnitPreference.cs @@ -0,0 +1,114 @@ +// Copyright (c) 2024 tacosontitan +// This file is part of the Weatherstack project, which is distributed under the MIT license. +// See LICENSE for more information. + +namespace Weatherstack; + +/// +/// Represents the preferred unit of measurement for the weather data. +/// +/// +/// By default, the API will return all results in metric units. Aside +/// from metric units, other common unit formats are supported as well. +/// +public enum UnitPreference +{ + /// + /// Specifies that metric units are preferred (defined as m for metric by the API). + /// + /// + /// + /// + /// Temperature + /// Celsius + /// + /// + /// Wind Speed + /// Kilometers per hour + /// + /// + /// Pressure + /// Millibars + /// + /// + /// Precipitation + /// Millimeters + /// + /// + /// Visibility + /// Kilometers + /// + /// + /// Snow Depth + /// Centimeters + /// + /// + /// + Metric = 0, + + /// + /// Specifies that imperial units are preferred (defined as s for scientific by the API). + /// + /// + /// + /// + /// Temperature + /// Kelvin + /// + /// + /// Wind Speed + /// Kilometers per hour + /// + /// + /// Pressure + /// Millibars + /// + /// + /// Precipitation + /// Millimeters + /// + /// + /// Visibility + /// Kilometers + /// + /// + /// Snow Depth + /// Centimeters + /// + /// + /// + Scientific = 1, + + /// + /// Specifies that imperial units are preferred (defined as f for Fahrenheit by the API). + /// + /// + /// + /// + /// Temperature + /// Fahrenheit + /// + /// + /// Wind Speed + /// Miles per hour + /// + /// + /// Pressure + /// Millibars + /// + /// + /// Precipitation + /// Inches + /// + /// + /// Visibility + /// Miles + /// + /// + /// Snow Depth + /// Inches + /// + /// + /// + Imperial = 2 +}