WIP on api stuff
This commit is contained in:
@@ -1,33 +1,33 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class ApplicationChangeSetDto : ServiceDto<ApplicationChangeSetDto>
|
public sealed partial class ApplicationChangeSetDto : ServiceDto<ApplicationChangeSetDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationChangeSetDto()
|
public ApplicationChangeSetDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(ApplicationChangeSetDto other)
|
public override bool IsEquivalentTo(ApplicationChangeSetDto other)
|
||||||
{
|
{
|
||||||
return other != null;
|
return other != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class ApplicationCreateSetDto : ServiceDto<ApplicationCreateSetDto>
|
public sealed partial class ApplicationCreateSetDto : ServiceDto<ApplicationCreateSetDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationCreateSetDto()
|
public ApplicationCreateSetDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Terms a user must accept to start an application.
|
/// Terms a user must accept to start an application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationTermsCreateSetDto Terms { get; set; }
|
public ApplicationTermsCreateSetDto Terms { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(ApplicationCreateSetDto other)
|
public override bool IsEquivalentTo(ApplicationCreateSetDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(Terms, other.Terms);
|
ServiceDataUtility.AreEquivalentDtos(Terms, other.Terms);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Validates the DTO.
|
/// Validates the DTO.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Validate(out string errorMessage)
|
public override bool Validate(out string errorMessage)
|
||||||
{
|
{
|
||||||
errorMessage = GetValidationErrorMessage();
|
errorMessage = GetValidationErrorMessage();
|
||||||
return errorMessage == null;
|
return errorMessage == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetValidationErrorMessage()
|
private string GetValidationErrorMessage()
|
||||||
{
|
{
|
||||||
if (Terms == null)
|
if (Terms == null)
|
||||||
return ServiceDataUtility.GetRequiredFieldErrorMessage("terms");
|
return ServiceDataUtility.GetRequiredFieldErrorMessage("terms");
|
||||||
|
|
||||||
string errorMessage;
|
string errorMessage;
|
||||||
if (!ServiceDataUtility.ValidateFieldValue(Terms, "terms", out errorMessage))
|
if (!ServiceDataUtility.ValidateFieldValue(Terms, "terms", out errorMessage))
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,54 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An application.
|
/// An application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class ApplicationDto : ServiceDto<ApplicationDto>
|
public sealed partial class ApplicationDto : ServiceDto<ApplicationDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationDto()
|
public ApplicationDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A unique identifier for the application.
|
/// A unique identifier for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current status of this application.
|
/// The current status of this application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationStatus? Status { get; set; }
|
public ApplicationStatus? Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Terms the user must accept to start, continue an accept an application.
|
/// Terms the user must accept to start, continue an accept an application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationTermsDto Terms { get; set; }
|
public ApplicationTermsDto Terms { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(ApplicationDto other)
|
public override bool IsEquivalentTo(ApplicationDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
Id == other.Id &&
|
Id == other.Id &&
|
||||||
Status == other.Status &&
|
Status == other.Status &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(Terms, other.Terms);
|
ServiceDataUtility.AreEquivalentDtos(Terms, other.Terms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,112 +1,112 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
[Newtonsoft.Json.JsonConverter(typeof(ApplicationStatusJsonConverter))]
|
[Newtonsoft.Json.JsonConverter(typeof(ApplicationStatusJsonConverter))]
|
||||||
[System.Text.Json.Serialization.JsonConverter(typeof(ApplicationStatusSystemTextJsonConverter))]
|
[System.Text.Json.Serialization.JsonConverter(typeof(ApplicationStatusSystemTextJsonConverter))]
|
||||||
public partial struct ApplicationStatus : IEquatable<ApplicationStatus>
|
public partial struct ApplicationStatus : IEquatable<ApplicationStatus>
|
||||||
{
|
{
|
||||||
public static readonly ApplicationStatus InProgress = new ApplicationStatus(Strings.InProgress);
|
public static readonly ApplicationStatus InProgress = new ApplicationStatus(Strings.InProgress);
|
||||||
|
|
||||||
public static readonly ApplicationStatus Submitted = new ApplicationStatus(Strings.Submitted);
|
public static readonly ApplicationStatus Submitted = new ApplicationStatus(Strings.Submitted);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationStatus(string value) => m_value = value;
|
public ApplicationStatus(string value) => m_value = value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the instance to a string.
|
/// Converts the instance to a string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override string ToString() => m_value != null && s_valueCache.TryGetValue(m_value, out var cachedValue) ? cachedValue : m_value ?? "";
|
public override string ToString() => m_value != null && s_valueCache.TryGetValue(m_value, out var cachedValue) ? cachedValue : m_value ?? "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks for equality.
|
/// Checks for equality.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Equals(ApplicationStatus other) => StringComparer.OrdinalIgnoreCase.Equals(m_value ?? "", other.m_value ?? "");
|
public bool Equals(ApplicationStatus other) => StringComparer.OrdinalIgnoreCase.Equals(m_value ?? "", other.m_value ?? "");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks for equality.
|
/// Checks for equality.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Equals(object obj) => obj is ApplicationStatus && Equals((ApplicationStatus) obj);
|
public override bool Equals(object obj) => obj is ApplicationStatus && Equals((ApplicationStatus) obj);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the hash code.
|
/// Gets the hash code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(m_value ?? "");
|
public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(m_value ?? "");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks for equality.
|
/// Checks for equality.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool operator ==(ApplicationStatus left, ApplicationStatus right) => left.Equals(right);
|
public static bool operator ==(ApplicationStatus left, ApplicationStatus right) => left.Equals(right);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks for inequality.
|
/// Checks for inequality.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool operator !=(ApplicationStatus left, ApplicationStatus right) => !left.Equals(right);
|
public static bool operator !=(ApplicationStatus left, ApplicationStatus right) => !left.Equals(right);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if the instance is equal to one of the defined values.
|
/// Returns true if the instance is equal to one of the defined values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsDefined() => m_value != null && s_valueCache.ContainsKey(m_value);
|
public bool IsDefined() => m_value != null && s_valueCache.ContainsKey(m_value);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns all of the defined values.
|
/// Returns all of the defined values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IReadOnlyList<ApplicationStatus> GetValues() => s_values;
|
public static IReadOnlyList<ApplicationStatus> GetValues() => s_values;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides string constants for defined values.
|
/// Provides string constants for defined values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Strings
|
public static class Strings
|
||||||
{
|
{
|
||||||
public const string InProgress = "InProgress";
|
public const string InProgress = "InProgress";
|
||||||
|
|
||||||
public const string Submitted = "Submitted";
|
public const string Submitted = "Submitted";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used for serialization.
|
/// Used for serialization.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class ApplicationStatusJsonConverter : ServiceEnumJsonConverter<ApplicationStatus>
|
public sealed class ApplicationStatusJsonConverter : ServiceEnumJsonConverter<ApplicationStatus>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the value from a string.
|
/// Creates the value from a string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override ApplicationStatus CreateCore(string value) => new ApplicationStatus(value);
|
protected override ApplicationStatus CreateCore(string value) => new ApplicationStatus(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used for serialization.
|
/// Used for serialization.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class ApplicationStatusSystemTextJsonConverter : ServiceEnumSystemTextJsonConverter<ApplicationStatus>
|
public sealed class ApplicationStatusSystemTextJsonConverter : ServiceEnumSystemTextJsonConverter<ApplicationStatus>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the value from a string.
|
/// Creates the value from a string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override ApplicationStatus CreateCore(string value) => new ApplicationStatus(value);
|
protected override ApplicationStatus CreateCore(string value) => new ApplicationStatus(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly ReadOnlyCollection<ApplicationStatus> s_values = new ReadOnlyCollection<ApplicationStatus>(
|
private static readonly ReadOnlyCollection<ApplicationStatus> s_values = new ReadOnlyCollection<ApplicationStatus>(
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
InProgress,
|
InProgress,
|
||||||
Submitted,
|
Submitted,
|
||||||
});
|
});
|
||||||
|
|
||||||
private static readonly IReadOnlyDictionary<string, string> s_valueCache = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly IReadOnlyDictionary<string, string> s_valueCache = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
{ Strings.InProgress, Strings.InProgress },
|
{ Strings.InProgress, Strings.InProgress },
|
||||||
{ Strings.Submitted, Strings.Submitted },
|
{ Strings.Submitted, Strings.Submitted },
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly string m_value;
|
private readonly string m_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class ApplicationTermsCreateSetDto : ServiceDto<ApplicationTermsCreateSetDto>
|
public sealed partial class ApplicationTermsCreateSetDto : ServiceDto<ApplicationTermsCreateSetDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationTermsCreateSetDto()
|
public ApplicationTermsCreateSetDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool? HasReadInstructions { get; set; }
|
public bool? HasReadInstructions { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(ApplicationTermsCreateSetDto other)
|
public override bool IsEquivalentTo(ApplicationTermsCreateSetDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
HasReadInstructions == other.HasReadInstructions;
|
HasReadInstructions == other.HasReadInstructions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Validates the DTO.
|
/// Validates the DTO.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Validate(out string errorMessage)
|
public override bool Validate(out string errorMessage)
|
||||||
{
|
{
|
||||||
errorMessage = GetValidationErrorMessage();
|
errorMessage = GetValidationErrorMessage();
|
||||||
return errorMessage == null;
|
return errorMessage == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetValidationErrorMessage()
|
private string GetValidationErrorMessage()
|
||||||
{
|
{
|
||||||
if (HasReadInstructions == null)
|
if (HasReadInstructions == null)
|
||||||
return ServiceDataUtility.GetRequiredFieldErrorMessage("hasReadInstructions");
|
return ServiceDataUtility.GetRequiredFieldErrorMessage("hasReadInstructions");
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class ApplicationTermsDto : ServiceDto<ApplicationTermsDto>
|
public sealed partial class ApplicationTermsDto : ServiceDto<ApplicationTermsDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationTermsDto()
|
public ApplicationTermsDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool? HasReadInstructions { get; set; }
|
public bool? HasReadInstructions { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(ApplicationTermsDto other)
|
public override bool IsEquivalentTo(ApplicationTermsDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
HasReadInstructions == other.HasReadInstructions;
|
HasReadInstructions == other.HasReadInstructions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Request for CreateApplication.
|
/// Request for CreateApplication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class CreateApplicationRequestDto : ServiceDto<CreateApplicationRequestDto>
|
public sealed partial class CreateApplicationRequestDto : ServiceDto<CreateApplicationRequestDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CreateApplicationRequestDto()
|
public CreateApplicationRequestDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The application to create.
|
/// The application to create.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationCreateSetDto ApplicationCreateSet { get; set; }
|
public ApplicationCreateSetDto ApplicationCreateSet { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(CreateApplicationRequestDto other)
|
public override bool IsEquivalentTo(CreateApplicationRequestDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(ApplicationCreateSet, other.ApplicationCreateSet);
|
ServiceDataUtility.AreEquivalentDtos(ApplicationCreateSet, other.ApplicationCreateSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Validates the DTO.
|
/// Validates the DTO.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Validate(out string errorMessage)
|
public override bool Validate(out string errorMessage)
|
||||||
{
|
{
|
||||||
errorMessage = GetValidationErrorMessage();
|
errorMessage = GetValidationErrorMessage();
|
||||||
return errorMessage == null;
|
return errorMessage == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetValidationErrorMessage()
|
private string GetValidationErrorMessage()
|
||||||
{
|
{
|
||||||
string errorMessage;
|
string errorMessage;
|
||||||
if (!ServiceDataUtility.ValidateFieldValue(ApplicationCreateSet, "applicationCreateSet", out errorMessage))
|
if (!ServiceDataUtility.ValidateFieldValue(ApplicationCreateSet, "applicationCreateSet", out errorMessage))
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Response for CreateApplication.
|
/// Response for CreateApplication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class CreateApplicationResponseDto : ServiceDto<CreateApplicationResponseDto>
|
public sealed partial class CreateApplicationResponseDto : ServiceDto<CreateApplicationResponseDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CreateApplicationResponseDto()
|
public CreateApplicationResponseDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The created application.
|
/// The created application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationDto Application { get; set; }
|
public ApplicationDto Application { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(CreateApplicationResponseDto other)
|
public override bool IsEquivalentTo(CreateApplicationResponseDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(Application, other.Application);
|
ServiceDataUtility.AreEquivalentDtos(Application, other.Application);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A delegating implementation of OapApiV1.
|
/// A delegating implementation of OapApiV1.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public partial class DelegatingOapApiV1 : IOapApiV1
|
public partial class DelegatingOapApiV1 : IOapApiV1
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance with the specified delegator.
|
/// Creates an instance with the specified delegator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DelegatingOapApiV1(ServiceDelegator delegator) =>
|
public DelegatingOapApiV1(ServiceDelegator delegator) =>
|
||||||
m_delegator = delegator ?? throw new ArgumentNullException(nameof(delegator));
|
m_delegator = delegator ?? throw new ArgumentNullException(nameof(delegator));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets applications for the current user.
|
/// Gets applications for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual async Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) =>
|
public virtual async Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
(await m_delegator(OapApiV1Methods.GetApplications, request, cancellationToken).ConfigureAwait(false)).Cast<GetApplicationsResponseDto>();
|
(await m_delegator(OapApiV1Methods.GetApplications, request, cancellationToken).ConfigureAwait(false)).Cast<GetApplicationsResponseDto>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new application for the current user.
|
/// Creates a new application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual async Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
public virtual async Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
(await m_delegator(OapApiV1Methods.CreateApplication, request, cancellationToken).ConfigureAwait(false)).Cast<CreateApplicationResponseDto>();
|
(await m_delegator(OapApiV1Methods.CreateApplication, request, cancellationToken).ConfigureAwait(false)).Cast<CreateApplicationResponseDto>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified application for the current user.
|
/// Gets the specified application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual async Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
public virtual async Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
(await m_delegator(OapApiV1Methods.GetApplication, request, cancellationToken).ConfigureAwait(false)).Cast<GetApplicationResponseDto>();
|
(await m_delegator(OapApiV1Methods.GetApplication, request, cancellationToken).ConfigureAwait(false)).Cast<GetApplicationResponseDto>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the application.
|
/// Updates the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual async Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
public virtual async Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
(await m_delegator(OapApiV1Methods.UpdateApplication, request, cancellationToken).ConfigureAwait(false)).Cast<UpdateApplicationResponseDto>();
|
(await m_delegator(OapApiV1Methods.UpdateApplication, request, cancellationToken).ConfigureAwait(false)).Cast<UpdateApplicationResponseDto>();
|
||||||
|
|
||||||
private readonly ServiceDelegator m_delegator;
|
private readonly ServiceDelegator m_delegator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Request for GetApplication.
|
/// Request for GetApplication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class GetApplicationRequestDto : ServiceDto<GetApplicationRequestDto>
|
public sealed partial class GetApplicationRequestDto : ServiceDto<GetApplicationRequestDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GetApplicationRequestDto()
|
public GetApplicationRequestDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The widget ID.
|
/// The widget ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(GetApplicationRequestDto other)
|
public override bool IsEquivalentTo(GetApplicationRequestDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
Id == other.Id;
|
Id == other.Id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Response for GetApplication.
|
/// Response for GetApplication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class GetApplicationResponseDto : ServiceDto<GetApplicationResponseDto>
|
public sealed partial class GetApplicationResponseDto : ServiceDto<GetApplicationResponseDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GetApplicationResponseDto()
|
public GetApplicationResponseDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The requested widget.
|
/// The requested widget.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationDto Application { get; set; }
|
public ApplicationDto Application { get; set; }
|
||||||
|
|
||||||
public string ETag { get; set; }
|
public string ETag { get; set; }
|
||||||
|
|
||||||
public bool? NotModified { get; set; }
|
public bool? NotModified { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(GetApplicationResponseDto other)
|
public override bool IsEquivalentTo(GetApplicationResponseDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(Application, other.Application) &&
|
ServiceDataUtility.AreEquivalentDtos(Application, other.Application) &&
|
||||||
ETag == other.ETag &&
|
ETag == other.ETag &&
|
||||||
NotModified == other.NotModified;
|
NotModified == other.NotModified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,54 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Request for GetApplications.
|
/// Request for GetApplications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class GetApplicationsRequestDto : ServiceDto<GetApplicationsRequestDto>
|
public sealed partial class GetApplicationsRequestDto : ServiceDto<GetApplicationsRequestDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GetApplicationsRequestDto()
|
public GetApplicationsRequestDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Filter applications by the given status.
|
/// Filter applications by the given status.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationStatus? Status { get; set; }
|
public ApplicationStatus? Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The limit of returned results.
|
/// The limit of returned results.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Limit { get; set; }
|
public int? Limit { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The token presenting the next page of applications to get.
|
/// The token presenting the next page of applications to get.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NextToken { get; set; }
|
public string NextToken { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(GetApplicationsRequestDto other)
|
public override bool IsEquivalentTo(GetApplicationsRequestDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
Status == other.Status &&
|
Status == other.Status &&
|
||||||
Limit == other.Limit &&
|
Limit == other.Limit &&
|
||||||
NextToken == other.NextToken;
|
NextToken == other.NextToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Response for GetApplications.
|
/// Response for GetApplications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class GetApplicationsResponseDto : ServiceDto<GetApplicationsResponseDto>
|
public sealed partial class GetApplicationsResponseDto : ServiceDto<GetApplicationsResponseDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GetApplicationsResponseDto()
|
public GetApplicationsResponseDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The applications.
|
/// The applications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IReadOnlyList<ApplicationDto> Applications { get; set; }
|
public IReadOnlyList<ApplicationDto> Applications { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The total number of applications.
|
/// The total number of applications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? Total { get; set; }
|
public long? Total { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The token representing the next page of results.
|
/// The token representing the next page of results.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NextToken { get; set; }
|
public string NextToken { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// True if this is the last page of results, false otherwise.
|
/// True if this is the last page of results, false otherwise.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? IsLastPage { get; set; }
|
public bool? IsLastPage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(GetApplicationsResponseDto other)
|
public override bool IsEquivalentTo(GetApplicationsResponseDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
ServiceDataUtility.AreEquivalentFieldValues(Applications, other.Applications) &&
|
ServiceDataUtility.AreEquivalentFieldValues(Applications, other.Applications) &&
|
||||||
Total == other.Total &&
|
Total == other.Total &&
|
||||||
NextToken == other.NextToken &&
|
NextToken == other.NextToken &&
|
||||||
IsLastPage == other.IsLastPage;
|
IsLastPage == other.IsLastPage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
using Facility.Core.Http;
|
using Facility.Core.Http;
|
||||||
|
|
||||||
namespace OapApi.v1.Client.Http
|
namespace OapApi.v1.Client.Http
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class HttpClientOapApiV1 : HttpClientService, IOapApiV1
|
public sealed partial class HttpClientOapApiV1 : HttpClientService, IOapApiV1
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the service.
|
/// Creates the service.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HttpClientOapApiV1(HttpClientServiceSettings settings = null)
|
public HttpClientOapApiV1(HttpClientServiceSettings settings = null)
|
||||||
: base(settings, s_defaults)
|
: base(settings, s_defaults)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets applications for the current user.
|
/// Gets applications for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) =>
|
public Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
TrySendRequestAsync(OapApiV1HttpMapping.GetApplicationsMapping, request, cancellationToken);
|
TrySendRequestAsync(OapApiV1HttpMapping.GetApplicationsMapping, request, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new application for the current user.
|
/// Creates a new application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
TrySendRequestAsync(OapApiV1HttpMapping.CreateApplicationMapping, request, cancellationToken);
|
TrySendRequestAsync(OapApiV1HttpMapping.CreateApplicationMapping, request, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified application for the current user.
|
/// Gets the specified application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
TrySendRequestAsync(OapApiV1HttpMapping.GetApplicationMapping, request, cancellationToken);
|
TrySendRequestAsync(OapApiV1HttpMapping.GetApplicationMapping, request, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the application.
|
/// Updates the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
public Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) =>
|
||||||
TrySendRequestAsync(OapApiV1HttpMapping.UpdateApplicationMapping, request, cancellationToken);
|
TrySendRequestAsync(OapApiV1HttpMapping.UpdateApplicationMapping, request, cancellationToken);
|
||||||
|
|
||||||
private static readonly HttpClientServiceDefaults s_defaults = new HttpClientServiceDefaults
|
private static readonly HttpClientServiceDefaults s_defaults = new HttpClientServiceDefaults
|
||||||
{
|
{
|
||||||
BaseUri = new Uri("https://oaprotection.org/api/v1"),
|
BaseUri = new Uri("https://oaprotection.org/api/v1"),
|
||||||
ContentSerializer = HttpContentSerializer.Create(SystemTextJsonServiceSerializer.Instance),
|
ContentSerializer = HttpContentSerializer.Create(SystemTextJsonServiceSerializer.Instance),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +1,80 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
using Facility.Core.Http;
|
using Facility.Core.Http;
|
||||||
|
|
||||||
namespace OapApi.v1.Client.Http
|
namespace OapApi.v1.Client.Http
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class OapApiV1HttpHandler : ServiceHttpHandler
|
public sealed partial class OapApiV1HttpHandler : ServiceHttpHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the handler.
|
/// Creates the handler.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public OapApiV1HttpHandler(IOapApiV1 service, ServiceHttpHandlerSettings settings = null)
|
public OapApiV1HttpHandler(IOapApiV1 service, ServiceHttpHandlerSettings settings = null)
|
||||||
: base(settings, s_defaults)
|
: base(settings, s_defaults)
|
||||||
{
|
{
|
||||||
m_service = service ?? throw new ArgumentNullException(nameof(service));
|
m_service = service ?? throw new ArgumentNullException(nameof(service));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the handler.
|
/// Creates the handler.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public OapApiV1HttpHandler(Func<HttpRequestMessage, IOapApiV1> getService, ServiceHttpHandlerSettings settings = null)
|
public OapApiV1HttpHandler(Func<HttpRequestMessage, IOapApiV1> getService, ServiceHttpHandlerSettings settings = null)
|
||||||
: base(settings, s_defaults)
|
: base(settings, s_defaults)
|
||||||
{
|
{
|
||||||
m_getService = getService ?? throw new ArgumentNullException(nameof(getService));
|
m_getService = getService ?? throw new ArgumentNullException(nameof(getService));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to handle the HTTP request.
|
/// Attempts to handle the HTTP request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override async Task<HttpResponseMessage> TryHandleHttpRequestAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default)
|
public override async Task<HttpResponseMessage> TryHandleHttpRequestAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
return await AdaptTask(TryHandleGetApplicationsAsync(httpRequest, cancellationToken)).ConfigureAwait(true) ??
|
return await AdaptTask(TryHandleGetApplicationsAsync(httpRequest, cancellationToken)).ConfigureAwait(true) ??
|
||||||
await AdaptTask(TryHandleCreateApplicationAsync(httpRequest, cancellationToken)).ConfigureAwait(true) ??
|
await AdaptTask(TryHandleCreateApplicationAsync(httpRequest, cancellationToken)).ConfigureAwait(true) ??
|
||||||
await AdaptTask(TryHandleGetApplicationAsync(httpRequest, cancellationToken)).ConfigureAwait(true) ??
|
await AdaptTask(TryHandleGetApplicationAsync(httpRequest, cancellationToken)).ConfigureAwait(true) ??
|
||||||
await AdaptTask(TryHandleUpdateApplicationAsync(httpRequest, cancellationToken)).ConfigureAwait(true);
|
await AdaptTask(TryHandleUpdateApplicationAsync(httpRequest, cancellationToken)).ConfigureAwait(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets applications for the current user.
|
/// Gets applications for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<HttpResponseMessage> TryHandleGetApplicationsAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
public Task<HttpResponseMessage> TryHandleGetApplicationsAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
||||||
TryHandleServiceMethodAsync(OapApiV1HttpMapping.GetApplicationsMapping, httpRequest, GetService(httpRequest).GetApplicationsAsync, cancellationToken);
|
TryHandleServiceMethodAsync(OapApiV1HttpMapping.GetApplicationsMapping, httpRequest, GetService(httpRequest).GetApplicationsAsync, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new application for the current user.
|
/// Creates a new application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<HttpResponseMessage> TryHandleCreateApplicationAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
public Task<HttpResponseMessage> TryHandleCreateApplicationAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
||||||
TryHandleServiceMethodAsync(OapApiV1HttpMapping.CreateApplicationMapping, httpRequest, GetService(httpRequest).CreateApplicationAsync, cancellationToken);
|
TryHandleServiceMethodAsync(OapApiV1HttpMapping.CreateApplicationMapping, httpRequest, GetService(httpRequest).CreateApplicationAsync, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified application for the current user.
|
/// Gets the specified application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<HttpResponseMessage> TryHandleGetApplicationAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
public Task<HttpResponseMessage> TryHandleGetApplicationAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
||||||
TryHandleServiceMethodAsync(OapApiV1HttpMapping.GetApplicationMapping, httpRequest, GetService(httpRequest).GetApplicationAsync, cancellationToken);
|
TryHandleServiceMethodAsync(OapApiV1HttpMapping.GetApplicationMapping, httpRequest, GetService(httpRequest).GetApplicationAsync, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the application.
|
/// Updates the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<HttpResponseMessage> TryHandleUpdateApplicationAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
public Task<HttpResponseMessage> TryHandleUpdateApplicationAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken = default) =>
|
||||||
TryHandleServiceMethodAsync(OapApiV1HttpMapping.UpdateApplicationMapping, httpRequest, GetService(httpRequest).UpdateApplicationAsync, cancellationToken);
|
TryHandleServiceMethodAsync(OapApiV1HttpMapping.UpdateApplicationMapping, httpRequest, GetService(httpRequest).UpdateApplicationAsync, cancellationToken);
|
||||||
|
|
||||||
private IOapApiV1 GetService(HttpRequestMessage httpRequest) => m_service ?? m_getService(httpRequest);
|
private IOapApiV1 GetService(HttpRequestMessage httpRequest) => m_service ?? m_getService(httpRequest);
|
||||||
|
|
||||||
private static readonly ServiceHttpHandlerDefaults s_defaults = new ServiceHttpHandlerDefaults
|
private static readonly ServiceHttpHandlerDefaults s_defaults = new ServiceHttpHandlerDefaults
|
||||||
{
|
{
|
||||||
ContentSerializer = HttpContentSerializer.Create(SystemTextJsonServiceSerializer.Instance),
|
ContentSerializer = HttpContentSerializer.Create(SystemTextJsonServiceSerializer.Instance),
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly IOapApiV1 m_service;
|
private readonly IOapApiV1 m_service;
|
||||||
private readonly Func<HttpRequestMessage, IOapApiV1> m_getService;
|
private readonly Func<HttpRequestMessage, IOapApiV1> m_getService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,186 +1,186 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
using Facility.Core.Http;
|
using Facility.Core.Http;
|
||||||
|
|
||||||
#pragma warning disable 612, 618 // member is obsolete
|
#pragma warning disable 612, 618 // member is obsolete
|
||||||
|
|
||||||
namespace OapApi.v1.Client.Http
|
namespace OapApi.v1.Client.Http
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public static partial class OapApiV1HttpMapping
|
public static partial class OapApiV1HttpMapping
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets applications for the current user.
|
/// Gets applications for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly HttpMethodMapping<GetApplicationsRequestDto, GetApplicationsResponseDto> GetApplicationsMapping =
|
public static readonly HttpMethodMapping<GetApplicationsRequestDto, GetApplicationsResponseDto> GetApplicationsMapping =
|
||||||
new HttpMethodMapping<GetApplicationsRequestDto, GetApplicationsResponseDto>.Builder
|
new HttpMethodMapping<GetApplicationsRequestDto, GetApplicationsResponseDto>.Builder
|
||||||
{
|
{
|
||||||
HttpMethod = HttpMethod.Get,
|
HttpMethod = HttpMethod.Get,
|
||||||
Path = "/applications",
|
Path = "/applications",
|
||||||
GetUriParameters = request =>
|
GetUriParameters = request =>
|
||||||
new Dictionary<string, string>
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "status", request.Status == null ? null : request.Status.Value.ToString() },
|
{ "status", request.Status == null ? null : request.Status.Value.ToString() },
|
||||||
{ "limit", request.Limit == null ? null : request.Limit.Value.ToString(CultureInfo.InvariantCulture) },
|
{ "limit", request.Limit == null ? null : request.Limit.Value.ToString(CultureInfo.InvariantCulture) },
|
||||||
{ "nextToken", request.NextToken },
|
{ "nextToken", request.NextToken },
|
||||||
},
|
},
|
||||||
SetUriParameters = (request, parameters) =>
|
SetUriParameters = (request, parameters) =>
|
||||||
{
|
{
|
||||||
parameters.TryGetValue("status", out var queryParameterStatus);
|
parameters.TryGetValue("status", out var queryParameterStatus);
|
||||||
request.Status = queryParameterStatus == null ? default(ApplicationStatus?) : new ApplicationStatus(queryParameterStatus);
|
request.Status = queryParameterStatus == null ? default(ApplicationStatus?) : new ApplicationStatus(queryParameterStatus);
|
||||||
parameters.TryGetValue("limit", out var queryParameterLimit);
|
parameters.TryGetValue("limit", out var queryParameterLimit);
|
||||||
request.Limit = ServiceDataUtility.TryParseInt32(queryParameterLimit);
|
request.Limit = ServiceDataUtility.TryParseInt32(queryParameterLimit);
|
||||||
parameters.TryGetValue("nextToken", out var queryParameterNextToken);
|
parameters.TryGetValue("nextToken", out var queryParameterNextToken);
|
||||||
request.NextToken = queryParameterNextToken;
|
request.NextToken = queryParameterNextToken;
|
||||||
return request;
|
return request;
|
||||||
},
|
},
|
||||||
ResponseMappings =
|
ResponseMappings =
|
||||||
{
|
{
|
||||||
new HttpResponseMapping<GetApplicationsResponseDto>.Builder
|
new HttpResponseMapping<GetApplicationsResponseDto>.Builder
|
||||||
{
|
{
|
||||||
StatusCode = (HttpStatusCode) 200,
|
StatusCode = (HttpStatusCode) 200,
|
||||||
ResponseBodyType = typeof(GetApplicationsResponseDto),
|
ResponseBodyType = typeof(GetApplicationsResponseDto),
|
||||||
}.Build(),
|
}.Build(),
|
||||||
},
|
},
|
||||||
}.Build();
|
}.Build();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new application for the current user.
|
/// Creates a new application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly HttpMethodMapping<CreateApplicationRequestDto, CreateApplicationResponseDto> CreateApplicationMapping =
|
public static readonly HttpMethodMapping<CreateApplicationRequestDto, CreateApplicationResponseDto> CreateApplicationMapping =
|
||||||
new HttpMethodMapping<CreateApplicationRequestDto, CreateApplicationResponseDto>.Builder
|
new HttpMethodMapping<CreateApplicationRequestDto, CreateApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
HttpMethod = HttpMethod.Post,
|
HttpMethod = HttpMethod.Post,
|
||||||
Path = "/applications/",
|
Path = "/applications/",
|
||||||
ValidateRequest = request =>
|
ValidateRequest = request =>
|
||||||
{
|
{
|
||||||
if (request.ApplicationCreateSet == null)
|
if (request.ApplicationCreateSet == null)
|
||||||
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("applicationCreateSet"));
|
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("applicationCreateSet"));
|
||||||
return ServiceResult.Success();
|
return ServiceResult.Success();
|
||||||
},
|
},
|
||||||
RequestBodyType = typeof(ApplicationCreateSetDto),
|
RequestBodyType = typeof(ApplicationCreateSetDto),
|
||||||
GetRequestBody = request => request.ApplicationCreateSet,
|
GetRequestBody = request => request.ApplicationCreateSet,
|
||||||
CreateRequest = body => new CreateApplicationRequestDto { ApplicationCreateSet = (ApplicationCreateSetDto) body },
|
CreateRequest = body => new CreateApplicationRequestDto { ApplicationCreateSet = (ApplicationCreateSetDto) body },
|
||||||
ResponseMappings =
|
ResponseMappings =
|
||||||
{
|
{
|
||||||
new HttpResponseMapping<CreateApplicationResponseDto>.Builder
|
new HttpResponseMapping<CreateApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
StatusCode = (HttpStatusCode) 200,
|
StatusCode = (HttpStatusCode) 200,
|
||||||
ResponseBodyType = typeof(ApplicationDto),
|
ResponseBodyType = typeof(ApplicationDto),
|
||||||
MatchesResponse = response => response.Application != null,
|
MatchesResponse = response => response.Application != null,
|
||||||
GetResponseBody = response => response.Application,
|
GetResponseBody = response => response.Application,
|
||||||
CreateResponse = body => new CreateApplicationResponseDto { Application = (ApplicationDto) body },
|
CreateResponse = body => new CreateApplicationResponseDto { Application = (ApplicationDto) body },
|
||||||
}.Build(),
|
}.Build(),
|
||||||
new HttpResponseMapping<CreateApplicationResponseDto>.Builder
|
new HttpResponseMapping<CreateApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
StatusCode = (HttpStatusCode) 201,
|
StatusCode = (HttpStatusCode) 201,
|
||||||
}.Build(),
|
}.Build(),
|
||||||
},
|
},
|
||||||
}.Build();
|
}.Build();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified application for the current user.
|
/// Gets the specified application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly HttpMethodMapping<GetApplicationRequestDto, GetApplicationResponseDto> GetApplicationMapping =
|
public static readonly HttpMethodMapping<GetApplicationRequestDto, GetApplicationResponseDto> GetApplicationMapping =
|
||||||
new HttpMethodMapping<GetApplicationRequestDto, GetApplicationResponseDto>.Builder
|
new HttpMethodMapping<GetApplicationRequestDto, GetApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
HttpMethod = HttpMethod.Get,
|
HttpMethod = HttpMethod.Get,
|
||||||
Path = "/applications/{id}",
|
Path = "/applications/{id}",
|
||||||
ValidateRequest = request =>
|
ValidateRequest = request =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(request.Id))
|
if (string.IsNullOrEmpty(request.Id))
|
||||||
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("id"));
|
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("id"));
|
||||||
return ServiceResult.Success();
|
return ServiceResult.Success();
|
||||||
},
|
},
|
||||||
GetUriParameters = request =>
|
GetUriParameters = request =>
|
||||||
new Dictionary<string, string>
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "id", request.Id },
|
{ "id", request.Id },
|
||||||
},
|
},
|
||||||
SetUriParameters = (request, parameters) =>
|
SetUriParameters = (request, parameters) =>
|
||||||
{
|
{
|
||||||
parameters.TryGetValue("id", out var queryParameterId);
|
parameters.TryGetValue("id", out var queryParameterId);
|
||||||
request.Id = queryParameterId;
|
request.Id = queryParameterId;
|
||||||
return request;
|
return request;
|
||||||
},
|
},
|
||||||
ResponseMappings =
|
ResponseMappings =
|
||||||
{
|
{
|
||||||
new HttpResponseMapping<GetApplicationResponseDto>.Builder
|
new HttpResponseMapping<GetApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
StatusCode = (HttpStatusCode) 200,
|
StatusCode = (HttpStatusCode) 200,
|
||||||
ResponseBodyType = typeof(ApplicationDto),
|
ResponseBodyType = typeof(ApplicationDto),
|
||||||
MatchesResponse = response => response.Application != null,
|
MatchesResponse = response => response.Application != null,
|
||||||
GetResponseBody = response => response.Application,
|
GetResponseBody = response => response.Application,
|
||||||
CreateResponse = body => new GetApplicationResponseDto { Application = (ApplicationDto) body },
|
CreateResponse = body => new GetApplicationResponseDto { Application = (ApplicationDto) body },
|
||||||
}.Build(),
|
}.Build(),
|
||||||
new HttpResponseMapping<GetApplicationResponseDto>.Builder
|
new HttpResponseMapping<GetApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
StatusCode = (HttpStatusCode) 304,
|
StatusCode = (HttpStatusCode) 304,
|
||||||
MatchesResponse = response => response.NotModified.GetValueOrDefault(),
|
MatchesResponse = response => response.NotModified.GetValueOrDefault(),
|
||||||
CreateResponse = body => new GetApplicationResponseDto { NotModified = true },
|
CreateResponse = body => new GetApplicationResponseDto { NotModified = true },
|
||||||
}.Build(),
|
}.Build(),
|
||||||
},
|
},
|
||||||
GetResponseHeaders = response =>
|
GetResponseHeaders = response =>
|
||||||
new Dictionary<string, string>
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
["eTag"] = response.ETag,
|
["eTag"] = response.ETag,
|
||||||
},
|
},
|
||||||
SetResponseHeaders = (response, headers) =>
|
SetResponseHeaders = (response, headers) =>
|
||||||
{
|
{
|
||||||
headers.TryGetValue("eTag", out var headerETag);
|
headers.TryGetValue("eTag", out var headerETag);
|
||||||
response.ETag = headerETag;
|
response.ETag = headerETag;
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
}.Build();
|
}.Build();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the application.
|
/// Updates the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly HttpMethodMapping<UpdateApplicationRequestDto, UpdateApplicationResponseDto> UpdateApplicationMapping =
|
public static readonly HttpMethodMapping<UpdateApplicationRequestDto, UpdateApplicationResponseDto> UpdateApplicationMapping =
|
||||||
new HttpMethodMapping<UpdateApplicationRequestDto, UpdateApplicationResponseDto>.Builder
|
new HttpMethodMapping<UpdateApplicationRequestDto, UpdateApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
HttpMethod = new HttpMethod("PATCH"),
|
HttpMethod = new HttpMethod("PATCH"),
|
||||||
Path = "/applications/{id}",
|
Path = "/applications/{id}",
|
||||||
ValidateRequest = request =>
|
ValidateRequest = request =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(request.Id))
|
if (string.IsNullOrEmpty(request.Id))
|
||||||
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("id"));
|
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("id"));
|
||||||
if (request.ApplicationChangeSet == null)
|
if (request.ApplicationChangeSet == null)
|
||||||
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("applicationChangeSet"));
|
return ServiceResult.Failure(ServiceErrors.CreateRequestFieldRequired("applicationChangeSet"));
|
||||||
return ServiceResult.Success();
|
return ServiceResult.Success();
|
||||||
},
|
},
|
||||||
GetUriParameters = request =>
|
GetUriParameters = request =>
|
||||||
new Dictionary<string, string>
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "id", request.Id },
|
{ "id", request.Id },
|
||||||
},
|
},
|
||||||
SetUriParameters = (request, parameters) =>
|
SetUriParameters = (request, parameters) =>
|
||||||
{
|
{
|
||||||
parameters.TryGetValue("id", out var queryParameterId);
|
parameters.TryGetValue("id", out var queryParameterId);
|
||||||
request.Id = queryParameterId;
|
request.Id = queryParameterId;
|
||||||
return request;
|
return request;
|
||||||
},
|
},
|
||||||
RequestBodyType = typeof(ApplicationChangeSetDto),
|
RequestBodyType = typeof(ApplicationChangeSetDto),
|
||||||
GetRequestBody = request => request.ApplicationChangeSet,
|
GetRequestBody = request => request.ApplicationChangeSet,
|
||||||
CreateRequest = body => new UpdateApplicationRequestDto { ApplicationChangeSet = (ApplicationChangeSetDto) body },
|
CreateRequest = body => new UpdateApplicationRequestDto { ApplicationChangeSet = (ApplicationChangeSetDto) body },
|
||||||
ResponseMappings =
|
ResponseMappings =
|
||||||
{
|
{
|
||||||
new HttpResponseMapping<UpdateApplicationResponseDto>.Builder
|
new HttpResponseMapping<UpdateApplicationResponseDto>.Builder
|
||||||
{
|
{
|
||||||
StatusCode = (HttpStatusCode) 200,
|
StatusCode = (HttpStatusCode) 200,
|
||||||
ResponseBodyType = typeof(ApplicationDto),
|
ResponseBodyType = typeof(ApplicationDto),
|
||||||
MatchesResponse = response => response.Application != null,
|
MatchesResponse = response => response.Application != null,
|
||||||
GetResponseBody = response => response.Application,
|
GetResponseBody = response => response.Application,
|
||||||
CreateResponse = body => new UpdateApplicationResponseDto { Application = (ApplicationDto) body },
|
CreateResponse = body => new UpdateApplicationResponseDto { Application = (ApplicationDto) body },
|
||||||
}.Build(),
|
}.Build(),
|
||||||
},
|
},
|
||||||
}.Build();
|
}.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public partial interface IOapApiV1
|
public partial interface IOapApiV1
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets applications for the current user.
|
/// Gets applications for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default);
|
Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new application for the current user.
|
/// Creates a new application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default);
|
Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified application for the current user.
|
/// Gets the specified application for the current user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default);
|
Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the application.
|
/// Updates the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default);
|
Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
internal static class OapApiV1Methods
|
internal static class OapApiV1Methods
|
||||||
{
|
{
|
||||||
public static readonly IServiceMethodInfo GetApplications =
|
public static readonly IServiceMethodInfo GetApplications =
|
||||||
ServiceMethodInfo.Create<IOapApiV1, GetApplicationsRequestDto, GetApplicationsResponseDto>(
|
ServiceMethodInfo.Create<IOapApiV1, GetApplicationsRequestDto, GetApplicationsResponseDto>(
|
||||||
"getApplications", "OapApiV1", x => x.GetApplicationsAsync);
|
"getApplications", "OapApiV1", x => x.GetApplicationsAsync);
|
||||||
|
|
||||||
public static readonly IServiceMethodInfo CreateApplication =
|
public static readonly IServiceMethodInfo CreateApplication =
|
||||||
ServiceMethodInfo.Create<IOapApiV1, CreateApplicationRequestDto, CreateApplicationResponseDto>(
|
ServiceMethodInfo.Create<IOapApiV1, CreateApplicationRequestDto, CreateApplicationResponseDto>(
|
||||||
"createApplication", "OapApiV1", x => x.CreateApplicationAsync);
|
"createApplication", "OapApiV1", x => x.CreateApplicationAsync);
|
||||||
|
|
||||||
public static readonly IServiceMethodInfo GetApplication =
|
public static readonly IServiceMethodInfo GetApplication =
|
||||||
ServiceMethodInfo.Create<IOapApiV1, GetApplicationRequestDto, GetApplicationResponseDto>(
|
ServiceMethodInfo.Create<IOapApiV1, GetApplicationRequestDto, GetApplicationResponseDto>(
|
||||||
"getApplication", "OapApiV1", x => x.GetApplicationAsync);
|
"getApplication", "OapApiV1", x => x.GetApplicationAsync);
|
||||||
|
|
||||||
public static readonly IServiceMethodInfo UpdateApplication =
|
public static readonly IServiceMethodInfo UpdateApplication =
|
||||||
ServiceMethodInfo.Create<IOapApiV1, UpdateApplicationRequestDto, UpdateApplicationResponseDto>(
|
ServiceMethodInfo.Create<IOapApiV1, UpdateApplicationRequestDto, UpdateApplicationResponseDto>(
|
||||||
"updateApplication", "OapApiV1", x => x.UpdateApplicationAsync);
|
"updateApplication", "OapApiV1", x => x.UpdateApplicationAsync);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Request for UpdateApplication.
|
/// Request for UpdateApplication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class UpdateApplicationRequestDto : ServiceDto<UpdateApplicationRequestDto>
|
public sealed partial class UpdateApplicationRequestDto : ServiceDto<UpdateApplicationRequestDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UpdateApplicationRequestDto()
|
public UpdateApplicationRequestDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The application ID.
|
/// The application ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The application update set.
|
/// The application update set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationChangeSetDto ApplicationChangeSet { get; set; }
|
public ApplicationChangeSetDto ApplicationChangeSet { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(UpdateApplicationRequestDto other)
|
public override bool IsEquivalentTo(UpdateApplicationRequestDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
Id == other.Id &&
|
Id == other.Id &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(ApplicationChangeSet, other.ApplicationChangeSet);
|
ServiceDataUtility.AreEquivalentDtos(ApplicationChangeSet, other.ApplicationChangeSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// DO NOT EDIT: generated by fsdgencsharp
|
// DO NOT EDIT: generated by fsdgencsharp
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
|
|
||||||
namespace OapApi.v1.Client
|
namespace OapApi.v1.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Response for UpdateApplication.
|
/// Response for UpdateApplication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||||
public sealed partial class UpdateApplicationResponseDto : ServiceDto<UpdateApplicationResponseDto>
|
public sealed partial class UpdateApplicationResponseDto : ServiceDto<UpdateApplicationResponseDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance.
|
/// Creates an instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UpdateApplicationResponseDto()
|
public UpdateApplicationResponseDto()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The updated Application.
|
/// The updated Application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApplicationDto Application { get; set; }
|
public ApplicationDto Application { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The JSON serializer.
|
/// The JSON serializer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
protected override JsonServiceSerializer JsonSerializer => SystemTextJsonServiceSerializer.Instance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if two DTOs are equivalent.
|
/// Determines if two DTOs are equivalent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsEquivalentTo(UpdateApplicationResponseDto other)
|
public override bool IsEquivalentTo(UpdateApplicationResponseDto other)
|
||||||
{
|
{
|
||||||
return other != null &&
|
return other != null &&
|
||||||
ServiceDataUtility.AreEquivalentDtos(Application, other.Application);
|
ServiceDataUtility.AreEquivalentDtos(Application, other.Application);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,49 @@
|
|||||||
using Facility.Core;
|
using Facility.Core;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using OapApi.v1.Client;
|
using OapApi.v1.Client;
|
||||||
|
|
||||||
namespace OapApi.v1;
|
namespace OapApi.v1;
|
||||||
|
|
||||||
public sealed class OapApiV1 : IOapApiV1
|
public sealed class OapApiV1 : IOapApiV1
|
||||||
{
|
{
|
||||||
public OapApiV1()
|
public OapApiV1()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default)
|
return Task.FromResult(ServiceResult.Success(new CreateApplicationResponseDto
|
||||||
{
|
{
|
||||||
return Task.FromResult(ServiceResult.Success(new GetApplicationResponseDto
|
Application = new ApplicationDto
|
||||||
{
|
{
|
||||||
Application = new ApplicationDto
|
Id = "-1",
|
||||||
{
|
Status = ApplicationStatus.InProgress,
|
||||||
Id = "1",
|
Terms = new ApplicationTermsDto
|
||||||
Status = ApplicationStatus.InProgress,
|
{
|
||||||
Terms = new ApplicationTermsDto
|
HasReadInstructions = request.ApplicationCreateSet.Terms.HasReadInstructions,
|
||||||
{
|
}
|
||||||
HasReadInstructions = true,
|
}
|
||||||
}
|
}));
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
}
|
public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
public Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
return Task.FromResult(ServiceResult.Success(new GetApplicationResponseDto
|
||||||
|
{
|
||||||
public Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
Application = new ApplicationDto
|
||||||
}
|
{
|
||||||
|
Id = "1",
|
||||||
|
Status = ApplicationStatus.InProgress,
|
||||||
|
Terms = new ApplicationTermsDto
|
||||||
|
{
|
||||||
|
HasReadInstructions = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
||||||
|
|
||||||
|
public Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,34 +1,35 @@
|
|||||||
using Facility.AspNetCore;
|
using Facility.AspNetCore;
|
||||||
using Facility.Core.Http;
|
using Facility.Core.Http;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Routing;
|
using Microsoft.AspNetCore.Routing;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using OapApi.v1.Client;
|
using OapApi.v1.Client;
|
||||||
using OapApi.v1.Client.Http;
|
using OapApi.v1.Client.Http;
|
||||||
|
using OrchardCore.Mvc.Core.Utilities;
|
||||||
namespace OapApi.v1
|
|
||||||
{
|
namespace OapApi.v1
|
||||||
public class Startup : OrchardCore.Modules.StartupBase
|
{
|
||||||
{
|
public class Startup : OrchardCore.Modules.StartupBase
|
||||||
public override void ConfigureServices(IServiceCollection services)
|
{
|
||||||
{
|
public override void ConfigureServices(IServiceCollection services)
|
||||||
services.AddScoped<IOapApiV1, OapApiV1>();
|
{
|
||||||
|
services.AddScoped<IOapApiV1, OapApiV1>();
|
||||||
services.AddScoped(sp =>
|
|
||||||
{
|
services.AddScoped(sp =>
|
||||||
return new OapApiV1HttpHandler(
|
{
|
||||||
sp.GetRequiredService<IOapApiV1>(),
|
return new OapApiV1HttpHandler(
|
||||||
new ServiceHttpHandlerSettings
|
sp.GetRequiredService<IOapApiV1>(),
|
||||||
{
|
new ServiceHttpHandlerSettings
|
||||||
RootPath = "/oap/api/v1",
|
{
|
||||||
});
|
RootPath = "/oap/api/v1",
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
}
|
||||||
public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
|
|
||||||
{
|
public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
|
||||||
builder.UseFacilityExceptionHandler();
|
{
|
||||||
builder.UseFacilityHttpHandler<OapApiV1HttpHandler>();
|
builder.UseFacilityExceptionHandler();
|
||||||
}
|
builder.UseFacilityHttpHandler<OapApiV1HttpHandler>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user