//
//  AdTrackingApi.swift
//  SodaLive
//
//  Created by klaus on 3/26/25.
//

import Foundation
import Moya

enum AdTrackingApi {
    case appLaunch(pid: String)
}

extension AdTrackingApi: TargetType {
    var baseURL: URL {
        return URL(string: BASE_URL)!
    }
    
    var path: String {
        switch self {
        case .appLaunch:
            return "/ad-tracking/app-launch"
        }
    }
    
    var method: Moya.Method {
        switch self {
        case .appLaunch:
            return .post
        }
    }
    
    var task: Moya.Task {
        switch self {
        case .appLaunch(let pid):
            return .requestJSONEncodable(AdTrackingAppLaunchRequest(pid: pid))
        }
    }
    
    var headers: [String : String]? {
        return nil
    }
}
