// <auto-generated>
// DO NOT EDIT: generated by fsdgencsharp
// </auto-generated>
using System;
using System.Threading;
using System.Threading.Tasks;
using Facility.Core;
using Facility.Core.Http;

namespace OapApi.v1.Client.Http
{
	[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
	public sealed partial class HttpClientOapApiV1 : HttpClientService, IOapApiV1
	{
		/// <summary>
		/// Creates the service.
		/// </summary>
		public HttpClientOapApiV1(HttpClientServiceSettings settings = null)
			: base(settings, s_defaults)
		{
		}

		/// <summary>
		/// Gets applications for the current user.
		/// </summary>
		public Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) =>
			TrySendRequestAsync(OapApiV1HttpMapping.GetApplicationsMapping, request, cancellationToken);

		/// <summary>
		/// Creates a new application for the current user.
		/// </summary>
		public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
			TrySendRequestAsync(OapApiV1HttpMapping.CreateApplicationMapping, request, cancellationToken);

		/// <summary>
		/// Gets the specified application for the current user.
		/// </summary>
		public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default) =>
			TrySendRequestAsync(OapApiV1HttpMapping.GetApplicationMapping, request, cancellationToken);

		/// <summary>
		/// Updates the application.
		/// </summary>
		public Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
			TrySendRequestAsync(OapApiV1HttpMapping.UpdateApplicationMapping, request, cancellationToken);

		private static readonly HttpClientServiceDefaults s_defaults = new HttpClientServiceDefaults
		{
			BaseUri = new Uri("https://oaprotection.org/api/v1"),
			ContentSerializer = HttpContentSerializer.Create(SystemTextJsonServiceSerializer.Instance),
		};
	}
}
