Skip to content

Commit 85c82fa

Browse files
authored
Revert "CI: Update generated SDK for dev on 2025-10-22 (#171)" (#172)
This reverts commit a59b99e.
1 parent a59b99e commit 85c82fa

File tree

10 files changed

+26
-585
lines changed

10 files changed

+26
-585
lines changed

src/Solcast/Clients/AggregationClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public async Task<ApiResponse<LiveAggregationResponse>> GetLiveAggregations(
9494
}
9595
}
9696
/// <summary>
97-
/// Get forecast aggregation data for up to 14 days of data at a time for a requested collection or aggregation.
97+
/// Get forecast aggregation data for up to 7 days of data at a time for a requested collection or aggregation.
9898
/// </summary>
9999
/// <param name="outputParameters">The output parameters to include in the response.</param>
100100
/// <param name="collectionId">Unique identifier for your collection.</param>

src/Solcast/Clients/ForecastClient.cs

Lines changed: 13 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public ForecastClient()
3030
/// <param name="applyTrackerInactive">Indicating if trackers are inactive. If True, panels are assumed all facing up (i.e. zero rotation). Only has effect if your site has a tracking_type that is not “fixed”.</param>
3131
/// <param name="terrainShading">If true, irradiance parameters are modified based on the surrounding terrain from a 90m-horizontal-resolution digital elevation model. The direct component of irradiance is set to zero when the beam from the sun is blocked by the terrain. The diffuse component of irradiance is reduced throughout the day if the sky view at the location is significantly reduced by the surrounding terrain. Global irradiance incorporates both effects.</param>
3232
/// <param name="format">Response format</param>
33-
public async Task<ApiResponse<ForecastsDataResponse>> GetForecastAdvancedPvPower(
33+
public async Task<ApiResponse<ForecastResponse>> GetForecastAdvancedPvPower(
3434
string resourceId,
3535
int? hours = null,
3636
List<string> outputParameters = null,
@@ -80,10 +80,10 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastAdvancedPvPower
8080

8181
if (parameters.ContainsKey("format") && parameters["format"] == "json")
8282
{
83-
var data = JsonConvert.DeserializeObject<ForecastsDataResponse>(rawContent);
84-
return new ApiResponse<ForecastsDataResponse>(data, rawContent);
83+
var data = JsonConvert.DeserializeObject<ForecastResponse>(rawContent);
84+
return new ApiResponse<ForecastResponse>(data, rawContent);
8585
}
86-
return new ApiResponse<ForecastsDataResponse>(null, rawContent);
86+
return new ApiResponse<ForecastResponse>(null, rawContent);
8787
}
8888
catch (UnauthorizedApiKeyException)
8989
{
@@ -109,7 +109,7 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastAdvancedPvPower
109109
}
110110
}
111111
/// <summary>
112-
/// Get forecast aggregation data for up to 14 days of data at a time for a requested collection or aggregation.
112+
/// Get forecast aggregation data for up to 7 days of data at a time for a requested collection or aggregation.
113113
/// </summary>
114114
/// <param name="outputParameters">The output parameters to include in the response.</param>
115115
/// <param name="collectionId">Unique identifier for your collection.</param>
@@ -206,7 +206,7 @@ public async Task<ApiResponse<ForecastAggregationResponse>> GetForecastAggregati
206206
/// <param name="outputParameters">The output parameters to include in the response.</param>
207207
/// <param name="terrainShading">If true, irradiance parameters are modified based on the surrounding terrain from a 90m-horizontal-resolution digital elevation model. The direct component of irradiance is set to zero when the beam from the sun is blocked by the terrain. The diffuse component of irradiance is reduced throughout the day if the sky view at the location is significantly reduced by the surrounding terrain. Global irradiance incorporates both effects.</param>
208208
/// <param name="format">Response format</param>
209-
public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRooftopPvPower(
209+
public async Task<ApiResponse<ForecastResponse>> GetForecastRooftopPvPower(
210210
double? latitude,
211211
double? longitude,
212212
float? capacity,
@@ -258,10 +258,10 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRooftopPvPower(
258258

259259
if (parameters.ContainsKey("format") && parameters["format"] == "json")
260260
{
261-
var data = JsonConvert.DeserializeObject<ForecastsDataResponse>(rawContent);
262-
return new ApiResponse<ForecastsDataResponse>(data, rawContent);
261+
var data = JsonConvert.DeserializeObject<ForecastResponse>(rawContent);
262+
return new ApiResponse<ForecastResponse>(data, rawContent);
263263
}
264-
return new ApiResponse<ForecastsDataResponse>(null, rawContent);
264+
return new ApiResponse<ForecastResponse>(null, rawContent);
265265
}
266266
catch (UnauthorizedApiKeyException)
267267
{
@@ -299,7 +299,7 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRooftopPvPower(
299299
/// <param name="latitude">The latitude of the location you request data for. Must be a decimal number between -90 and 90.</param>
300300
/// <param name="longitude">The longitude of the location you request data for. Must be a decimal number between -180 and 180.</param>
301301
/// <param name="format">Response format</param>
302-
public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRadiationAndWeather(
302+
public async Task<ApiResponse<ForecastResponse>> GetForecastRadiationAndWeather(
303303
double? latitude,
304304
double? longitude,
305305
int? hours = null,
@@ -347,10 +347,10 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRadiationAndWea
347347

348348
if (parameters.ContainsKey("format") && parameters["format"] == "json")
349349
{
350-
var data = JsonConvert.DeserializeObject<ForecastsDataResponse>(rawContent);
351-
return new ApiResponse<ForecastsDataResponse>(data, rawContent);
350+
var data = JsonConvert.DeserializeObject<ForecastResponse>(rawContent);
351+
return new ApiResponse<ForecastResponse>(data, rawContent);
352352
}
353-
return new ApiResponse<ForecastsDataResponse>(null, rawContent);
353+
return new ApiResponse<ForecastResponse>(null, rawContent);
354354
}
355355
catch (UnauthorizedApiKeyException)
356356
{
@@ -372,98 +372,6 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRadiationAndWea
372372
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "tilt=" + tilt + ", " + "azimuth=" + azimuth + ", " + "arrayType=" + arrayType + ", " + "outputParameters=" + outputParameters + ", " + "terrainShading=" + terrainShading + ", " + "format=" + format;
373373
throw new Exception($@"Unhandled error in GetForecastRadiationAndWeather
374374
Parameters: {paramDetails}
375-
Error: {ex.Message}", ex);
376-
}
377-
}
378-
/// <param name="latitude">The latitude of the location you request data for. Must be a decimal number between -90 and 90.</param>
379-
/// <param name="longitude">The longitude of the location you request data for. Must be a decimal number between -180 and 180.</param>
380-
/// <param name="timeZone">Timezone to return in data set. Accepted values are utc, longitudinal, or a range from -13 to 13 in 0.25 hour increments for utc offset.</param>
381-
/// <param name="hours">The number of hours to return in the response.</param>
382-
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
383-
/// <param name="cleaningThreshold">Amount of daily rainfall required to clean the panels (mm)</param>
384-
/// <param name="soilingLossRate">Percentage of energy lost due to one day of soiling.</param>
385-
/// <param name="gracePeriod">Number of days after a rainfall event when it’s assumed the ground is damp, and so it’s assumed there is no soiling.</param>
386-
/// <param name="maxSoiling">Maximum percentage of energy lost due to soiling. Soiling will build up until this value.</param>
387-
/// <param name="initialSoiling">Initial percentage of energy lost due to soiling at time zero in the rainfall series input.</param>
388-
/// <param name="manualWashDates">A list of ISO 8601 compliant dates or a repeating interval when manual cleaning of the panels occurred.</param>
389-
/// <param name="format">Response format</param>
390-
public async Task<ApiResponse<ForecastsDataResponse>> GetForecastKimber(
391-
double? latitude,
392-
double? longitude,
393-
string timeZone = null,
394-
int? hours = null,
395-
string period = null,
396-
double? cleaningThreshold = null,
397-
double? soilingLossRate = null,
398-
int? gracePeriod = null,
399-
double? maxSoiling = null,
400-
double? initialSoiling = null,
401-
List<string> manualWashDates = null,
402-
string format = null
403-
)
404-
{
405-
try
406-
{
407-
var parameters = new Dictionary<string, string>();
408-
parameters.Add("latitude", latitude.ToString());
409-
parameters.Add("longitude", longitude.ToString());
410-
if (timeZone != null) parameters.Add("timeZone", timeZone.ToString());
411-
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
412-
if (period != null) parameters.Add("period", period.ToString());
413-
if (cleaningThreshold.HasValue) parameters.Add("cleaningThreshold", cleaningThreshold.Value.ToString());
414-
if (soilingLossRate.HasValue) parameters.Add("soilingLossRate", soilingLossRate.Value.ToString());
415-
if (gracePeriod.HasValue) parameters.Add("gracePeriod", gracePeriod.Value.ToString());
416-
if (maxSoiling.HasValue) parameters.Add("maxSoiling", maxSoiling.Value.ToString());
417-
if (initialSoiling.HasValue) parameters.Add("initialSoiling", initialSoiling.Value.ToString());
418-
if (manualWashDates != null && manualWashDates.Any()) parameters.Add("manualWashDates", string.Join(",", manualWashDates));
419-
if (format != null) parameters.Add("format", format.ToString());
420-
421-
var queryString = string.Join("&", parameters.Select(p => $"{p.Key}={Uri.EscapeDataString(p.Value ?? string.Empty)}"));
422-
var response = await _httpClient.GetAsync(SolcastUrls.ForecastSoilingKimber + $"?{queryString}");
423-
424-
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
425-
{
426-
throw new UnauthorizedApiKeyException("The API key provided is invalid or unauthorized.");
427-
}
428-
429-
response.EnsureSuccessStatusCode();
430-
431-
var rawContent = await response.Content.ReadAsStringAsync();
432-
433-
// Verbose output - useful for MCP scenarios and debugging
434-
var verboseFlag = Environment.GetEnvironmentVariable("SOLCAST_VERBOSE_OUTPUT");
435-
if (verboseFlag?.Equals("true", StringComparison.OrdinalIgnoreCase) == true)
436-
{
437-
Console.Error.WriteLine("[Solcast] Raw Response: " + rawContent);
438-
}
439-
440-
if (parameters.ContainsKey("format") && parameters["format"] == "json")
441-
{
442-
var data = JsonConvert.DeserializeObject<ForecastsDataResponse>(rawContent);
443-
return new ApiResponse<ForecastsDataResponse>(data, rawContent);
444-
}
445-
return new ApiResponse<ForecastsDataResponse>(null, rawContent);
446-
}
447-
catch (UnauthorizedApiKeyException)
448-
{
449-
throw;
450-
}
451-
catch (HttpRequestException httpEx)
452-
{
453-
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "timeZone=" + timeZone + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "soilingLossRate=" + soilingLossRate + ", " + "gracePeriod=" + gracePeriod + ", " + "maxSoiling=" + maxSoiling + ", " + "initialSoiling=" + initialSoiling + ", " + "manualWashDates=" + manualWashDates + ", " + "format=" + format;
454-
var status = httpEx.StatusCode.HasValue ? ((int)httpEx.StatusCode).ToString() : "unknown";
455-
var content = httpEx.Data.Contains("Content") ? httpEx.Data["Content"] : "no content";
456-
throw new Exception($@"HTTP error in GetForecastKimber
457-
Parameters: {paramDetails}
458-
Status Code: {status}
459-
Content: {content}
460-
Error: {httpEx.Message}", httpEx);
461-
}
462-
catch (Exception ex)
463-
{
464-
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "timeZone=" + timeZone + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "soilingLossRate=" + soilingLossRate + ", " + "gracePeriod=" + gracePeriod + ", " + "maxSoiling=" + maxSoiling + ", " + "initialSoiling=" + initialSoiling + ", " + "manualWashDates=" + manualWashDates + ", " + "format=" + format;
465-
throw new Exception($@"Unhandled error in GetForecastKimber
466-
Parameters: {paramDetails}
467375
Error: {ex.Message}", ex);
468376
}
469377
} }

0 commit comments

Comments
 (0)