Skip to content

Commit

Permalink
Merge branch 'master' into VIH-9901---New-Notify-template-for-LIP---3…
Browse files Browse the repository at this point in the history
…rd-email---48-hour-reminder
  • Loading branch information
marcogagliardi committed Oct 6, 2023
2 parents 5b56483 + 26406c2 commit e712351
Show file tree
Hide file tree
Showing 18 changed files with 1,156 additions and 1,145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class GetTemplateTests : AcApiTest
[TestCase(NotificationType.EJudJudgeDemoOrTest)]
[TestCase(NotificationType.TelephoneHearingConfirmation)]
[TestCase(NotificationType.TelephoneHearingConfirmationMultiDay)]
[TestCase(NotificationType.CreateStaffMember)]
[TestCase(NotificationType.HearingAmendmentStaffMember)]
[TestCase(NotificationType.HearingConfirmationStaffMember)]
[TestCase(NotificationType.HearingConfirmationStaffMemberMultiDay)]
Expand Down
42 changes: 34 additions & 8 deletions NotificationApi/NotificationApi.AcceptanceTests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,32 @@
"System.Reflection.Emit.Lightweight": "4.3.0"
}
},
"Microsoft.Extensions.Diagnostics.HealthChecks": {
"type": "Transitive",
"resolved": "6.0.8",
"contentHash": "xRbKuDnoKClu/lC3fCqF5f0UqEqVI8iYJ0RN4XpUHajvcfCWYcFC46NEzaUg2Fub7hznTG9m6XNScrVHl1iaSA==",
"dependencies": {
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.8",
"Microsoft.Extensions.Hosting.Abstractions": "6.0.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.1",
"Microsoft.Extensions.Options": "6.0.0"
}
},
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": {
"type": "Transitive",
"resolved": "6.0.8",
"contentHash": "8mNPugigemlybm8f+KcwB5FOEyJ8mZ72stKvOJJqpUFYjfTjFDKFKYB2L98gru1SaxVD9akjw8OyvtbWkAEimQ=="
},
"Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore": {
"type": "Transitive",
"resolved": "6.0.8",
"contentHash": "NfcEjGvaRyc7OjTeoCSVLlQKzSZeMb96XCuthX/Z9HbPEjXViSewyvOQPIjd6e3pQumIJgltlBRo9o6b3JQsPg==",
"dependencies": {
"Microsoft.EntityFrameworkCore.Relational": "6.0.8",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.8",
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.8"
}
},
"Microsoft.Extensions.FileProviders.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
Expand Down Expand Up @@ -844,13 +870,12 @@
},
"Microsoft.Extensions.Hosting.Abstractions": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "+k4AEn68HOJat5gj1TWa6X28WlirNQO9sPIIeQbia+91n03esEtMSSoekSTpMjUzjqtJWQN3McVx0GvSPFHF/Q==",
"resolved": "6.0.0",
"contentHash": "GcT5l2CYXL6Sa27KCSh0TixsRfADUgth+ojQSD5EkzisZxmGFh7CwzkcYuGwvmXLjr27uWRNrJ2vuuEjMhU05Q==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "2.2.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.FileProviders.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging.Abstractions": "2.2.0"
"Microsoft.Extensions.Configuration.Abstractions": "6.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.FileProviders.Abstractions": "6.0.0"
}
},
"Microsoft.Extensions.Logging": {
Expand All @@ -867,8 +892,8 @@
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA=="
"resolved": "6.0.1",
"contentHash": "dzB2Cgg+JmrouhjkcQGzSFjjvpwlq353i8oBQO2GWNjCXSzhbtBRUf28HSauWe7eib3wYOdb3tItdjRwAdwCSg=="
},
"Microsoft.Extensions.Logging.ApplicationInsights": {
"type": "Transitive",
Expand Down Expand Up @@ -2345,6 +2370,7 @@
"Microsoft.AspNetCore.JsonPatch": "[6.0.8, )",
"Microsoft.AspNetCore.Mvc.NewtonsoftJson": "[3.1.6, )",
"Microsoft.Extensions.DependencyModel": "[3.1.6, )",
"Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore": "[6.0.8, )",
"Microsoft.Extensions.Logging.ApplicationInsights": "[2.15.0, )",
"Microsoft.VisualStudio.Azure.Containers.Tools.Targets": "[1.9.10, )",
"Microsoft.VisualStudio.Web.CodeGeneration.Design": "[3.1.0, )",
Expand Down
210 changes: 0 additions & 210 deletions NotificationApi/NotificationApi.Client/NotificationApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,6 @@ namespace NotificationApi.Client
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial interface INotificationApiClient
{
/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuthAsync();

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuthAsync(System.Threading.CancellationToken cancellationToken);

/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuth2Async();

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuth2Async(System.Threading.CancellationToken cancellationToken);

/// <exception cref="NotificationApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<NotificationTemplateResponse> GetTemplateByNotificationTypeAsync(NotificationType notificationType);

Expand Down Expand Up @@ -118,186 +88,6 @@ public string BaseUrl
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuthAsync()
{
return CheckServiceHealthAuthAsync(System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuthAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/HealthCheck/health");

var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}

ProcessResponse(client_, response_);

var status_ = (int)response_.StatusCode;
if (status_ == 500)
{
var objectResponse_ = await ReadObjectResponseAsync<HealthResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new NotificationApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new NotificationApiException<HealthResponse>("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<HealthResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new NotificationApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new NotificationApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}

/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuth2Async()
{
return CheckServiceHealthAuth2Async(System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
/// <exception cref="NotificationApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<HealthResponse> CheckServiceHealthAuth2Async(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/health/liveness");

var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}

ProcessResponse(client_, response_);

var status_ = (int)response_.StatusCode;
if (status_ == 500)
{
var objectResponse_ = await ReadObjectResponseAsync<HealthResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new NotificationApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new NotificationApiException<HealthResponse>("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<HealthResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new NotificationApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new NotificationApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}

/// <exception cref="NotificationApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<NotificationTemplateResponse> GetTemplateByNotificationTypeAsync(NotificationType notificationType)
{
Expand Down

This file was deleted.

Loading

0 comments on commit e712351

Please sign in to comment.