// Generated by smithplates HTTP codegen. Do not edit.

import { CategoriesApiClient } from "generated/petstore/api/petstore/clients/categoriesClient";
import { HealthApiClient } from "generated/petstore/api/petstore/clients/healthClient";
import { OrdersApiClient } from "generated/petstore/api/petstore/clients/ordersClient";
import { PetsApiClient } from "generated/petstore/api/petstore/clients/petsClient";

export interface ApiClients {
  categoriesClient: CategoriesApiClient;
  healthClient: HealthApiClient;
  ordersClient: OrdersApiClient;
  petsClient: PetsApiClient;
}

export function createApiClients(
  baseUrl: string,
  fetchFn: typeof fetch = fetch,
): ApiClients {
  const normalizedBaseUrl = baseUrl.replace(/\/+$/, "");
  return {
    categoriesClient: new CategoriesApiClient(normalizedBaseUrl, fetchFn),
    healthClient: new HealthApiClient(normalizedBaseUrl, fetchFn),
    ordersClient: new OrdersApiClient(normalizedBaseUrl, fetchFn),
    petsClient: new PetsApiClient(normalizedBaseUrl, fetchFn),
  };
}
