-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 tacosontitan | ||
// This file is part of the Weatherstack project, which is distributed under the MIT license. | ||
// See LICENSE for more information. | ||
|
||
using System.Net.Http; | ||
|
||
using Weatherstack.Net; | ||
|
||
namespace Weatherstack.Locations; | ||
|
||
/// <summary> | ||
/// Defines the | ||
/// <see href="https://weatherstack.com/documentation#location_lookup"> | ||
/// location lookup | ||
/// </see> | ||
/// endpoint for the Weatherstack API. | ||
/// </summary> | ||
internal sealed class LocationLookupEndpoint() | ||
Check failure on line 18 in src/Weatherstack/Locations/LocationLookupEndpoint.cs GitHub Actions / build
Check failure on line 18 in src/Weatherstack/Locations/LocationLookupEndpoint.cs GitHub Actions / build
Check failure on line 18 in src/Weatherstack/Locations/LocationLookupEndpoint.cs GitHub Actions / build
Check failure on line 18 in src/Weatherstack/Locations/LocationLookupEndpoint.cs GitHub Actions / build
Check failure on line 18 in src/Weatherstack/Locations/LocationLookupEndpoint.cs GitHub Actions / build
Check failure on line 18 in src/Weatherstack/Locations/LocationLookupEndpoint.cs GitHub Actions / build
|
||
: ApiEndpoint( | ||
method: HttpMethod.Get, | ||
url: "https://api.weatherstack.com/autocomplete"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2024 tacosontitan | ||
// This file is part of the Weatherstack project, which is distributed under the MIT license. | ||
// See LICENSE for more information. | ||
|
||
using System.Text.Json.Serialization; | ||
|
||
using Weatherstack.Net; | ||
|
||
namespace Weatherstack.Locations; | ||
|
||
/// <summary> | ||
/// Represents a location lookup request within the Weatherstack API. | ||
/// </summary> | ||
public sealed class LocationLookupRequest | ||
: ApiRequest | ||
{ | ||
/// <summary> | ||
/// Gets or sets number of results returned. | ||
/// </summary> | ||
[JsonPropertyName("results")] | ||
public int? ResultCount { get; set; } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2024 tacosontitan | ||
// This file is part of the Weatherstack project, which is distributed under the MIT license. | ||
// See LICENSE for more information. | ||
|
||
using System.Collections.ObjectModel; | ||
using System.Text.Json.Serialization; | ||
|
||
using Weatherstack.Net; | ||
|
||
namespace Weatherstack.Locations; | ||
|
||
/// <summary> | ||
/// Represents the response to be received from the | ||
/// <see href="https://weatherstack.com/documentation#location_lookup"> | ||
/// location lookup | ||
/// </see> | ||
/// endpoint of the Weatherstack API. | ||
/// </summary> | ||
public sealed class LocationLookupResponse | ||
: ApiResponse<LocationLookupRequest> | ||
{ | ||
/// <summary> | ||
/// Gets or sets the locations returned by the request. | ||
/// </summary> | ||
[JsonPropertyName("locations")] | ||
public ReadOnlyCollection<Location>? Locations { get; set; } | ||
} |