//
// TextTextEmotionRecognitionAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

import Foundation
import Alamofire



open class TextTextEmotionRecognitionAPI {
    /**
     * enum for parameter model
     */
    public enum Model_applyTextTextEmotionRecognitionPost: String {
        case mrm8488T5BaseFinetunedEmotion = "mrm8488-t5-base-finetuned-emotion"
    }

    /**
     Apply model for the emotion-recognition task for a given models
     
     - parameter text: (query)  (optional, default to "I like you. I love you")
     - parameter model: (query)  (optional, default to .mrm8488-t5-base-finetuned-emotion)
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func applyTextTextEmotionRecognitionPost(text: String? = nil, model: Model_applyTextTextEmotionRecognitionPost? = nil, completion: @escaping ((_ data: Any?,_ error: Error?) -> Void)) {
        applyTextTextEmotionRecognitionPostWithRequestBuilder(text: text, model: model).execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }

    /**
     Apply model for the emotion-recognition task for a given models
     - POST /text/text/emotion-recognition/
     - parameter text: (query)  (optional, default to "I like you. I love you")
     - parameter model: (query)  (optional, default to .mrm8488-t5-base-finetuned-emotion)
     - returns: RequestBuilder<Any> 
     */
    open class func applyTextTextEmotionRecognitionPostWithRequestBuilder(text: String? = nil, model: Model_applyTextTextEmotionRecognitionPost? = nil) -> RequestBuilder<Any> {
        let path = "/text/text/emotion-recognition/"
        let URLString = OpenAPIClientAPI.basePath + path
        let parameters: [String:Any]? = nil
        
        var url = URLComponents(string: URLString)
        url?.queryItems = APIHelper.mapValuesToQueryItems([
            "text": text, 
            "model": model?.rawValue
        ])

        let requestBuilder: RequestBuilder<Any>.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
    }

    /**
     Get list of models available for emotion-recognition
     
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func getVersionsTextTextEmotionRecognitionGet(completion: @escaping ((_ data: Any?,_ error: Error?) -> Void)) {
        getVersionsTextTextEmotionRecognitionGetWithRequestBuilder().execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }

    /**
     Get list of models available for emotion-recognition
     - GET /text/text/emotion-recognition/
     - returns: RequestBuilder<Any> 
     */
    open class func getVersionsTextTextEmotionRecognitionGetWithRequestBuilder() -> RequestBuilder<Any> {
        let path = "/text/text/emotion-recognition/"
        let URLString = OpenAPIClientAPI.basePath + path
        let parameters: [String:Any]? = nil
        
        let url = URLComponents(string: URLString)

        let requestBuilder: RequestBuilder<Any>.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
    }

}
