using AzureRestApi.Models.Resources;

namespace AzureRestApi.Repositories
{
    public class AzureResourceGroupRepository : AzureBaseRepository<ResourceGroup>
    {
        public AzureResourceGroupRepository(HttpClient httpClient, AccessTokenRepository accessTokenRepository) : base(httpClient, accessTokenRepository)
        {
        }

        public async Task<List<ResourceGroup>> GetAll(string subscriptionId)
        {
            // GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups?api-version=2021-04-01
            var uri = new Uri($"https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups?api-version=2021-04-01");
            return await GetAllByUri(uri);
        }
    }
}
