using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi;
namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
public interface IInboundApiRepository
{
// ApiKey persistence retired (re-arch C5): inbound API keys live in the shared
// ZB.MOM.WW.Auth.ApiKeys SQLite store, not the SQL Server configuration DB. The
// former GetApiKeyByIdAsync / GetAllApiKeysAsync / GetApiKeyByValueAsync /
// AddApiKeyAsync / UpdateApiKeyAsync / DeleteApiKeyAsync / GetApprovedKeysForMethodAsync
// methods were removed with the SQL Server ApiKey entity.
// ApiMethod
/// Retrieves an API method by ID.
/// The API method ID.
/// Cancellation token.
Task GetApiMethodByIdAsync(int id, CancellationToken cancellationToken = default);
/// Retrieves all API methods.
/// Cancellation token.
Task> GetAllApiMethodsAsync(CancellationToken cancellationToken = default);
/// Retrieves an API method by name.
/// The API method name.
/// Cancellation token.
Task GetMethodByNameAsync(string name, CancellationToken cancellationToken = default);
/// Adds a new API method.
/// The API method to add.
/// Cancellation token.
Task AddApiMethodAsync(ApiMethod method, CancellationToken cancellationToken = default);
/// Updates an existing API method.
/// The API method to update.
/// Cancellation token.
Task UpdateApiMethodAsync(ApiMethod method, CancellationToken cancellationToken = default);
/// Deletes an API method by ID.
/// The API method ID.
/// Cancellation token.
Task DeleteApiMethodAsync(int id, CancellationToken cancellationToken = default);
/// Saves pending changes to the database.
/// Cancellation token.
Task SaveChangesAsync(CancellationToken cancellationToken = default);
}