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

import Alamofire



public class TextTextNamedEntityRecognitionAPI: APIBase {
    /**
     * enum for parameter model
     */
    public enum Model_applyTextTextNamedEntityRecognitionPost: String { 
        case DbmdzBertLargeCasedFinetunedConll03English = "dbmdz-bert-large-cased-finetuned-conll03-english"
    }

    /**
     Apply model for the named-entity-recognition task for a given models
     
     - parameter text: (query)  (optional)
     - parameter model: (query)  (optional)
     - parameter completion: completion handler to receive the data and the error objects
     */
    public class func applyTextTextNamedEntityRecognitionPost(text text: String? = nil, model: Model_applyTextTextNamedEntityRecognitionPost? = nil, completion: ((data: AnyObject?, error: ErrorType?) -> Void)) {
        applyTextTextNamedEntityRecognitionPostWithRequestBuilder(text: text, model: model).execute { (response, error) -> Void in
            completion(data: response?.body, error: error);
        }
    }


    /**
     Apply model for the named-entity-recognition task for a given models
     - POST /text/text/named-entity-recognition/     - parameter text: (query)  (optional)
     - parameter model: (query)  (optional)

     - returns: RequestBuilder<AnyObject> 
     */
    public class func applyTextTextNamedEntityRecognitionPostWithRequestBuilder(text text: String? = nil, model: Model_applyTextTextNamedEntityRecognitionPost? = nil) -> RequestBuilder<AnyObject> {
        let path = "/text/text/named-entity-recognition/"
        let URLString = OpenAPIClientAPI.basePath + path

        let nillableParameters: [String:AnyObject?] = [
            "text": text,
            "model": model?.rawValue
        ]
 
        let parameters = APIHelper.rejectNil(nillableParameters)
 
        let convertedParameters = APIHelper.convertBoolToString(parameters)
 
        let requestBuilder: RequestBuilder<AnyObject>.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder()

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

    /**
     Get list of models available for named-entity-recognition
     
     - parameter completion: completion handler to receive the data and the error objects
     */
    public class func getVersionsTextTextNamedEntityRecognitionGet(completion: ((data: AnyObject?, error: ErrorType?) -> Void)) {
        getVersionsTextTextNamedEntityRecognitionGetWithRequestBuilder().execute { (response, error) -> Void in
            completion(data: response?.body, error: error);
        }
    }


    /**
     Get list of models available for named-entity-recognition
     - GET /text/text/named-entity-recognition/
     - returns: RequestBuilder<AnyObject> 
     */
    public class func getVersionsTextTextNamedEntityRecognitionGetWithRequestBuilder() -> RequestBuilder<AnyObject> {
        let path = "/text/text/named-entity-recognition/"
        let URLString = OpenAPIClientAPI.basePath + path

        let nillableParameters: [String:AnyObject?] = [:]
 
        let parameters = APIHelper.rejectNil(nillableParameters)
 
        let convertedParameters = APIHelper.convertBoolToString(parameters)
 
        let requestBuilder: RequestBuilder<AnyObject>.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true)
    }

}
