You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Framework/Connected.Net/Endpoints/IEndpointService.cs

32 lines
1.2 KiB

2 years ago
using System.Collections.Immutable;
using Connected.Annotations;
using Connected.ServiceModel;
namespace Connected.Net.Endpoints;
/// <summary>
/// This is <see cref="IApiService"/> for <see cref="IEndpoint"/> entity.
/// </summary>
/// <remarks>
/// The environment consists of one or more instances, each described as an <see cref="IEndpoint"/>.
/// If more that one <see cref="IEndpoint"/> exists, it means the environment is scaled out.
/// There should be always at least one <see cref="IEndpoint"/> defined.
/// </remarks>
[Service]
public interface IEndpointService
{
/// <summary>
/// This method returns all registered endpoints in the current environment
/// </summary>
/// <returns>List of <see cref="IEndpoint"/> entities.</returns>
[ServiceMethod(ServiceMethodVerbs.Get)]
Task<ImmutableList<IEndpoint>> Query();
/// <summary>
/// This method returns <see cref="IEndpoint"/> for the specified id.
/// </summary>
/// <param name="e">The id of the endpoint for which the entity will be returned.</param>
/// <returns><see cref="IEndpoint"/> for the specified id if exists, null otherwise.</returns>
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
Task<IEndpoint?> Select(PrimaryKeyArgs<int> e);
}