Skip to content

Commit

Permalink
Merge pull request #18 from Solcast/sdk-update-prod-2024-11-01-fe226924
Browse files Browse the repository at this point in the history
SDK Update for prod on 2024-11-01
  • Loading branch information
alex-solcast authored Nov 4, 2024
2 parents 8ff6336 + f611328 commit 5f1bc01
Show file tree
Hide file tree
Showing 29 changed files with 1,475 additions and 60 deletions.
12 changes: 12 additions & 0 deletions src/Solcast/Clients/AggregationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ public AggregationClient()
{
}

/// <param name="outputParameters">The output parameters to include in the response.</param>
/// <param name="collectionId">Unique identifier for your collection.</param>
/// <param name="aggregationId">Unique identifier that belongs to the requested collection.</param>
/// <param name="hours">The number of hours to return in the response.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
/// <param name="format">Response format</param>
public async Task<ApiResponse<LiveAggregationResponse>> GetLiveAggregations(
List<string> outputParameters = null,
string collectionId = null,
Expand Down Expand Up @@ -52,6 +58,12 @@ public async Task<ApiResponse<LiveAggregationResponse>> GetLiveAggregations(
return new ApiResponse<LiveAggregationResponse>(null, rawContent);
}

/// <param name="outputParameters">The output parameters to include in the response.</param>
/// <param name="collectionId">Unique identifier for your collection.</param>
/// <param name="aggregationId">Unique identifier that belongs to the requested collection.</param>
/// <param name="hours">The number of hours to return in the response.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
/// <param name="format">Response format</param>
public async Task<ApiResponse<ForecastAggregationResponse>> GetForecastAggregations(
List<string> outputParameters = null,
string collectionId = null,
Expand Down
51 changes: 45 additions & 6 deletions src/Solcast/Clients/ForecastClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ public ForecastClient()
{
}

/// <param name="hours">The number of hours to return in the response.</param>
/// <param name="outputParameters">The output parameters to include in the response.</param>
/// <param name="resourceId">The resource id of the resource.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
/// <param name="applyAvailability">Percentage of the site’s total AC (inverter) capacity that is currently generating or expected to be generating during the forecast request period. E.g. if you specify a 50% availability, your returned power will be half of what it otherwise would be.</param>
/// <param name="applyConstraint">Constraint on site’s total AC production, applied as a cap in the same way as the metadata parameter Site Export Limit. This will constrain all Solcast power values to be no higher than the apply_constraint value you specify. If you need an unconstrained forecast, you should not use this parameter.</param>
/// <param name="applyDustSoiling">A user-override for dust_soiling_average. If you specify this parameter in your API call, we will replace the site's annual or monthly average dust soiling values with the value you specify in your API call.E.g. if you specify a 0.7 dust soiling, your returned power will be reduced by 70%.</param>
/// <param name="applySnowSoiling">A user-override for Solcast’s dynamic snow soiling, which is based on global snow cover and weather forecast data, and changes from hour to hour. If you specify this parameter in your API call (e.g. if snow clearing has just been performed), we will replace the Solcast dynamic hour to hour value with the single value you specify. E.g. if you specify a 0.7 snow soiling, your returned power will be reduced by 70%.</param>
/// <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>
/// <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>
/// <param name="format">Response format</param>
public async Task<ApiResponse<ForecastResponse>> GetAdvancedPvPower(
string resourceId,
int? hours = null,
List<string> outputParameters = null,
string period = null,
int? hours = null,
double? applyAvailability = null,
double? applyConstraint = null,
double? applyDustSoiling = null,
Expand All @@ -31,9 +42,9 @@ public async Task<ApiResponse<ForecastResponse>> GetAdvancedPvPower(
{
var parameters = new Dictionary<string, string>();
parameters.Add("resourceId", resourceId.ToString());
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (outputParameters != null && outputParameters.Any()) parameters.Add("outputParameters", string.Join(",", outputParameters));
if (period != null) parameters.Add("period", period.ToString());
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (applyAvailability.HasValue) parameters.Add("applyAvailability", applyAvailability.Value.ToString());
if (applyConstraint.HasValue) parameters.Add("applyConstraint", applyConstraint.Value.ToString());
if (applyDustSoiling.HasValue) parameters.Add("applyDustSoiling", applyDustSoiling.Value.ToString());
Expand Down Expand Up @@ -62,6 +73,12 @@ public async Task<ApiResponse<ForecastResponse>> GetAdvancedPvPower(
return new ApiResponse<ForecastResponse>(null, rawContent);
}

/// <param name="outputParameters">The output parameters to include in the response.</param>
/// <param name="collectionId">Unique identifier for your collection.</param>
/// <param name="aggregationId">Unique identifier that belongs to the requested collection.</param>
/// <param name="hours">The number of hours to return in the response.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
/// <param name="format">Response format</param>
public async Task<ApiResponse<ForecastAggregationResponse>> GetAggregations(
List<string> outputParameters = null,
string collectionId = null,
Expand Down Expand Up @@ -99,16 +116,28 @@ public async Task<ApiResponse<ForecastAggregationResponse>> GetAggregations(
return new ApiResponse<ForecastAggregationResponse>(null, rawContent);
}

/// <param name="hours">The number of hours to return in the response.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
/// <param name="latitude">The latitude of the location you request data for. Must be a decimal number between -90 and 90.</param>
/// <param name="longitude">The longitude of the location you request data for. Must be a decimal number between -180 and 180.</param>
/// <param name="capacity">The capacity of the inverter (AC) or the modules (DC), whichever is greater, in kilowatts (kW).</param>
/// <param name="tilt">The angle (degrees) that the PV system is tilted off the horizontal. A tilt of 0 means the system faces directly upwards, and 90 means the system is vertical and facing the horizon. If you don't specify tilt, we use a default tilt angle based on the latitude you specify in your request. Must be between 0 and 90.</param>
/// <param name="azimuth">The azimuth is defined as the angle (degrees) from true north that the PV system is facing. An azimuth of 0 means the system is facing true north. Positive values are anticlockwise, so azimuth is -90 for an east-facing system and 135 for a southwest-facing system. If you don't specify an azimuth, we use a default value of 0 (north facing) in the southern hemisphere and 180 (south-facing) in the northern hemisphere.</param>
/// <param name="installDate">The date (yyyy-MM-dd) of installation of the PV system. We use this to estimate your loss_factor based on the ageing of your system. If you provide us with a loss_factor directly, we will ignore this date.</param>
/// <param name="lossFactor">Default is 0.90 A factor to reduce your output forecast from the full capacity based on characteristics of the PV array or inverter. This is effectively the non-temperature loss effects on the nameplate rating of the PV system, including inefficiency and soiling. For a 1kW PV system anything that reduces 1000W/m2 solar radiation from producing 1000W of power output (assuming temperature is 25C). Valid values are between 0 and 1 (i.e. 0.6 equals 60%). If you specify 0.6 your returned power will be a maximum of 60% of AC capacity.</param>
/// <param name="outputParameters">The output parameters to include in the response.</param>
/// <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>
/// <param name="format">Response format</param>
public async Task<ApiResponse<ForecastResponse>> GetRooftopPvPower(
double? latitude,
double? longitude,
float? capacity,
int? hours = null,
string period = null,
float? tilt = null,
float? azimuth = null,
string installDate = null,
float? lossFactor = null,
int? hours = null,
List<string> outputParameters = null,
bool? terrainShading = null,
string format = null
Expand All @@ -118,12 +147,12 @@ public async Task<ApiResponse<ForecastResponse>> GetRooftopPvPower(
parameters.Add("latitude", latitude.ToString());
parameters.Add("longitude", longitude.ToString());
parameters.Add("capacity", capacity.ToString());
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (period != null) parameters.Add("period", period.ToString());
if (tilt.HasValue) parameters.Add("tilt", tilt.Value.ToString());
if (azimuth.HasValue) parameters.Add("azimuth", azimuth.Value.ToString());
if (installDate != null) parameters.Add("installDate", installDate.ToString());
if (lossFactor.HasValue) parameters.Add("lossFactor", lossFactor.Value.ToString());
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (outputParameters != null && outputParameters.Any()) parameters.Add("outputParameters", string.Join(",", outputParameters));
if (terrainShading.HasValue) parameters.Add("terrainShading", terrainShading.Value.ToString());
if (format != null) parameters.Add("format", format.ToString());
Expand All @@ -148,29 +177,39 @@ public async Task<ApiResponse<ForecastResponse>> GetRooftopPvPower(
return new ApiResponse<ForecastResponse>(null, rawContent);
}

/// <param name="hours">The number of hours to return in the response.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format.</param>
/// <param name="tilt">The angle (degrees) that the PV system is tilted off the horizontal. A tilt of 0 means the system faces directly upwards, and 90 means the system is vertical and facing the horizon. If you don't specify tilt, we use a default tilt angle based on the latitude you specify in your request. Must be between 0 and 90.</param>
/// <param name="azimuth">The azimuth is defined as the angle (degrees) from true north that the PV system is facing. An azimuth of 0 means the system is facing true north. Positive values are anticlockwise, so azimuth is -90 for an east-facing system and 135 for a southwest-facing system. If you don't specify an azimuth, we use a default value of 0 (north facing) in the southern hemisphere and 180 (south-facing) in the northern hemisphere.</param>
/// <param name="arrayType">The type of sun-tracking or geometry configuration of your site's modules.</param>
/// <param name="outputParameters">The output parameters to include in the response.</param>
/// <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>
/// <param name="latitude">The latitude of the location you request data for. Must be a decimal number between -90 and 90.</param>
/// <param name="longitude">The longitude of the location you request data for. Must be a decimal number between -180 and 180.</param>
/// <param name="format">Response format</param>
public async Task<ApiResponse<ForecastResponse>> GetRadiationAndWeather(
double? latitude,
double? longitude,
int? hours = null,
string period = null,
float? tilt = null,
float? azimuth = null,
string arrayType = null,
List<string> outputParameters = null,
bool? terrainShading = null,
int? hours = null,
string format = null
)
{
var parameters = new Dictionary<string, string>();
parameters.Add("latitude", latitude.ToString());
parameters.Add("longitude", longitude.ToString());
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (period != null) parameters.Add("period", period.ToString());
if (tilt.HasValue) parameters.Add("tilt", tilt.Value.ToString());
if (azimuth.HasValue) parameters.Add("azimuth", azimuth.Value.ToString());
if (arrayType != null) parameters.Add("arrayType", arrayType.ToString());
if (outputParameters != null && outputParameters.Any()) parameters.Add("outputParameters", string.Join(",", outputParameters));
if (terrainShading.HasValue) parameters.Add("terrainShading", terrainShading.Value.ToString());
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (format != null) parameters.Add("format", format.ToString());

var queryString = string.Join("&", parameters.Select(p => $"{p.Key}={Uri.EscapeDataString(p.Value ?? string.Empty)}"));
Expand Down
Loading

0 comments on commit 5f1bc01

Please sign in to comment.