dolittle/DotNET.SDK

View on GitHub
Source/Tenancy.Client/ITenants.cs

Summary

Maintainability
A
0 mins
Test Coverage
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using ExecutionContext = Dolittle.SDK.Execution.ExecutionContext;

namespace Dolittle.SDK.Tenancy.Client;

/// <summary>
/// Defines a system that knows about Tenants in the Runtime.
/// </summary>
public interface ITenants
{
    /// <summary>
    /// Gets all tenants.
    /// </summary>
    /// <param name="executionContext">The <see cref="ExecutionContext"/>.</param>
    /// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
    /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
    /// <exception cref="FailedToGetAllTenants">Exception that gets thrown when the Runtime failed getting all tenants.</exception>
    Task<IEnumerable<Tenant>> GetAll(ExecutionContext executionContext, CancellationToken cancellationToken = default);
}