mirrored_repositories/ecommerce-riverpod-clean-architecture/lib/core
part of 'rest_client.dart';

//PUBLIC => Generic API url without access token
//PROTECTED => Generic API url with access token
enum APIType { public, protected }

abstract class ApiOptions {
  Options options = Options();
}

class PublicApiOptions extends ApiOptions {
  PublicApiOptions() {
    super.options.headers = <String, dynamic>{
      'Accept': 'application/json',
      'Content-type': 'application/json',
    };
  }
}

class ProtectedApiOptions extends ApiOptions {
  ProtectedApiOptions(String apiToken) {
    super.options.headers = <String, dynamic>{
      'Accept': 'application/json',
      'Content-Type': 'application/json',
      'Authorization': 'Bearer $apiToken',
    };
  }
}
