Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xhore: Change get calculations from GET to POST #3557

Merged
merged 9 commits into from
Sep 18, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public partial interface IWholesaleClient_V3
/// </summary>
/// <returns>OK</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SettlementReportApplicableCalculationDto>> GetApplicableCalculationsAsync(CalculationType? calculationType = null, System.Collections.Generic.IEnumerable<string> gridAreaCodes = null, System.DateTimeOffset? periodStart = null, System.DateTimeOffset? periodEnd = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SettlementReportApplicableCalculationDto>> GetApplicableCalculationsAsync(CalculationType? calculationType = null, System.DateTimeOffset? periodStart = null, System.DateTimeOffset? periodEnd = null, System.Collections.Generic.IEnumerable<string> body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

}

Expand Down Expand Up @@ -283,15 +283,19 @@ public string BaseUrl
/// </summary>
/// <returns>OK</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SettlementReportApplicableCalculationDto>> GetApplicableCalculationsAsync(CalculationType? calculationType = null, System.Collections.Generic.IEnumerable<string> gridAreaCodes = null, System.DateTimeOffset? periodStart = null, System.DateTimeOffset? periodEnd = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SettlementReportApplicableCalculationDto>> GetApplicableCalculationsAsync(CalculationType? calculationType = null, System.DateTimeOffset? periodStart = null, System.DateTimeOffset? periodEnd = null, System.Collections.Generic.IEnumerable<string> body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

var urlBuilder_ = new System.Text.StringBuilder();
Expand All @@ -303,10 +307,6 @@ public string BaseUrl
{
urlBuilder_.Append(System.Uri.EscapeDataString("calculationType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(calculationType, System.Globalization.CultureInfo.InvariantCulture))).Append('&');
}
if (gridAreaCodes != null)
{
foreach (var item_ in gridAreaCodes) { urlBuilder_.Append(System.Uri.EscapeDataString("gridAreaCodes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); }
}
if (periodStart != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("periodStart")).Append('=').Append(System.Uri.EscapeDataString(periodStart.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
}
},
"/v3/SettlementReport": {
"get": {
"post": {
"tags": [
"SettlementReport"
],
Expand All @@ -136,23 +136,21 @@
"in": "query",
"schema": {
"description": "Defines the wholesale calculation type",
"x-enumNames": [
"BalanceFixing",
"Aggregation",
"WholesaleFixing",
"FirstCorrectionSettlement",
"SecondCorrectionSettlement",
"ThirdCorrectionSettlement"
],
"allOf": [
{
"$ref": "#/components/schemas/CalculationType"
}
]
}
},
{
"name": "gridAreaCodes",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "periodStart",
"in": "query",
Expand All @@ -170,6 +168,34 @@
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"application/*+json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -233,6 +259,18 @@
"nullable": true
},
"orchestrationState": {
"x-enumNames": [
"Scheduled",
"Calculating",
"Calculated",
"CalculationFailed",
"ActorMessagesEnqueuing",
"ActorMessagesEnqueued",
"ActorMessagesEnqueuingFailed",
"Completed",
"Canceled",
"Started"
],
"allOf": [
{
"$ref": "#/components/schemas/CalculationOrchestrationState"
Expand All @@ -250,6 +288,14 @@
},
"calculationType": {
"description": "Defines the wholesale calculation type",
"x-enumNames": [
"BalanceFixing",
"Aggregation",
"WholesaleFixing",
"FirstCorrectionSettlement",
"SecondCorrectionSettlement",
"ThirdCorrectionSettlement"
],
"allOf": [
{
"$ref": "#/components/schemas/CalculationType"
Expand All @@ -272,6 +318,18 @@
},
"CalculationOrchestrationState": {
"type": "string",
"x-enumNames": [
"Scheduled",
"Calculating",
"Calculated",
"CalculationFailed",
"ActorMessagesEnqueuing",
"ActorMessagesEnqueued",
"ActorMessagesEnqueuingFailed",
"Completed",
"Canceled",
"Started"
],
"enum": [
"Scheduled",
"Calculating",
Expand All @@ -287,6 +345,12 @@
},
"CalculationState": {
"type": "string",
"x-enumNames": [
"Pending",
"Executing",
"Completed",
"Failed"
],
"enum": [
"Pending",
"Executing",
Expand All @@ -297,6 +361,14 @@
"CalculationType": {
"type": "string",
"description": "Defines the wholesale calculation type",
"x-enumNames": [
"BalanceFixing",
"Aggregation",
"WholesaleFixing",
"FirstCorrectionSettlement",
"SecondCorrectionSettlement",
"ThirdCorrectionSettlement"
],
"enum": [
"BalanceFixing",
"Aggregation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public async Task<Dictionary<string, List<RequestSettlementReportGridAreaCalcula
var gridAreaCalculations = new Dictionary<string, List<RequestSettlementReportGridAreaCalculation>>();
var calculations = await client.GetApplicableCalculationsAsync(
calculationType,
gridAreaId,
calculationPeriod.Start.ToDateTimeOffset(),
calculationPeriod.End.ToDateTimeOffset());
calculationPeriod.End.ToDateTimeOffset(),
gridAreaId);

foreach (var calculation in calculations)
{
Expand Down
Loading