コード例 #1
0
ファイル: RestApiClient.cs プロジェクト: ktos/Airly.Net
 public async Task <Measurement> GetMeasurmentByLocationIdAsync(int locationId, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     ParamsValidator.ThrowIfNegativeNumber(locationId);
     return(await Api.Request <Measurement>(end : "measurements/location", "GET", new
     {
         locationId,
         includeWind,
         type = ResolveIndexType(type)
     }));
 }
コード例 #2
0
ファイル: RestApiClient.cs プロジェクト: ktos/Airly.Net
 public async Task <Measurement> GetMeasurmentNearestAsync(double lat, double lng, double maxDistance = 3, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     return(await Api.Request <Measurement>("measurements/nearest", "GET", new
     {
         lat,
         lng,
         maxDistanceKM = ParamsValidator.InfinityToDouble(maxDistance),
         indexType = ResolveIndexType(type)
     }));
 }
コード例 #3
0
ファイル: RestApiClient.cs プロジェクト: ktos/Airly.Net
 public async Task <Measurement> GetMeasurmentByPointAsync(double lat, double lng, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     return(await Api.Request <Measurement>("measurements/point", "GET", new
     {
         lat,
         lng,
         indexType = ResolveIndexType(type)
     }));
 }
コード例 #4
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Getting the measurment by the location id from installation. Remember that the location id is nullable property
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Location(Installation installation, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) =>
 installation == null || installation.LocationId == null
         ? null
         : await Location((int)installation.LocationId, includeWind, type);
コード例 #5
0
ファイル: RestApiClient.cs プロジェクト: ktos/Airly.Net
 public async Task <Measurement> GetMeasurmentByInstallationAsync(int id, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     ParamsValidator.ThrowIfNegativeNumber(id);
     return(await Api.Request <Measurement>("measurements/installation", "GET", new
     {
         installationId = id,
         includeWind,
         indexType = ResolveIndexType(type)
     }));
 }
コード例 #6
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Getting the installation pinned measurment.
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Installation(Installation installation, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) => installation != null ? await Installation(installation.Id, includeWind, type) : null;
コード例 #7
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Use this to get the measurment's by the locationId.
 /// </summary>
 /// <param name="locationId">Location ID</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Location(int locationId, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentByLocationIdAsync(locationId, includeWind, type);
コード例 #8
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 private async Task <Measurement> Point(double lat, double lng, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentByPointAsync(lat, lng, type);
コード例 #9
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Use this when you need to get the informations about installation by ID
 /// </summary>
 /// <param name="id">ID of installation</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Installation(int id, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentByInstallationAsync(id, includeWind, type);
コード例 #10
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Getting the Point() but of the geografic Location.
 /// </summary>
 /// <param name="location">Location object</param>
 /// <param name="type">Index of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Point(Location location, IndexQueryType type       = IndexQueryType.AirlyCAQI) => await Point(location.Lat, location.Lng, type);
コード例 #11
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Use Point when you need to get the measurment from the point. Else use Nearest to get the measurment nearest the point.
 /// If no measurment found, this endpoint will return null
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Point(Installation installation, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Point(installation.Location, type);
コード例 #12
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 private async Task <Measurement> Nearest(double lat, double lng, double maxDistance = 3, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentNearestAsync(lat, lng, maxDistance, type);
コード例 #13
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Getting the nearest measurment's of the specified location.
 /// </summary>
 /// <param name="location">Location object</param>
 /// <param name="maxDistance">Max distance, deafult to 3, double</param>
 /// <param name="type">Type of the measurment index</param>
 /// <returns></returns>
 public async Task <Measurement> Nearest(Location location, double maxDistance       = 3, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Nearest(location.Lat, location.Lng, maxDistance, type);
コード例 #14
0
ファイル: Measurments.cs プロジェクト: ktos/Airly.Net
 /// <summary>
 /// Getting the nearest measurment's of the installation location.
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="maxDistance">Max distance, deafult to 3, double</param>
 /// <param name="type">Type of the measurment index</param>
 /// <returns></returns>
 public async Task <Measurement> Nearest(Installation installation, double maxDistance = 3, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Nearest(installation.Location, maxDistance, type);